Force update staking store

This commit is contained in:
Christopher Goes 2018-05-29 08:49:37 +02:00
parent 6712ea7f3a
commit 74e8159c3f
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
1 changed files with 4 additions and 0 deletions

View File

@ -32,11 +32,15 @@ func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState) {
k.setPool(ctx, data.Pool)
k.setNewParams(ctx, data.Params)
for _, validator := range data.Validators {
// Staking assumes bonded validators are already stored, need to force update
validator.PoolShares.Status = sdk.Unbonded
k.updateValidator(ctx, validator)
}
for _, bond := range data.Bonds {
k.setDelegation(ctx, bond)
}
store := ctx.KVStore(k.storeKey)
k.updateBondedValidatorsFull(ctx, store)
}
// WriteGenesis - output genesis parameters