From d8b0a1a0002219b90bbe1ecf10cbf4ecd9008537 Mon Sep 17 00:00:00 2001 From: Paul Chen Date: Fri, 22 Mar 2024 14:16:22 +0800 Subject: [PATCH] fix: add missing proposal event type handling during update proposal status --- modules/gov/handle_block.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/gov/handle_block.go b/modules/gov/handle_block.go index 55b3b9de3..1eb8b2130 100644 --- a/modules/gov/handle_block.go +++ b/modules/gov/handle_block.go @@ -39,12 +39,19 @@ func (m *Module) updateProposalsStatus(height int64, txEvents, endBlockEvents [] } ids = append(ids, endBlockIDs...) + // the proposal changes state from the submit to voting + idsInSubmitTxs, err := findProposalIDsInEvents(txEvents, govtypes.EventTypeSubmitProposal, govtypes.AttributeKeyVotingPeriodStart) + if err != nil { + return err + } + ids = append(ids, idsInSubmitTxs...) + // the proposal changes state from the deposit to voting - txIDs, err := findProposalIDsInEvents(txEvents, govtypes.EventTypeProposalDeposit, govtypes.AttributeKeyVotingPeriodStart) + idsInDepositTxs, err := findProposalIDsInEvents(txEvents, govtypes.EventTypeProposalDeposit, govtypes.AttributeKeyVotingPeriodStart) if err != nil { return err } - ids = append(ids, txIDs...) + ids = append(ids, idsInDepositTxs...) // update status for proposals IDs stored in ids array for _, id := range ids {