Skip to content

Commit

Permalink
Adds pk template
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed Oct 25, 2022
1 parent 4830e7e commit 61a8d0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/ccv/provider/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (h Hooks) AfterUnbondingInitiated(ctx sdk.Context, ID uint64) {
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) {
}
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) {
//TODO:
}
func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) {
}
Expand Down
7 changes: 7 additions & 0 deletions x/ccv/provider/keeper/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ func MakeKeyMap(store Store) KeyMap {
}
}

func (e *KeyMap) DeleteProviderKey(pk ProviderPubKey) error {
if ck, ok := e.Store.GetPkToCk(pk); ok {
e.Store.DelCkToPk(ck)
}
e.Store.DelPkToCk(pk)
}

func (e *KeyMap) SetProviderPubKeyToConsumerPubKey(pk ProviderPubKey, ck ConsumerPubKey) error {
if _, ok := e.Store.GetCkToPk(ck); ok {
return errors.New(`cannot reuse key which is in use or was recently in use`)
Expand Down

0 comments on commit 61a8d0f

Please sign in to comment.