Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ An '!' indicates a state machine breaking change.

### Improvements

- ! [#266](https://github.com/KYVENetwork/chain/pull/266) Improve storage cost payout.
- ! (`x/bundles`) [#266](https://github.com/KYVENetwork/chain/pull/266) Improve storage cost payout.

### Bug Fixes

- (`x/multi_coin_rewards`) [#269](https://github.com/KYVENetwork/chain/pull/269) Correctly export policy in genesis.

## [v2.1.0](https://github.com/KYVENetwork/chain/releases/tag/v2.1.0) - 2025-04-29

Expand Down
5 changes: 5 additions & 0 deletions x/multi_coin_rewards/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState)
}

k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_MULTI_COIN_REWARDS, genState.QueueStatePendingRewards)

err := k.MultiCoinDistributionPolicy.Set(ctx, *genState.MultiCoinDistributionPolicy)
if err != nil {
panic(err)
}
}

// ExportGenesis returns the capability module's exported genesis.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ var _ = Describe("msg_server_distribution_policy_test.go", Ordered, func() {

// ASSERT
Expect(err.Error()).To(Equal("duplicate entry for denom acoin"))
_, err = s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).NotTo(BeNil())
policy, err := s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).To(BeNil())
Expect(policy.Entries).To(HaveLen(0))
})

It("Invalid Policy: Duplicate pool entries for same denom", func() {
Expand Down Expand Up @@ -167,8 +168,9 @@ var _ = Describe("msg_server_distribution_policy_test.go", Ordered, func() {

// ASSERT
Expect(err.Error()).To(Equal("duplicate distribution weight for pool id 0"))
_, err = s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).NotTo(BeNil())
policy, err := s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).To(BeNil())
Expect(policy.Entries).To(HaveLen(0))
})

It("Invalid Policy: Negative weights", func() {
Expand All @@ -194,8 +196,9 @@ var _ = Describe("msg_server_distribution_policy_test.go", Ordered, func() {

// ASSERT
Expect(err.Error()).To(Equal("invalid weight for pool id 0"))
_, err = s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).NotTo(BeNil())
policy, err := s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).To(BeNil())
Expect(policy.Entries).To(HaveLen(0))
})

It("Invalid Policy: Zero weights", func() {
Expand All @@ -221,7 +224,8 @@ var _ = Describe("msg_server_distribution_policy_test.go", Ordered, func() {

// ASSERT
Expect(err.Error()).To(Equal("invalid weight for pool id 0"))
_, err = s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).NotTo(BeNil())
policy, err := s.App().MultiCoinRewardsKeeper.MultiCoinDistributionPolicy.Get(s.Ctx())
Expect(err).To(BeNil())
Expect(policy.Entries).To(HaveLen(0))
})
})