Skip to content

Commit

Permalink
core/types: add "chainID" field to legacy tx JSON encoding (ethereum#…
Browse files Browse the repository at this point in the history
…27452)


Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
  • Loading branch information
2 people authored and devopsbo3 committed Nov 10, 2023
1 parent 189a756 commit 120956b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/types/transaction_marshalling.go
Expand Up @@ -69,6 +69,9 @@ func (tx *Transaction) MarshalJSON() ([]byte, error) {
enc.V = (*hexutil.Big)(itx.V)
enc.R = (*hexutil.Big)(itx.R)
enc.S = (*hexutil.Big)(itx.S)
if tx.Protected() {
enc.ChainID = (*hexutil.Big)(tx.ChainId())
}

case *AccessListTx:
enc.ChainID = (*hexutil.Big)(itx.ChainID)
Expand Down

0 comments on commit 120956b

Please sign in to comment.