Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: decode proposal id from tx resp #7785

Merged
Merged
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
14 changes: 7 additions & 7 deletions e2e/testsuite/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,16 @@ func (s *E2ETestSuite) ExecuteAndPassGovV1Beta1Proposal(ctx context.Context, cha
panic("ExecuteAndPassGovV1Beta1Proposal must be passed a cosmos.CosmosChain")
}

proposalID := s.proposalIDs[chain.Config().ChainID]
defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this is used somewhere else, so unless we can get rid of the whole s.proposalIDs, I think we still need the defer below line 231.

If you can easily get the proposalID for the other use and get rid of it entirely, that is preferable :)

Copy link
Contributor Author

@duvbell duvbell Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @gjermundgaraba , i updated, can you help me review it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct to me! Thank you :)

s.proposalIDs[chain.Config().ChainID] = proposalID + 1
}()

txResp := s.ExecuteGovV1Beta1Proposal(ctx, cosmosChain, user, content)
s.AssertTxSuccess(txResp)

// TODO: replace with parsed proposal ID from MsgSubmitProposalResponse
// https://github.com/cosmos/ibc-go/issues/2122
var submitProposalResponse govtypesv1beta1.MsgSubmitProposalResponse
s.Require().NoError(UnmarshalMsgResponses(txResp, &submitProposalResponse))

proposalID := submitProposalResponse.ProposalId
defer func() {
s.proposalIDs[chain.Config().ChainID] = proposalID + 1
}()

proposalResp, err := query.GRPCQuery[govtypesv1beta1.QueryProposalResponse](ctx, cosmosChain, &govtypesv1beta1.QueryProposalRequest{
ProposalId: proposalID,
Expand Down
Loading