Skip to content

Commit

Permalink
feat(ethapi): omits additional fields when empty
Browse files Browse the repository at this point in the history
Omits `feeCurrency`, `gatewayFeeRecipient`, and `gatewayFee` from the response when they are empty (effectively on Ethereum-compatible transactions).

When I call `eth_gasTransactionByHash` on an EIP-1559 transaction, the response object includes `feeCurrency`, `gatewayFeeRecipient`, and `gatewayFee` although they aren't relevant.
  • Loading branch information
arthurgousset committed Apr 24, 2024
1 parent 05509f2 commit a190929
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,9 @@ type RPCTransaction struct {
GasPrice *hexutil.Big `json:"gasPrice"`
GasFeeCap *hexutil.Big `json:"maxFeePerGas,omitempty"`
GasTipCap *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"`
FeeCurrency *common.Address `json:"feeCurrency"`
GatewayFeeRecipient *common.Address `json:"gatewayFeeRecipient"`
GatewayFee *hexutil.Big `json:"gatewayFee"`
FeeCurrency *common.Address `json:"feeCurrency,omitempty"`
GatewayFeeRecipient *common.Address `json:"gatewayFeeRecipient,omitempty"`
GatewayFee *hexutil.Big `json:"gatewayFee,omitempty"`
Hash common.Hash `json:"hash"`
Input hexutil.Bytes `json:"input"`
Nonce hexutil.Uint64 `json:"nonce"`
Expand Down

0 comments on commit a190929

Please sign in to comment.