core/types: add "chainID" field to legacy tx JSON encoding (#27452)

Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
pull/27467/head
Freeman Jiang 1 year ago committed by GitHub
parent f3314bb6df
commit 8bbaf882a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      core/types/transaction_marshalling.go

@ -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)

Loading…
Cancel
Save