mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-10 18:16:39 +00:00
core/types: add "chainID" field to legacy tx JSON encoding (#27452)
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
This commit is contained in:
parent
f3314bb6df
commit
8bbaf882a6
1 changed files with 3 additions and 0 deletions
|
|
@ -69,6 +69,9 @@ func (tx *Transaction) MarshalJSON() ([]byte, error) {
|
||||||
enc.V = (*hexutil.Big)(itx.V)
|
enc.V = (*hexutil.Big)(itx.V)
|
||||||
enc.R = (*hexutil.Big)(itx.R)
|
enc.R = (*hexutil.Big)(itx.R)
|
||||||
enc.S = (*hexutil.Big)(itx.S)
|
enc.S = (*hexutil.Big)(itx.S)
|
||||||
|
if tx.Protected() {
|
||||||
|
enc.ChainID = (*hexutil.Big)(tx.ChainId())
|
||||||
|
}
|
||||||
|
|
||||||
case *AccessListTx:
|
case *AccessListTx:
|
||||||
enc.ChainID = (*hexutil.Big)(itx.ChainID)
|
enc.ChainID = (*hexutil.Big)(itx.ChainID)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue