Skip to content

Commit

Permalink
chore: update gas estimate query response
Browse files Browse the repository at this point in the history
  • Loading branch information
byte-bandit committed Aug 7, 2024
1 parent eeb25aa commit ea7ac01
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 ea7ac01

Please sign in to comment.