Skip to content

Commit

Permalink
fix tx info and gas in rpc methods
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Jun 25, 2024
1 parent 3f32bd0 commit c374fb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion rpc/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ func ParseTxResult(result *abci.ResponseDeliverTx, tx sdk.Tx) (*ParsedTxs, error
}

// some old versions miss some events, fill it with tx result
if len(p.Txs) == 1 {
// txs with type CosmosEVMTxType will always emit GasUsed in events so no need to override for those
if len(p.Txs) == 1 && p.Txs[0].Type != CosmosEVMTxType {
// #nosec G701 always positive
p.Txs[0].GasUsed = uint64(result.GasUsed)
}
Expand Down Expand Up @@ -240,6 +241,7 @@ func ParseTxIndexerResult(
Type: parsedTx.Type,
Recipient: parsedTx.Recipient,
Sender: parsedTx.Sender,
GasUsed: parsedTx.GasUsed,
Data: parsedTx.Data,
Nonce: parsedTx.Nonce,
}, nil
Expand Down
2 changes: 1 addition & 1 deletion rpc/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func NewRPCTransactionFromIncompleteMsg(
Gas: hexutil.Uint64(txAdditional.GasUsed),
GasPrice: (*hexutil.Big)(baseFee),
Hash: common.HexToHash(msg.Hash),
Input: []byte{},
Input: txAdditional.Data,
Nonce: hexutil.Uint64(txAdditional.Nonce), // TODO: get nonce for "from" from ethermint
To: to,
Value: (*hexutil.Big)(txAdditional.Value),
Expand Down

0 comments on commit c374fb3

Please sign in to comment.