Skip to content

Commit 0be00a9

Browse files
Merge pull request #250 from terra-money/fix/delete-validator-0.2.x
fix: delete validator 0.3.x
2 parents d67aaaa + 73058d5 commit 0be00a9

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

x/alliance/keeper/hooks.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error {
1919
return nil
2020
}
2121

22-
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error {
22+
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error {
23+
h.k.DeleteValidatorInfo(ctx, valAddr)
2324
h.k.QueueAssetRebalanceEvent(ctx)
2425
return nil
2526
}

x/alliance/keeper/validator.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,9 @@ func (k Keeper) GetAllAllianceValidatorInfo(ctx sdk.Context) []types.AllianceVal
7272
}
7373
return infos
7474
}
75+
76+
func (k Keeper) DeleteValidatorInfo(ctx sdk.Context, valAddr sdk.ValAddress) {
77+
store := ctx.KVStore(k.storeKey)
78+
key := types.GetAllianceValidatorInfoKey(valAddr)
79+
store.Delete(key)
80+
}

x/alliance/tests/benchmark/benchmark_genesis.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)