Merge PR #2394: Split up UpdateValidator into distinct state transitions applied only in EndBlock
This commit is contained in:
@@ -71,8 +71,8 @@ func TestQueryValidators(t *testing.T) {
|
||||
validators[i], pool, _ = validators[i].AddTokensFromDel(pool, amt)
|
||||
}
|
||||
keeper.SetPool(ctx, pool)
|
||||
validators[0] = keeper.UpdateValidator(ctx, validators[0])
|
||||
validators[1] = keeper.UpdateValidator(ctx, validators[1])
|
||||
keeper.SetValidator(ctx, validators[0])
|
||||
keeper.SetValidator(ctx, validators[1])
|
||||
|
||||
// Query Validators
|
||||
queriedValidators := keeper.GetValidators(ctx, params.MaxValidators)
|
||||
@@ -114,9 +114,14 @@ func TestQueryDelegation(t *testing.T) {
|
||||
// Create Validators and Delegation
|
||||
val1 := types.NewValidator(addrVal1, pk1, types.Description{})
|
||||
keeper.SetValidator(ctx, val1)
|
||||
pool := keeper.GetPool(ctx)
|
||||
keeper.SetValidatorByPowerIndex(ctx, val1, pool)
|
||||
|
||||
keeper.Delegate(ctx, addrAcc2, sdk.NewCoin("steak", sdk.NewInt(20)), val1, true)
|
||||
|
||||
// apply TM updates
|
||||
keeper.ApplyAndReturnValidatorSetUpdates(ctx)
|
||||
|
||||
// Query Delegator bonded validators
|
||||
queryParams := newTestDelegatorQuery(addrAcc2)
|
||||
bz, errRes := cdc.MarshalJSON(queryParams)
|
||||
|
||||
Reference in New Issue
Block a user