Skip to content

Commit

Permalink
chore: revert inconsequential change to test code
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR4N committed Nov 15, 2024
1 parent bbc3b1b commit 405740f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/vm/contracts.libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions core/vm/contracts.libevm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 405740f

Please sign in to comment.