From cb090f4951731455f651f41b530a747d879397ca Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 7 Mar 2024 17:26:47 +0100 Subject: [PATCH] nits --- tests/integration/distribution.go | 17 ++++++++--------- tests/integration/setup.go | 2 +- testutil/ibc_testing/generic_setup.go | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 0a47faf3a0..0e188ce876 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -980,7 +980,7 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { } } -// TestMultiConsumerRewardsDistribution tests the reward distribution in the conext +// TestMultiConsumerRewardsDistribution tests the reward distribution in the context // of multiple consumers sending rewards to the provider func (s *CCVTestSuite) TestMultiConsumerRewardsDistribution() { s.SetupAllCCVChannels() @@ -997,17 +997,17 @@ func (s *CCVTestSuite) TestMultiConsumerRewardsDistribution() { totalConsumerRewards := sdk.Coins{} // Iterate over the consumers and perform the reward distribution - // to the provider. + // to the provider for chainID := range s.consumerBundles { bundle := s.consumerBundles[chainID] consumerKeeper := bundle.App.GetConsumerKeeper() bankKeeper := bundle.App.GetTestBankKeeper() accountKeeper := bundle.App.GetTestAccountKeeper() - // set the consumer reward denom and block per distribution params + // set the consumer reward denom and the block per distribution params params := consumerKeeper.GetConsumerParams(bundle.GetCtx()) params.RewardDenoms = []string{sdk.DefaultBondDenom} - // set the reward distribution for the next block + // set the reward distribution to be performed during the next block params.BlocksPerDistributionTransmission = int64(1) consumerKeeper.SetParams(bundle.GetCtx(), params) @@ -1015,7 +1015,7 @@ func (s *CCVTestSuite) TestMultiConsumerRewardsDistribution() { var rewardsPerConsumer sdk.Coin // check the consumer pool balance - // Note that for a democracy consumer chain the reward pool may already be filled + // Note that for a democracy consumer chain the pool may already be filled if pool := bankKeeper.GetAllBalances( bundle.GetCtx(), accountKeeper.GetModuleAccount(bundle.GetCtx(), consumertypes.ConsumerToSendToProviderName).GetAddress(), @@ -1030,10 +1030,9 @@ func (s *CCVTestSuite) TestMultiConsumerRewardsDistribution() { ) s.Require().NoError(err) } else { - // the pool is filled so we force - // the internal reward distribution - // and save the pool balance before - // it get transferred to the provider + // execute the internal rewards distribution + // to save the pool's balance before + // it gets transferred to the provider in EndBlock consumerKeeper.DistributeRewardsInternally(bundle.GetCtx()) pool = bankKeeper.GetAllBalances( bundle.GetCtx(), diff --git a/tests/integration/setup.go b/tests/integration/setup.go index 9f5ed59f64..91c4c4d21f 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -142,7 +142,7 @@ func (suite *CCVTestSuite) SetupTest() { suite.consumerBundles[bundle.Chain.ChainID] = bundle suite.registerPacketSniffer(bundle.Chain) - // check that TopN was correctly set + // check that TopN is correctly set for the consumer topN, found := providerKeeper.GetTopN(suite.providerCtx(), bundle.Chain.ChainID) suite.Require().True(found) suite.Require().Equal(bundle.TopN, topN) diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index 4232997547..da00d76b85 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -31,7 +31,7 @@ type ( // to run integration tests against your app.go implementations! const ( - // Default number of setup consumer chains + // Default number of consumer chains NumConsumers = 5 )