From 6d974a522fb60153d10cddfa9908ee5710a3f8c9 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Fri, 1 Jul 2022 14:54:10 +0200 Subject: [PATCH] internal/ethapi: add basefee to block overrides --- internal/ethapi/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index b45c1f123f58..85e69f358a69 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -889,6 +889,7 @@ type BlockOverrides struct { GasLimit *hexutil.Uint64 Coinbase *common.Address Random *common.Hash + BaseFee *hexutil.Big } // Apply overrides the given header fields into the given block context. @@ -914,6 +915,9 @@ func (diff *BlockOverrides) Apply(blockCtx *vm.BlockContext) { if diff.Random != nil { blockCtx.Random = diff.Random } + if diff.BaseFee != nil { + blockCtx.BaseFee = diff.BaseFee.ToInt() + } } func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, timeout time.Duration, globalGasCap uint64) (*core.ExecutionResult, error) {