diff --git a/PENDING.md b/PENDING.md index e3bde392fb..e3ac04616d 100644 --- a/PENDING.md +++ b/PENDING.md @@ -55,6 +55,7 @@ BREAKING CHANGES * [x/slashing] Truncate withdrawals (unbonding, redelegation) and burn change * [x/mock/simulation] Ensure the simulation cannot set a proposer address of nil * [x/mock/simulation] Add more event logs on begin block / end block for clarity + * [x/mock/simulation] Correctly set validator power in abci.RequestBeginBlock * [x/minting] Correctly call stake keeper to track inflated supply * [x/distribution] Sanity check for nonexistent rewards * [x/distribution] Truncate withdrawals and return change to the community pool diff --git a/cmd/gaia/app/sim_test.go b/cmd/gaia/app/sim_test.go index eecd8593a5..fb8060a2aa 100644 --- a/cmd/gaia/app/sim_test.go +++ b/cmd/gaia/app/sim_test.go @@ -126,7 +126,6 @@ func testAndRunTxs(app *GaiaApp) []simulation.WeightedOperation { func invariants(app *GaiaApp) []simulation.Invariant { return []simulation.Invariant{ banksim.NonnegativeBalanceInvariant(app.accountKeeper), - distributionsim.AllInvariants(app.bankKeeper, app.distrKeeper, app.accountKeeper), govsim.AllInvariants(), stakesim.AllInvariants(app.bankKeeper, app.stakeKeeper, app.feeCollectionKeeper, app.distrKeeper, app.accountKeeper), slashingsim.AllInvariants(), diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go index d3ada35c48..10ef25a195 100644 --- a/x/distribution/keeper/hooks.go +++ b/x/distribution/keeper/hooks.go @@ -23,6 +23,7 @@ func (k Keeper) onValidatorCreated(ctx sdk.Context, addr sdk.ValAddress) { // Withdrawal all validator rewards func (k Keeper) onValidatorModified(ctx sdk.Context, addr sdk.ValAddress) { + // This doesn't need to be run at genesis if ctx.BlockHeight() > 0 { if err := k.WithdrawValidatorRewardsAll(ctx, addr); err != nil { panic(err) diff --git a/x/distribution/simulation/invariants.go b/x/distribution/simulation/invariants.go deleted file mode 100644 index 3a3a1fcd17..0000000000 --- a/x/distribution/simulation/invariants.go +++ /dev/null @@ -1,17 +0,0 @@ -package simulation - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/bank" - "github.com/cosmos/cosmos-sdk/x/distribution" - "github.com/cosmos/cosmos-sdk/x/mock/simulation" -) - -// AllInvariants runs all invariants of the distribution module. -// Currently: total supply, positive power -func AllInvariants(ck bank.Keeper, k distribution.Keeper, am auth.AccountKeeper) simulation.Invariant { - return func(app *baseapp.BaseApp) error { - return nil - } -} diff --git a/x/distribution/simulation/msgs.go b/x/distribution/simulation/msgs.go index 6c1bfea77b..62881c5f95 100644 --- a/x/distribution/simulation/msgs.go +++ b/x/distribution/simulation/msgs.go @@ -8,7 +8,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/distribution" - "github.com/cosmos/cosmos-sdk/x/mock" "github.com/cosmos/cosmos-sdk/x/mock/simulation" ) @@ -121,10 +120,3 @@ func SimulateMsgWithdrawValidatorRewardsAll(m auth.AccountKeeper, k distribution return action, nil, nil } } - -// Setup -// nolint: errcheck -func Setup(mapp *mock.App, k distribution.Keeper) simulation.RandSetup { - return func(r *rand.Rand, accs []simulation.Account) { - } -}