Linter, enable simulated distribution msgs again
This commit is contained in:
parent
42ae2671c2
commit
4779359e29
|
@ -107,9 +107,9 @@ func testAndRunTxs(app *GaiaApp) []simulation.WeightedOperation {
|
||||||
{5, authsim.SimulateDeductFee(app.accountMapper, app.feeCollectionKeeper)},
|
{5, authsim.SimulateDeductFee(app.accountMapper, app.feeCollectionKeeper)},
|
||||||
{100, banksim.SingleInputSendMsg(app.accountMapper, app.bankKeeper)},
|
{100, banksim.SingleInputSendMsg(app.accountMapper, app.bankKeeper)},
|
||||||
{50, distributionsim.SimulateMsgSetWithdrawAddress(app.accountMapper, app.distrKeeper)},
|
{50, distributionsim.SimulateMsgSetWithdrawAddress(app.accountMapper, app.distrKeeper)},
|
||||||
//{50, distributionsim.SimulateMsgWithdrawDelegatorRewardsAll(app.accountMapper, app.distrKeeper)},
|
{50, distributionsim.SimulateMsgWithdrawDelegatorRewardsAll(app.accountMapper, app.distrKeeper)},
|
||||||
//{50, distributionsim.SimulateMsgWithdrawDelegatorReward(app.accountMapper, app.distrKeeper)},
|
{50, distributionsim.SimulateMsgWithdrawDelegatorReward(app.accountMapper, app.distrKeeper)},
|
||||||
//{50, distributionsim.SimulateMsgWithdrawValidatorRewardsAll(app.accountMapper, app.distrKeeper)},
|
{50, distributionsim.SimulateMsgWithdrawValidatorRewardsAll(app.accountMapper, app.distrKeeper)},
|
||||||
{5, govsim.SimulateSubmittingVotingAndSlashingForProposal(app.govKeeper, app.stakeKeeper)},
|
{5, govsim.SimulateSubmittingVotingAndSlashingForProposal(app.govKeeper, app.stakeKeeper)},
|
||||||
{100, govsim.SimulateMsgDeposit(app.govKeeper, app.stakeKeeper)},
|
{100, govsim.SimulateMsgDeposit(app.govKeeper, app.stakeKeeper)},
|
||||||
{100, stakesim.SimulateMsgCreateValidator(app.accountMapper, app.stakeKeeper)},
|
{100, stakesim.SimulateMsgCreateValidator(app.accountMapper, app.stakeKeeper)},
|
||||||
|
|
|
@ -46,6 +46,7 @@ func (fck FeeCollectionKeeper) setCollectedFees(ctx sdk.Context, coins sdk.Coins
|
||||||
store.Set(collectedFeesKey, bz)
|
store.Set(collectedFeesKey, bz)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add collected fees (mostly exposed for simulation...)
|
||||||
func (fck FeeCollectionKeeper) AddCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins {
|
func (fck FeeCollectionKeeper) AddCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins {
|
||||||
newCoins := fck.GetCollectedFees(ctx).Plus(coins)
|
newCoins := fck.GetCollectedFees(ctx).Plus(coins)
|
||||||
fck.setCollectedFees(ctx, newCoins)
|
fck.setCollectedFees(ctx, newCoins)
|
||||||
|
|
|
@ -49,11 +49,11 @@ func TestFeeCollectionKeeperAdd(t *testing.T) {
|
||||||
require.True(t, fck.GetCollectedFees(ctx).IsEqual(emptyCoins))
|
require.True(t, fck.GetCollectedFees(ctx).IsEqual(emptyCoins))
|
||||||
|
|
||||||
// add oneCoin and check that pool is now oneCoin
|
// add oneCoin and check that pool is now oneCoin
|
||||||
fck.addCollectedFees(ctx, oneCoin)
|
fck.AddCollectedFees(ctx, oneCoin)
|
||||||
require.True(t, fck.GetCollectedFees(ctx).IsEqual(oneCoin))
|
require.True(t, fck.GetCollectedFees(ctx).IsEqual(oneCoin))
|
||||||
|
|
||||||
// add oneCoin again and check that pool is now twoCoins
|
// add oneCoin again and check that pool is now twoCoins
|
||||||
fck.addCollectedFees(ctx, oneCoin)
|
fck.AddCollectedFees(ctx, oneCoin)
|
||||||
require.True(t, fck.GetCollectedFees(ctx).IsEqual(twoCoins))
|
require.True(t, fck.GetCollectedFees(ctx).IsEqual(twoCoins))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,10 @@ func SimulateDeductFee(m auth.AccountMapper, f auth.FeeCollectionKeeper) simulat
|
||||||
}
|
}
|
||||||
|
|
||||||
coins := sdk.Coins{sdk.NewCoin(initCoins[denomIndex].Denom, amt)}
|
coins := sdk.Coins{sdk.NewCoin(initCoins[denomIndex].Denom, amt)}
|
||||||
stored.SetCoins(initCoins.Minus(coins))
|
err = stored.SetCoins(initCoins.Minus(coins))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
m.SetAccount(ctx, stored)
|
m.SetAccount(ctx, stored)
|
||||||
f.AddCollectedFees(ctx, coins)
|
f.AddCollectedFees(ctx, coins)
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ func TestStakeWithRandomMessages(t *testing.T) {
|
||||||
}, []simulation.RandSetup{
|
}, []simulation.RandSetup{
|
||||||
Setup(mapp, stakeKeeper),
|
Setup(mapp, stakeKeeper),
|
||||||
}, []simulation.Invariant{
|
}, []simulation.Invariant{
|
||||||
AllInvariants(bankKeeper, stakeKeeper, distrKeeper, mapp.AccountMapper),
|
AllInvariants(bankKeeper, stakeKeeper, feeCollectionKeeper, distrKeeper, mapp.AccountMapper),
|
||||||
}, 10, 100,
|
}, 10, 100,
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue