Skip to content

Commit

Permalink
Merge pull request #105 from bro-n-bro/94-proposals-status-check
Browse files Browse the repository at this point in the history
94 get and publish proposal when got deposit message
  • Loading branch information
malekvictor authored Sep 17, 2023
2 parents 6d2aa35 + c7244e7 commit acdd7db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/gov/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func (m *Module) handleMsgSubmitProposal(ctx context.Context, tx *types.Tx, inde
// handleMsgDeposit handles a MsgDeposit message.
// Publishes proposalDeposit and proposalDepositMessage data to the broker.
func (m *Module) handleMsgDeposit(ctx context.Context, tx *types.Tx, index int, msg *govtypesv1beta1.MsgDeposit) error {
if err := m.getAndPublishProposal(ctx, msg.ProposalId, ""); err != nil {
return err
}

if err := m.broker.PublishProposalDepositMessage(ctx, model.ProposalDepositMessage{
ProposalDeposit: model.ProposalDeposit{
ProposalID: msg.ProposalId,
Expand Down Expand Up @@ -148,7 +152,6 @@ func (m *Module) handleMsgDeposit(ctx context.Context, tx *types.Tx, index int,
return fmt.Errorf("error while getting proposal deposit: %w", err)
}

// TODO: test it
if err = m.broker.PublishProposalDeposit(ctx, model.ProposalDeposit{
ProposalID: msg.ProposalId,
DepositorAddress: msg.Depositor,
Expand Down

0 comments on commit acdd7db

Please sign in to comment.