From c77da8c4885dbe6749a387ea651cb5dbcbfb0b79 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Wed, 3 Jan 2024 18:09:09 +0330 Subject: [PATCH] rename validate param --- internal/ethapi/api.go | 7 +++---- internal/ethapi/multicall.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 027bbea54f..7844fd2c01 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1130,12 +1130,12 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S // Make sure the context is cancelled when the call has completed // this makes sure resources are cleaned up. defer cancel() - return applyMessage(ctx, b, args, state, header, timeout, new(core.GasPool).AddGas(globalGasCap), &blockCtx, &vm.Config{NoBaseFee: true}, precompiles, false) + return applyMessage(ctx, b, args, state, header, timeout, new(core.GasPool).AddGas(globalGasCap), &blockCtx, &vm.Config{NoBaseFee: true}, precompiles, true) } -func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *state.StateDB, header *types.Header, timeout time.Duration, gp *core.GasPool, blockContext *vm.BlockContext, vmConfig *vm.Config, precompiles vm.PrecompiledContracts, validate bool) (*core.ExecutionResult, error) { +func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *state.StateDB, header *types.Header, timeout time.Duration, gp *core.GasPool, blockContext *vm.BlockContext, vmConfig *vm.Config, precompiles vm.PrecompiledContracts, skipChecks bool) (*core.ExecutionResult, error) { // Get a new instance of the EVM. - msg, err := args.ToMessage(gp.Gas(), header.BaseFee, !validate) + msg, err := args.ToMessage(gp.Gas(), header.BaseFee, skipChecks) if err != nil { return nil, err } @@ -1174,7 +1174,6 @@ func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash if state == nil || err != nil { return nil, err } - return doCall(ctx, b, args, state, header, overrides, blockOverrides, timeout, globalGasCap) } diff --git a/internal/ethapi/multicall.go b/internal/ethapi/multicall.go index 8bea9850da..0b189eeea0 100644 --- a/internal/ethapi/multicall.go +++ b/internal/ethapi/multicall.go @@ -195,7 +195,7 @@ func (mc *multicall) execute(ctx context.Context, opts mcOpts) ([]mcBlockResult, // Block hash will be repaired after execution. Tracer: newTracer(opts.TraceTransfers, blockContext.BlockNumber.Uint64(), common.Hash{}, tx.Hash(), uint(i)), } - result, err := applyMessage(ctx, mc.b, call, state, header, timeout, gp, &blockContext, vmConfig, precompiles, opts.Validation) + result, err := applyMessage(ctx, mc.b, call, state, header, timeout, gp, &blockContext, vmConfig, precompiles, !opts.Validation) if err != nil { txErr := txValidationError(err) return nil, txErr