refactor(distribution)!: use collections for ValidatorCurrentRewards (#16459)

Co-authored-by: unknown unknown <unknown@unknown>
This commit is contained in:
testinginprod
2023-06-09 09:19:37 +00:00
committed by GitHub
co-authored by unknown unknown
parent bf8053cdfc
commit 2d1d68d3fd
16 changed files with 56 additions and 90 deletions
+2 -2
View File
@@ -388,10 +388,10 @@ func (s *SimTestSuite) getTestingValidator(ctx sdk.Context, commission types.Com
func (s *SimTestSuite) setupValidatorRewards(ctx sdk.Context, valAddress sdk.ValAddress) {
decCoins := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyOneDec())}
historicalRewards := distrtypes.NewValidatorHistoricalRewards(decCoins, 2)
s.distrKeeper.SetValidatorHistoricalRewards(ctx, valAddress, 2, historicalRewards)
s.Require().NoError(s.distrKeeper.SetValidatorHistoricalRewards(ctx, valAddress, 2, historicalRewards))
// setup current revards
currentRewards := distrtypes.NewValidatorCurrentRewards(decCoins, 3)
s.distrKeeper.SetValidatorCurrentRewards(ctx, valAddress, currentRewards)
s.Require().NoError(s.distrKeeper.ValidatorCurrentRewards.Set(ctx, valAddress, currentRewards))
}
func TestSimTestSuite(t *testing.T) {