From daf8a948087f04c1882b7ae0166096e48c1c8bdd Mon Sep 17 00:00:00 2001 From: Maximilian Breithecker <72022235+mbreithecker@users.noreply.github.com> Date: Mon, 8 May 2023 11:31:27 +0200 Subject: [PATCH 1/2] fix: change ordering of events when submitting a bundle (#42) Co-authored-by: John Letey (cherry picked from commit 4800744279eeea6f4d061d627d6138c2f4b44ea5) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ x/bundles/keeper/logic_bundles.go | 16 ++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df384bb..5a37fd4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,15 @@ ## [Unreleased] +<<<<<<< HEAD +======= +### API Breaking + +- (`x/bundles`) [#42](https://github.com/KYVENetwork/chain/pull/42) Emit `VoteEvent` after `BundleProposedEvent` when submitting a bundle. + +## [v1.1.1](https://github.com/KYVENetwork/chain/releases/tag/v1.1.1) - 2023-05-08 + +>>>>>>> 4800744 (fix: change ordering of events when submitting a bundle (#42)) ### Improvements - [#34](https://github.com/KYVENetwork/chain/pull/34) Support [Heighliner](https://github.com/strangelove-ventures/heighliner) to enable [interchaintest](https://github.com/strangelove-ventures/interchaintest). diff --git a/x/bundles/keeper/logic_bundles.go b/x/bundles/keeper/logic_bundles.go index f76540d0..0dd245b0 100644 --- a/x/bundles/keeper/logic_bundles.go +++ b/x/bundles/keeper/logic_bundles.go @@ -280,14 +280,6 @@ func (k Keeper) registerBundleProposalFromUploader(ctx sdk.Context, msg *types.M CompressionId: pool.CurrentCompressionId, } - // Emit a vote event. - _ = ctx.EventManager().EmitTypedEvent(&types.EventBundleVote{ - PoolId: msg.PoolId, - Staker: msg.Staker, - StorageId: msg.StorageId, - Vote: types.VOTE_TYPE_VALID, - }) - k.SetBundleProposal(ctx, bundleProposal) _ = ctx.EventManager().EmitTypedEvent(&types.EventBundleProposed{ @@ -306,6 +298,14 @@ func (k Keeper) registerBundleProposalFromUploader(ctx sdk.Context, msg *types.M StorageProviderId: bundleProposal.StorageProviderId, CompressionId: bundleProposal.CompressionId, }) + + // Emit a vote event. Uploader automatically votes valid on their bundle. + _ = ctx.EventManager().EmitTypedEvent(&types.EventBundleVote{ + PoolId: msg.PoolId, + Staker: msg.Staker, + StorageId: msg.StorageId, + Vote: types.VOTE_TYPE_VALID, + }) } // finalizeCurrentBundleProposal takes the data of the current evaluated proposal From b02fdd951e8cc1aaae1b66c00cd2810214e24f1d Mon Sep 17 00:00:00 2001 From: John Letey Date: Mon, 8 May 2023 11:44:41 +0200 Subject: [PATCH 2/2] chore: resolve conflicts --- CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a37fd4d..5bf3e53f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,15 +14,12 @@ ## [Unreleased] -<<<<<<< HEAD -======= ### API Breaking - (`x/bundles`) [#42](https://github.com/KYVENetwork/chain/pull/42) Emit `VoteEvent` after `BundleProposedEvent` when submitting a bundle. ## [v1.1.1](https://github.com/KYVENetwork/chain/releases/tag/v1.1.1) - 2023-05-08 ->>>>>>> 4800744 (fix: change ordering of events when submitting a bundle (#42)) ### Improvements - [#34](https://github.com/KYVENetwork/chain/pull/34) Support [Heighliner](https://github.com/strangelove-ventures/heighliner) to enable [interchaintest](https://github.com/strangelove-ventures/interchaintest). @@ -61,6 +58,12 @@ - (`x/stakers`) [#19](https://github.com/KYVENetwork/chain/pull/19) Migrate `Commission` to type `sdk.Dec`. - (`x/stakers`) [#23](https://github.com/KYVENetwork/chain/pull/23) Improve metadata by adding `Identity`, `SecurityContact`, `Details` fields, deprecating `Logo`. +## [v1.0.1](https://github.com/KYVENetwork/chain/releases/tag/v1.0.1) - 2023-05-08 + +### Improvements + +- [#34](https://github.com/KYVENetwork/chain/pull/34) Support [Heighliner](https://github.com/strangelove-ventures/heighliner) to enable [interchaintest](https://github.com/strangelove-ventures/interchaintest). + ## [v1.0.0](https://github.com/KYVENetwork/chain/releases/tag/v1.0.0) - 2023-03-10 Release for the KYVE network launch.