diff --git a/CHANGELOG.md b/CHANGELOG.md index f04c97eb..922627db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ ## [Unreleased] +### 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 ### Improvements 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