Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
internal/ethapi: explicitly return chain id for EIP-155 legacy txs (g…
Browse files Browse the repository at this point in the history
…eth #25155)
  • Loading branch information
VictorTrustyDev committed Nov 10, 2022
1 parent 8a160c7 commit 0739ad7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rpc/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ func NewRPCTransaction(
result.TransactionIndex = (*hexutil.Uint64)(&index)
}
switch tx.Type() {
case ethtypes.LegacyTxType:
// if a legacy transaction has an EIP-155 chain id, include it explicitly
if id := tx.ChainId(); id.Sign() == 0 {
result.ChainID = (*hexutil.Big)(id)
}
case ethtypes.AccessListTxType:
al := tx.AccessList()
result.Accesses = &al
Expand Down

0 comments on commit 0739ad7

Please sign in to comment.