Skip to content

Commit

Permalink
Improvements on test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattverse committed Mar 14, 2022
1 parent be3a65e commit 2390648
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/apptesting/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,23 @@ func (keeperTestHelper *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk
keeperTestHelper.Ctx = keeperTestHelper.Ctx.WithBlockHeight(keeperTestHelper.Ctx.BlockHeight() + 1)
decTokens := sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: sdk.NewDec(20000)}}
keeperTestHelper.App.DistrKeeper.AllocateTokensToValidator(keeperTestHelper.Ctx, validator, decTokens)
keeperTestHelper.App.DistrKeeper.IncrementValidatorPeriod(keeperTestHelper.Ctx, validator)
}

// SetupGammPoolsWithBondDenomMultiplier uses given multipliers to set initial pool supply of bond denom.
func (keeperTestHelper *KeeperTestHelper) SetupGammPoolsWithBondDenomMultiplier(multipliers []sdk.Dec) []gammtypes.PoolI {
keeperTestHelper.App.GAMMKeeper.SetParams(keeperTestHelper.Ctx, gammtypes.Params{
PoolCreationFee: sdk.Coins{},
})

bondDenom := keeperTestHelper.App.StakingKeeper.BondDenom(keeperTestHelper.Ctx)
//TODO: use sdk crypto instead of tendermint to generate address
acc1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes())

//fund account with pool creation fee
poolCreationFee := keeperTestHelper.App.GAMMKeeper.GetParams(keeperTestHelper.Ctx)
err := simapp.FundAccount(keeperTestHelper.App.BankKeeper, keeperTestHelper.Ctx, acc1, poolCreationFee.PoolCreationFee)
keeperTestHelper.Require().NoError(err)

pools := []gammtypes.PoolI{}

for index, multiplier := range multipliers {
Expand Down

0 comments on commit 2390648

Please sign in to comment.