From 9d537f543990d9013d73433dc58fd0e985d9b2b6 Mon Sep 17 00:00:00 2001 From: maskpp Date: Thu, 15 Feb 2024 17:08:46 +0800 Subject: [PATCH] ethereum, ethclient: add blob transaction fields in CallMsg (#28989) Co-authored-by: Felix Lange --- ethclient/ethclient.go | 6 ++++++ interfaces.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 4c63b776e..5c3cb79dd 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -665,6 +665,12 @@ func toCallArg(msg ethereum.CallMsg) interface{} { if msg.AccessList != nil { arg["accessList"] = msg.AccessList } + if msg.BlobGasFeeCap != nil { + arg["maxFeePerBlobGas"] = (*hexutil.Big)(msg.BlobGasFeeCap) + } + if msg.BlobHashes != nil { + arg["blobVersionedHashes"] = msg.BlobHashes + } return arg } diff --git a/interfaces.go b/interfaces.go index c6aee295e..53e2e3ae1 100644 --- a/interfaces.go +++ b/interfaces.go @@ -152,6 +152,10 @@ type CallMsg struct { Data []byte // input data, usually an ABI-encoded contract method invocation AccessList types.AccessList // EIP-2930 access list. + + // For BlobTxType + BlobGasFeeCap *big.Int + BlobHashes []common.Hash } // A ContractCaller provides contract calls, essentially transactions that are executed by