From 1c488298c807f4daa3cbe260efb88b81902a903d Mon Sep 17 00:00:00 2001 From: colin <102356659+colinlyguo@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:43:02 +0800 Subject: [PATCH] ethclient: apply accessList field in toCallArg (#28832) Co-authored-by: Felix Lange --- ethclient/ethclient.go | 3 +++ ethclient/gethclient/gethclient.go | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 900335988b..5b4e906cbb 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -662,6 +662,9 @@ func toCallArg(msg ethereum.CallMsg) interface{} { if msg.GasTipCap != nil { arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap) } + if msg.AccessList != nil { + arg["accessList"] = msg.AccessList + } return arg } diff --git a/ethclient/gethclient/gethclient.go b/ethclient/gethclient/gethclient.go index e2c0ef3ed0..73d05d499e 100644 --- a/ethclient/gethclient/gethclient.go +++ b/ethclient/gethclient/gethclient.go @@ -236,6 +236,15 @@ func toCallArg(msg ethereum.CallMsg) interface{} { if msg.GasPrice != nil { arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice) } + if msg.GasFeeCap != nil { + arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap) + } + if msg.GasTipCap != nil { + arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap) + } + if msg.AccessList != nil { + arg["accessList"] = msg.AccessList + } return arg }