Merge PR #3673: Message & Codec Registration Consistency

This commit is contained in:
Alexander Bezobchuk
2019-02-25 16:16:52 +01:00
committed by Christopher Goes
parent 21bdecafeb
commit b9be1166f7
52 changed files with 453 additions and 450 deletions
+2 -2
View File
@@ -89,7 +89,7 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []st
// withdraw all delegator rewards
dels := app.stakingKeeper.GetAllDelegations(ctx)
for _, delegation := range dels {
_ = app.distrKeeper.WithdrawDelegationRewards(ctx, delegation.DelegatorAddr, delegation.ValidatorAddr)
_ = app.distrKeeper.WithdrawDelegationRewards(ctx, delegation.DelegatorAddress, delegation.ValidatorAddress)
}
// clear validator slash events
@@ -110,7 +110,7 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []st
// reinitialize all delegations
for _, del := range dels {
app.distrKeeper.Hooks().BeforeDelegationCreated(ctx, del.DelegatorAddr, del.ValidatorAddr)
app.distrKeeper.Hooks().BeforeDelegationCreated(ctx, del.DelegatorAddress, del.ValidatorAddress)
}
// reset context height
+2 -2
View File
@@ -360,8 +360,8 @@ func CollectStdTxs(cdc *codec.Codec, moniker string, genTxsDir string, genDoc tm
msg := msgs[0].(staking.MsgCreateValidator)
// validate delegator and validator addresses and funds against the accounts in the state
delAddr := msg.DelegatorAddr.String()
valAddr := sdk.AccAddress(msg.ValidatorAddr).String()
delAddr := msg.DelegatorAddress.String()
valAddr := sdk.AccAddress(msg.ValidatorAddress).String()
delAcc, delOk := addrMap[delAddr]
_, valOk := addrMap[valAddr]
+1 -1
View File
@@ -40,7 +40,7 @@ func makeGenesisState(t *testing.T, genTxs []auth.StdTx) GenesisState {
require.Equal(t, 1, len(msgs))
msg := msgs[0].(staking.MsgCreateValidator)
acc := auth.NewBaseAccountWithAddress(sdk.AccAddress(msg.ValidatorAddr))
acc := auth.NewBaseAccountWithAddress(sdk.AccAddress(msg.ValidatorAddress))
acc.Coins = sdk.Coins{sdk.NewInt64Coin(defaultBondDenom, 150)}
genAccs[i] = NewGenesisAccount(&acc)
stakingData.Pool.NotBondedTokens = stakingData.Pool.NotBondedTokens.Add(sdk.NewInt(150)) // increase the supply
+1 -1
View File
@@ -351,7 +351,7 @@ func TestGaiaCLICreateValidator(t *testing.T) {
// Ensure that validator state is as expected
validator := f.QueryStakingValidator(barVal)
require.Equal(t, validator.OperatorAddr, barVal)
require.Equal(t, validator.OperatorAddress, barVal)
require.True(sdk.IntEq(t, newValTokens, validator.Tokens))
// Query delegations to the validator