From e4d350851ba4f78d492c3abe1ddd9a27686f2df9 Mon Sep 17 00:00:00 2001 From: mattverse Date: Wed, 16 Mar 2022 12:59:06 +0900 Subject: [PATCH 1/7] Add comment for superfluid reward distr --- x/superfluid/keeper/hooks_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x/superfluid/keeper/hooks_test.go b/x/superfluid/keeper/hooks_test.go index 0753ed5cc13..c26bbd1f310 100644 --- a/x/superfluid/keeper/hooks_test.go +++ b/x/superfluid/keeper/hooks_test.go @@ -16,6 +16,11 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { "happy path with single validator and delegator", []stakingtypes.BondStatus{stakingtypes.Bonded}, []superfluidDelegation{{0, 0, 0, 1000000}}, + // bond denom staked in pool = 15_000_000 + // with risk adjustment, the actual bond denom staked via superfluid would be 15_000_000 * (1 - 0.5) = 10_000_000 + // delegation rewards are calculated using the equation (current period cumulative reward ratio - last period cumulative reward ratio) * asset amount + // in this test case, the calculation for expected reward would be the following (0.99999 - 0) * 10_000_000 + // thus we expect 999_990 stake as rewards sdk.Coins{{Amount: sdk.NewInt(999990), Denom: "stake"}}, }, } From 2f0bad750f7eb56ff6bbfc63e3d0bd6fe4b17521 Mon Sep 17 00:00:00 2001 From: mattverse Date: Thu, 17 Mar 2022 20:39:35 +0900 Subject: [PATCH 2/7] Change minor test settings --- app/apptesting/test_suite.go | 14 +++++++------- x/superfluid/keeper/hooks_test.go | 12 +++++++----- x/superfluid/keeper/keeper_test.go | 1 - 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index ff46f5a2714..d0074b5c26e 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -65,18 +65,18 @@ func (keeperTestHelper *KeeperTestHelper) SetupValidator(bondStatus stakingtypes return valAddr } -func (keeperTestHelper *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool) { +func (keeperTestHelper *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool, proposer sdk.ValAddress) { valAddr := []byte(":^) at this distribution workaround") - validators := keeperTestHelper.App.StakingKeeper.GetAllValidators(keeperTestHelper.Ctx) - if len(validators) >= 1 { - valAddrFancy, err := validators[0].GetConsAddr() - keeperTestHelper.Require().NoError(err) - valAddr = valAddrFancy.Bytes() - } else { + validator, found := keeperTestHelper.App.StakingKeeper.GetValidator(keeperTestHelper.Ctx, proposer) + if !found { valAddrFancy := keeperTestHelper.SetupValidator(stakingtypes.Bonded) validator, _ := keeperTestHelper.App.StakingKeeper.GetValidator(keeperTestHelper.Ctx, valAddrFancy) valAddr2, _ := validator.GetConsAddr() valAddr = valAddr2.Bytes() + } else { + valConsAddr, err := validator.GetConsAddr() + keeperTestHelper.Require().NoError(err) + valAddr = valConsAddr.Bytes() } epochIdentifier := keeperTestHelper.App.SuperfluidKeeper.GetEpochIdentifier(keeperTestHelper.Ctx) diff --git a/x/superfluid/keeper/hooks_test.go b/x/superfluid/keeper/hooks_test.go index c26bbd1f310..22236d5ce2f 100644 --- a/x/superfluid/keeper/hooks_test.go +++ b/x/superfluid/keeper/hooks_test.go @@ -9,15 +9,18 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { testCases := []struct { name string validatorStats []stakingtypes.BondStatus + delegatorNumber int superDelegations []superfluidDelegation expRewards sdk.Coins }{ { "happy path with single validator and delegator", []stakingtypes.BondStatus{stakingtypes.Bonded}, + 1, []superfluidDelegation{{0, 0, 0, 1000000}}, // bond denom staked in pool = 15_000_000 - // with risk adjustment, the actual bond denom staked via superfluid would be 15_000_000 * (1 - 0.5) = 10_000_000 + // with risk adjustment, the actual bond denom staked via superfluid would be 15_000_000 * (1 - 0.5) = 7_500_000 + // we do a arbitrary swap to set spot price, which adjusts superfluid staked equivilent base denom 20_000_000 * (1 - 0.5) = 10_000_000 during begin block // delegation rewards are calculated using the equation (current period cumulative reward ratio - last period cumulative reward ratio) * asset amount // in this test case, the calculation for expected reward would be the following (0.99999 - 0) * 10_000_000 // thus we expect 999_990 stake as rewards @@ -30,11 +33,10 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { suite.SetupTest() valAddrs := suite.SetupValidators(tc.validatorStats) - // we create two additional pools: total three pools, 10 gauges - denoms, poolIds := suite.SetupGammPoolsAndSuperfluidAssets([]sdk.Dec{sdk.NewDec(20), sdk.NewDec(20)}) + denoms, poolIds := suite.SetupGammPoolsAndSuperfluidAssets([]sdk.Dec{sdk.NewDec(20)}) // Generate delegator addresses - delAddrs := CreateRandomAccounts(1) + delAddrs := CreateRandomAccounts(tc.delegatorNumber) intermediaryAccs, locks := suite.SetupSuperfluidDelegations(delAddrs, valAddrs, tc.superDelegations, denoms) suite.checkIntermediaryAccountDelegations(intermediaryAccs) @@ -45,7 +47,7 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { suite.SwapAndSetSpotPrice(poolIds[0], poolAssets[1], poolAssets[0]) // run epoch actions - suite.BeginNewBlock(true) + suite.BeginNewBlock(true, valAddrs[0]) // check lptoken twap value set newEpochMultiplier := suite.App.SuperfluidKeeper.GetOsmoEquivalentMultiplier(suite.Ctx, denoms[0]) diff --git a/x/superfluid/keeper/keeper_test.go b/x/superfluid/keeper/keeper_test.go index 54b0444f83b..60fc9c50b0b 100644 --- a/x/superfluid/keeper/keeper_test.go +++ b/x/superfluid/keeper/keeper_test.go @@ -36,7 +36,6 @@ func (suite *KeeperTestSuite) SetupTest() { queryHelper := baseapp.NewQueryServerTestHelper(suite.Ctx, suite.App.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, suite.App.SuperfluidKeeper) suite.queryClient = types.NewQueryClient(queryHelper) - suite.SetupDefaultPool() unbondingDuration := suite.App.StakingKeeper.GetParams(suite.Ctx).UnbondingTime From f8e3707ecf6284528792100fefa397e5b83c1af7 Mon Sep 17 00:00:00 2001 From: mattverse Date: Fri, 18 Mar 2022 17:31:37 +0900 Subject: [PATCH 3/7] Add two validator delegator --- x/superfluid/keeper/hooks_test.go | 51 ++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/x/superfluid/keeper/hooks_test.go b/x/superfluid/keeper/hooks_test.go index 22236d5ce2f..5be782936b9 100644 --- a/x/superfluid/keeper/hooks_test.go +++ b/x/superfluid/keeper/hooks_test.go @@ -11,7 +11,7 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { validatorStats []stakingtypes.BondStatus delegatorNumber int superDelegations []superfluidDelegation - expRewards sdk.Coins + expRewards []sdk.Coins }{ { "happy path with single validator and delegator", @@ -20,11 +20,24 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { []superfluidDelegation{{0, 0, 0, 1000000}}, // bond denom staked in pool = 15_000_000 // with risk adjustment, the actual bond denom staked via superfluid would be 15_000_000 * (1 - 0.5) = 7_500_000 - // we do a arbitrary swap to set spot price, which adjusts superfluid staked equivilent base denom 20_000_000 * (1 - 0.5) = 10_000_000 during begin block + // we do an arbitrary swap to set spot price, which adjusts superfluid staked equivilent base denom 20_000_000 * (1 - 0.5) = 10_000_000 during begin block // delegation rewards are calculated using the equation (current period cumulative reward ratio - last period cumulative reward ratio) * asset amount // in this test case, the calculation for expected reward would be the following (0.99999 - 0) * 10_000_000 // thus we expect 999_990 stake as rewards - sdk.Coins{{Amount: sdk.NewInt(999990), Denom: "stake"}}, + []sdk.Coins{{sdk.NewCoin("stake", sdk.NewInt(999990))}}, + }, + { + "happy path with two validator and delegator each", + []stakingtypes.BondStatus{stakingtypes.Bonded, stakingtypes.Bonded}, + 2, + []superfluidDelegation{{0, 0, 0, 1000000}, {1, 1, 0, 1000000}}, + // reward for the first block propser / lock 0 that has been superfluid staked would be equivilent to calculations done above + // 999_990 stake as rewards. + // reward for the second delegation is expected to be different. Amount superfluid staked would be equivilently 7_500_000 stake. + // This would be the first block propsed by the second validator, current period cumulative reward ratio being 999_86.66684, + // last period cumulative reward ratio being 0 + // Thus as rewards, we expect 999986stake, calculted using the following equation: (999_86.66684 - 0) * 7_500_000 + []sdk.Coins{{sdk.NewCoin("stake", sdk.NewInt(999990))}, {sdk.NewCoin("stake", sdk.NewInt(999986))}}, }, } @@ -47,24 +60,26 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { suite.SwapAndSetSpotPrice(poolIds[0], poolAssets[1], poolAssets[0]) // run epoch actions - suite.BeginNewBlock(true, valAddrs[0]) + // run begin block for each validator so that both validator gets block rewards + for _, valAddr := range valAddrs { + suite.BeginNewBlock(true, valAddr) + } // check lptoken twap value set newEpochMultiplier := suite.App.SuperfluidKeeper.GetOsmoEquivalentMultiplier(suite.Ctx, denoms[0]) suite.Require().Equal(newEpochMultiplier, sdk.NewDec(15)) - // check gauge creation in new block - intermediaryAccAddr := suite.App.SuperfluidKeeper.GetLockIdIntermediaryAccountConnection(suite.Ctx, locks[0].ID) - intermediaryAcc := suite.App.SuperfluidKeeper.GetIntermediaryAccount(suite.Ctx, intermediaryAccAddr) - gauge, err := suite.App.IncentivesKeeper.GetGaugeByID(suite.Ctx, intermediaryAcc.GaugeId) - - suite.Require().NoError(err) - suite.Require().Equal(gauge.Id, intermediaryAcc.GaugeId) - suite.Require().Equal(gauge.IsPerpetual, true) - suite.Require().Equal(gauge.Coins, tc.expRewards) - suite.Require().Equal(gauge.NumEpochsPaidOver, uint64(1)) - suite.Require().Equal(gauge.FilledEpochs, uint64(1)) - suite.Require().Equal(gauge.DistributedCoins, tc.expRewards) + for index, lock := range locks { + // check gauge creation in new block + intermediaryAccAddr := suite.App.SuperfluidKeeper.GetLockIdIntermediaryAccountConnection(suite.Ctx, lock.ID) + intermediaryAcc := suite.App.SuperfluidKeeper.GetIntermediaryAccount(suite.Ctx, intermediaryAccAddr) + gauge, err := suite.App.IncentivesKeeper.GetGaugeByID(suite.Ctx, intermediaryAcc.GaugeId) + suite.Require().NoError(err) + suite.Require().Equal(gauge.Id, intermediaryAcc.GaugeId) + suite.Require().Equal(gauge.IsPerpetual, true) + suite.Require().Equal(gauge.Coins, tc.expRewards[index]) + suite.Require().Equal(gauge.DistributedCoins, tc.expRewards[index]) + } // check delegation changes for _, acc := range intermediaryAccs { @@ -74,8 +89,8 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { suite.Require().True(found) suite.Require().Equal(sdk.NewDec(7500000), delegation.Shares) } - balance := suite.App.BankKeeper.GetAllBalances(suite.Ctx, delAddrs[0]) - suite.Require().Equal(tc.expRewards, balance) + //balance := suite.App.BankKeeper.GetAllBalances(suite.Ctx, delAddrs[0]) + //suite.Require().Equal(tc.expRewards, balance) }) } } From 34ad8f8f925bf109886f8c2777802a0e2fcb63ba Mon Sep 17 00:00:00 2001 From: mattverse Date: Thu, 24 Mar 2022 23:19:31 +0900 Subject: [PATCH 4/7] Add BeginNewBlock without propser --- app/apptesting/test_suite.go | 39 ++++++++++++++++++++++++++++++- x/superfluid/keeper/hooks_test.go | 2 +- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index d0074b5c26e..bf1b78e6f1d 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -65,7 +65,44 @@ func (keeperTestHelper *KeeperTestHelper) SetupValidator(bondStatus stakingtypes return valAddr } -func (keeperTestHelper *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool, proposer sdk.ValAddress) { +func (keeperTestHelper *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool) { + valAddr := []byte(":^) at this distribution workaround") + validators := keeperTestHelper.App.StakingKeeper.GetAllValidators(keeperTestHelper.Ctx) + if len(validators) >= 1 { + valAddrFancy, err := validators[0].GetConsAddr() + keeperTestHelper.Require().NoError(err) + valAddr = valAddrFancy.Bytes() + } else { + valAddrFancy := keeperTestHelper.SetupValidator(stakingtypes.Bonded) + validator, _ := keeperTestHelper.App.StakingKeeper.GetValidator(keeperTestHelper.Ctx, valAddrFancy) + valAddr2, _ := validator.GetConsAddr() + valAddr = valAddr2.Bytes() + } + + epochIdentifier := keeperTestHelper.App.SuperfluidKeeper.GetEpochIdentifier(keeperTestHelper.Ctx) + epoch := keeperTestHelper.App.EpochsKeeper.GetEpochInfo(keeperTestHelper.Ctx, epochIdentifier) + newBlockTime := keeperTestHelper.Ctx.BlockTime().Add(5 * time.Second) + if executeNextEpoch { + endEpochTime := epoch.CurrentEpochStartTime.Add(epoch.Duration) + newBlockTime = endEpochTime.Add(time.Second) + } + // fmt.Println(executeNextEpoch, keeperTestHelper.Ctx.BlockTime(), newBlockTime) + header := tmproto.Header{Height: keeperTestHelper.Ctx.BlockHeight() + 1, Time: newBlockTime} + newCtx := keeperTestHelper.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(keeperTestHelper.Ctx.BlockHeight() + 1) + keeperTestHelper.Ctx = newCtx + lastCommitInfo := abci.LastCommitInfo{ + Votes: []abci.VoteInfo{{ + Validator: abci.Validator{Address: valAddr, Power: 1000}, + SignedLastBlock: true}, + }, + } + reqBeginBlock := abci.RequestBeginBlock{Header: header, LastCommitInfo: lastCommitInfo} + + fmt.Println("beginning block ", keeperTestHelper.Ctx.BlockHeight()) + keeperTestHelper.App.BeginBlocker(keeperTestHelper.Ctx, reqBeginBlock) +} + +func (keeperTestHelper *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress) { valAddr := []byte(":^) at this distribution workaround") validator, found := keeperTestHelper.App.StakingKeeper.GetValidator(keeperTestHelper.Ctx, proposer) if !found { diff --git a/x/superfluid/keeper/hooks_test.go b/x/superfluid/keeper/hooks_test.go index 5be782936b9..e9876c1ea44 100644 --- a/x/superfluid/keeper/hooks_test.go +++ b/x/superfluid/keeper/hooks_test.go @@ -62,7 +62,7 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { // run epoch actions // run begin block for each validator so that both validator gets block rewards for _, valAddr := range valAddrs { - suite.BeginNewBlock(true, valAddr) + suite.BeginNewBlockWithProposer(true, valAddr) } // check lptoken twap value set From b2e4bb7f621c880a76c8f58dc2826b88860353ca Mon Sep 17 00:00:00 2001 From: mattverse Date: Mon, 28 Mar 2022 15:47:06 +0900 Subject: [PATCH 5/7] code sanity --- app/apptesting/test_suite.go | 38 ++++--------------------------- x/superfluid/keeper/hooks_test.go | 8 +++++-- 2 files changed, 11 insertions(+), 35 deletions(-) diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index 06bfbae3fb9..cf84138cd66 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -78,45 +78,18 @@ func (keeperTestHelper *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool) { valAddr2, _ := validator.GetConsAddr() valAddr = valAddr2.Bytes() } - - epochIdentifier := keeperTestHelper.App.SuperfluidKeeper.GetEpochIdentifier(keeperTestHelper.Ctx) - epoch := keeperTestHelper.App.EpochsKeeper.GetEpochInfo(keeperTestHelper.Ctx, epochIdentifier) - newBlockTime := keeperTestHelper.Ctx.BlockTime().Add(5 * time.Second) - if executeNextEpoch { - endEpochTime := epoch.CurrentEpochStartTime.Add(epoch.Duration) - newBlockTime = endEpochTime.Add(time.Second) - } - // fmt.Println(executeNextEpoch, keeperTestHelper.Ctx.BlockTime(), newBlockTime) - header := tmproto.Header{Height: keeperTestHelper.Ctx.BlockHeight() + 1, Time: newBlockTime} - newCtx := keeperTestHelper.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(keeperTestHelper.Ctx.BlockHeight() + 1) - keeperTestHelper.Ctx = newCtx - lastCommitInfo := abci.LastCommitInfo{ - Votes: []abci.VoteInfo{ - { - Validator: abci.Validator{Address: valAddr, Power: 1000}, - SignedLastBlock: true, - }, - }, - } - reqBeginBlock := abci.RequestBeginBlock{Header: header, LastCommitInfo: lastCommitInfo} - - fmt.Println("beginning block ", keeperTestHelper.Ctx.BlockHeight()) - keeperTestHelper.App.BeginBlocker(keeperTestHelper.Ctx, reqBeginBlock) + keeperTestHelper.BeginNewBlockWithProposer(executeNextEpoch, valAddr) } func (keeperTestHelper *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress) { valAddr := []byte(":^) at this distribution workaround") validator, found := keeperTestHelper.App.StakingKeeper.GetValidator(keeperTestHelper.Ctx, proposer) if !found { - valAddrFancy := keeperTestHelper.SetupValidator(stakingtypes.Bonded) - validator, _ := keeperTestHelper.App.StakingKeeper.GetValidator(keeperTestHelper.Ctx, valAddrFancy) - valAddr2, _ := validator.GetConsAddr() - valAddr = valAddr2.Bytes() - } else { - valConsAddr, err := validator.GetConsAddr() - keeperTestHelper.Require().NoError(err) - valAddr = valConsAddr.Bytes() + panic("given validator not found") } + valConsAddr, err := validator.GetConsAddr() + keeperTestHelper.Require().NoError(err) + valAddr = valConsAddr.Bytes() epochIdentifier := keeperTestHelper.App.SuperfluidKeeper.GetEpochIdentifier(keeperTestHelper.Ctx) epoch := keeperTestHelper.App.EpochsKeeper.GetEpochInfo(keeperTestHelper.Ctx, epochIdentifier) @@ -125,7 +98,6 @@ func (keeperTestHelper *KeeperTestHelper) BeginNewBlockWithProposer(executeNextE endEpochTime := epoch.CurrentEpochStartTime.Add(epoch.Duration) newBlockTime = endEpochTime.Add(time.Second) } - // fmt.Println(executeNextEpoch, keeperTestHelper.Ctx.BlockTime(), newBlockTime) header := tmproto.Header{Height: keeperTestHelper.Ctx.BlockHeight() + 1, Time: newBlockTime} newCtx := keeperTestHelper.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(keeperTestHelper.Ctx.BlockHeight() + 1) keeperTestHelper.Ctx = newCtx diff --git a/x/superfluid/keeper/hooks_test.go b/x/superfluid/keeper/hooks_test.go index 1b9eec5f9a9..d45b19dc0b5 100644 --- a/x/superfluid/keeper/hooks_test.go +++ b/x/superfluid/keeper/hooks_test.go @@ -89,8 +89,12 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { suite.Require().True(found) suite.Require().Equal(sdk.NewDec(7500000), delegation.Shares) } - //balance := suite.App.BankKeeper.GetAllBalances(suite.Ctx, delAddrs[0]) - //suite.Require().Equal(tc.expRewards, balance) + + // check balances + for index, delAddr := range delAddrs { + balance := suite.App.BankKeeper.GetAllBalances(suite.Ctx, delAddr) + suite.Require().Equal(tc.expRewards[index], balance) + } }) } } From 9b470d382e6c652387c783b307cc465cb2b75a33 Mon Sep 17 00:00:00 2001 From: mattverse Date: Tue, 29 Mar 2022 21:59:58 +0900 Subject: [PATCH 6/7] Fix lints --- app/apptesting/test_suite.go | 9 +++------ x/superfluid/keeper/hooks_test.go | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index cf84138cd66..6cc8fd7cdc8 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -66,7 +66,7 @@ func (keeperTestHelper *KeeperTestHelper) SetupValidator(bondStatus stakingtypes } func (keeperTestHelper *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool) { - valAddr := []byte(":^) at this distribution workaround") //nolint + var valAddr []byte validators := keeperTestHelper.App.StakingKeeper.GetAllValidators(keeperTestHelper.Ctx) if len(validators) >= 1 { valAddrFancy, err := validators[0].GetConsAddr() @@ -82,14 +82,11 @@ func (keeperTestHelper *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool) { } func (keeperTestHelper *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress) { - valAddr := []byte(":^) at this distribution workaround") validator, found := keeperTestHelper.App.StakingKeeper.GetValidator(keeperTestHelper.Ctx, proposer) - if !found { - panic("given validator not found") - } + keeperTestHelper.Assert().True(found) valConsAddr, err := validator.GetConsAddr() keeperTestHelper.Require().NoError(err) - valAddr = valConsAddr.Bytes() + valAddr := valConsAddr.Bytes() epochIdentifier := keeperTestHelper.App.SuperfluidKeeper.GetEpochIdentifier(keeperTestHelper.Ctx) epoch := keeperTestHelper.App.EpochsKeeper.GetEpochInfo(keeperTestHelper.Ctx, epochIdentifier) diff --git a/x/superfluid/keeper/hooks_test.go b/x/superfluid/keeper/hooks_test.go index d45b19dc0b5..2bcbb7287c2 100644 --- a/x/superfluid/keeper/hooks_test.go +++ b/x/superfluid/keeper/hooks_test.go @@ -90,7 +90,6 @@ func (suite *KeeperTestSuite) TestSuperfluidAfterEpochEnd() { suite.Require().Equal(sdk.NewDec(7500000), delegation.Shares) } - // check balances for index, delAddr := range delAddrs { balance := suite.App.BankKeeper.GetAllBalances(suite.Ctx, delAddr) suite.Require().Equal(tc.expRewards[index], balance) From d831eb6cfed2da757cda5e8f4ef06ac2b6908ced Mon Sep 17 00:00:00 2001 From: mattverse Date: Wed, 30 Mar 2022 15:16:32 +0900 Subject: [PATCH 7/7] Fix code fmt --- app/apptesting/test_suite.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index 6cc8fd7cdc8..a18a5ac6983 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -101,8 +101,8 @@ func (keeperTestHelper *KeeperTestHelper) BeginNewBlockWithProposer(executeNextE lastCommitInfo := abci.LastCommitInfo{ Votes: []abci.VoteInfo{{ Validator: abci.Validator{Address: valAddr, Power: 1000}, - SignedLastBlock: true}, - }, + SignedLastBlock: true, + }}, } reqBeginBlock := abci.RequestBeginBlock{Header: header, LastCommitInfo: lastCommitInfo}