Skip to content

Commit

Permalink
perf: decode proposal id from tx resp
Browse files Browse the repository at this point in the history
  • Loading branch information
duvbell committed Dec 22, 2024
1 parent 3e7348d commit 2dec4b2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions e2e/testsuite/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,13 @@ 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

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

0 comments on commit 2dec4b2

Please sign in to comment.