Skip to content

Commit a5bcae2

Browse files
committed
Move env declaration in subtest closer to where it's used
1 parent ef76203 commit a5bcae2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libevm/legacy/legacy_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ func TestPrecompiledStatefulContract_Upgrade(t *testing.T) {
9191
t.Run(name, func(t *testing.T) {
9292
t.Parallel()
9393

94-
env := &stubPrecompileEnvironment{
95-
gasToReturn: testCase.envGas,
96-
}
9794
c := PrecompiledStatefulContract(func(env vm.PrecompileEnvironment, input []byte, suppliedGas uint64) (ret []byte, remainingGas uint64, err error) {
9895
return testCase.precompileRet, testCase.remainingGas, testCase.precompileErr
9996
})
10097

10198
upgraded := c.Upgrade()
10299

100+
env := &stubPrecompileEnvironment{
101+
gasToReturn: testCase.envGas,
102+
}
103103
input := []byte("unused")
104104

105105
ret, err := upgraded(env, input)

0 commit comments

Comments
 (0)