From 405740fe3a756f128be500c9d3f5b1e417fc50d0 Mon Sep 17 00:00:00 2001 From: Arran Schlosberg Date: Fri, 15 Nov 2024 14:51:52 +0000 Subject: [PATCH] chore: revert inconsequential change to test code --- core/vm/contracts.libevm.go | 2 +- core/vm/contracts.libevm_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/vm/contracts.libevm.go b/core/vm/contracts.libevm.go index d95f1314d327..dadd7e3f118d 100644 --- a/core/vm/contracts.libevm.go +++ b/core/vm/contracts.libevm.go @@ -92,7 +92,7 @@ func (t CallType) OpCode() OpCode { // regular types. func (args *evmCallArgs) run(p PrecompiledContract, input []byte, suppliedGas uint64) (ret []byte, remainingGas uint64, err error) { if p, ok := p.(statefulPrecompile); ok { - // `suppliedGas` is already held by the args. + // `suppliedGas` is already held by the args, and captured by `env()`. return p.run(args.env(), input) } // Gas consumption for regular precompiles was already handled by the native diff --git a/core/vm/contracts.libevm_test.go b/core/vm/contracts.libevm_test.go index e4d134ed17ea..21b8b88d02ff 100644 --- a/core/vm/contracts.libevm_test.go +++ b/core/vm/contracts.libevm_test.go @@ -149,11 +149,11 @@ func TestNewStatefulPrecompile(t *testing.T) { run := func(env vm.PrecompileEnvironment, input []byte, suppliedGas uint64) ([]byte, uint64, error) { if got, want := env.StateDB() != nil, !env.ReadOnly(); got != want { - return nil, suppliedGas, fmt.Errorf("PrecompileEnvironment().StateDB() must be non-nil i.f.f. not read-only; got non-nil? %t; want %t", got, want) + return nil, 0, fmt.Errorf("PrecompileEnvironment().StateDB() must be non-nil i.f.f. not read-only; got non-nil? %t; want %t", got, want) } hdr, err := env.BlockHeader() if err != nil { - return nil, suppliedGas, err + return nil, 0, err } out := &statefulPrecompileOutput{