Skip to content

Commit

Permalink
chore: update gas estimate query response (#1248)
Browse files Browse the repository at this point in the history
# Background

Small change needed on the contract between Paloma/Pigeon.

# Testing completed

- [x] test coverage exists or has been added/updated
- [ ] tested in a private testnet

# Breaking changes

- [x] I have checked my code for breaking changes
- [x] If there are breaking changes, there is a supporting migration.
  • Loading branch information
byte-bandit authored Aug 7, 2024
1 parent eeb25aa commit 5fb8cce
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 90 deletions.
2 changes: 1 addition & 1 deletion proto/palomachain/paloma/consensus/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ message QueryQueuedMessagesForGasEstimationRequest {
}

message QueryQueuedMessagesForGasEstimationResponse {
repeated MessageToSign messagesToEstimate = 1 [ (gogoproto.nullable) = false ];
repeated MessageWithSignatures messagesToEstimate = 1 [ (gogoproto.nullable) = false ];
}
10 changes: 8 additions & 2 deletions x/consensus/keeper/query_queued_messages_for_gas_estimation.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ func (k Keeper) QueuedMessagesForGasEstimation(goCtx context.Context, req *types
return nil, fmt.Errorf("failed to query messages for gas estimation: %w", err)
}

var res []types.MessageToSign
var res []types.MessageWithSignatures
for _, msg := range msgs {
res = append(res, *queuedMessageToMessageToSign(k.cdc, msg))
if msg.GetRequireSignatures() {
msgWithSignatures, err := k.queuedMessageToMessageWithSignatures(msg)
if err != nil {
return nil, fmt.Errorf("failed to convert queued message to message with signatures: %w", err)
}
res = append(res, msgWithSignatures)
}
}

return &types.QueryQueuedMessagesForGasEstimationResponse{
Expand Down
Loading

0 comments on commit 5fb8cce

Please sign in to comment.