Skip to content

Commit

Permalink
perf: decode proposal id from tx resp (#7785)
Browse files Browse the repository at this point in the history
* perf: decode proposal id from tx resp

* Empty commit

* perf: add defer function back

* bet

---------

Co-authored-by: Gjermund Garaba <[email protected]>
  • Loading branch information
duvbell and gjermundgaraba authored Dec 23, 2024
1 parent 805894d commit 2ce62a4
Showing 1 changed file with 7 additions and 7 deletions.
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() {
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

0 comments on commit 2ce62a4

Please sign in to comment.