Merge PR #3243: allow multiple simultaneous redelegations/ubds between same delegator/validator(s) addresses

* remove kv seperation for marshalling

* pending

* cleanup

* cleanup x2

* pending

* working

* minor refactors

* entry structs defined

* uncompiled mechanism written

* add many compile fixes

* code compiles

* fix test compile errors

* test cover passes

* ...

* multiple entries fix

* ...

* more design fix

* working

* fix test cover bug

* Update PENDING.md

* update comment around queue completion for redelegations/ubds

* basic spec updates

* remove ErrConflictingRedelegation

* @cwgoes comments are resolved

* Update x/staking/keeper/slash.go

Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com>

* address @alexanderbez comments
This commit is contained in:
frog power 4000
2019-01-16 05:35:18 -05:00
committed by GitHub
parent 916ea85630
commit 133934ae37
19 changed files with 752 additions and 424 deletions
+6 -2
View File
@@ -116,14 +116,18 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context) {
// iterate through redelegations, reset creation height
app.stakingKeeper.IterateRedelegations(ctx, func(_ int64, red staking.Redelegation) (stop bool) {
red.CreationHeight = 0
for i := range red.Entries {
red.Entries[i].CreationHeight = 0
}
app.stakingKeeper.SetRedelegation(ctx, red)
return false
})
// iterate through unbonding delegations, reset creation height
app.stakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd staking.UnbondingDelegation) (stop bool) {
ubd.CreationHeight = 0
for i := range ubd.Entries {
ubd.Entries[i].CreationHeight = 0
}
app.stakingKeeper.SetUnbondingDelegation(ctx, ubd)
return false
})
+2 -1
View File
@@ -303,7 +303,8 @@ func TestGaiaCLICreateValidator(t *testing.T) {
// Get unbonding delegations from the validator
validatorUbds := f.QueryStakingUnbondingDelegationsFrom(barVal)
require.Len(t, validatorUbds, 1)
require.Equal(t, "1", validatorUbds[0].Balance.Amount.String())
require.Len(t, validatorUbds[0].Entries, 1)
require.Equal(t, "1", validatorUbds[0].Entries[0].Balance.Amount.String())
// Query staking parameters
params := f.QueryStakingParameters()