Skip to content

Commit

Permalink
core/types: add "chainID" field to legacy tx JSON encoding (#27452)
Browse files Browse the repository at this point in the history
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
  • Loading branch information
freeman-jiang and lightclient authored Jun 13, 2023
1 parent f3314bb commit 8bbaf88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
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 8bbaf88

Please sign in to comment.