@@ -5,9 +5,11 @@ import (
55 "math/big"
66 "testing"
77
8+ "github.com/holiman/uint256"
89 "github.com/stretchr/testify/require"
910
1011 "github.com/ethereum/go-ethereum/common"
12+ gethTypes "github.com/ethereum/go-ethereum/core/types"
1113 "github.com/ethereum/go-ethereum/params"
1214
1315 "github.com/onflow/flow-go/fvm/evm/handler"
@@ -91,6 +93,7 @@ func TestView(t *testing.T) {
9193 testAccount .Address ().ToCommon (),
9294 testContract .DeployedAt .ToCommon (),
9395 testContract .MakeCallData (t , "verifyArchCallToFlowBlockHeight" , expectedFlowHeight ),
96+ []gethTypes.SetCodeAuthorization {},
9497 big .NewInt (0 ),
9598 uint64 (1_000_000 ),
9699 query .WithExtraPrecompiledContracts (
@@ -110,6 +113,7 @@ func TestView(t *testing.T) {
110113 testAccount .Address ().ToCommon (),
111114 newBalance ,
112115 ),
116+ []gethTypes.SetCodeAuthorization {},
113117 big .NewInt (0 ),
114118 uint64 (1_000_000 ),
115119 query .WithStateOverrideBalance (
@@ -129,6 +133,7 @@ func TestView(t *testing.T) {
129133 "store" ,
130134 big .NewInt (2 ),
131135 ),
136+ []gethTypes.SetCodeAuthorization {},
132137 big .NewInt (0 ),
133138 params .MaxTxGas + 1_000 ,
134139 )
@@ -142,6 +147,7 @@ func TestView(t *testing.T) {
142147 "store" ,
143148 big .NewInt (2 ),
144149 ),
150+ []gethTypes.SetCodeAuthorization {},
145151 big .NewInt (0 ),
146152 maxCallGasLimit + 1 ,
147153 )
@@ -151,6 +157,29 @@ func TestView(t *testing.T) {
151157 err ,
152158 "gas limit is bigger than max gas limit allowed 26777217 > 26777216" ,
153159 )
160+
161+ // test non-empty SetCode authorization list
162+ _ , err = view .DryCall (
163+ testAccount .Address ().ToCommon (),
164+ testContract .DeployedAt .ToCommon (),
165+ testContract .MakeCallData (t ,
166+ "store" ,
167+ big .NewInt (2 ),
168+ ),
169+ []gethTypes.SetCodeAuthorization {
170+ gethTypes.SetCodeAuthorization {
171+ ChainID : * uint256 .NewInt (747 ),
172+ Address : common .HexToAddress ("0xD370975A6257fE8CeF93101799D602D30838BAad" ),
173+ Nonce : 1 ,
174+ V : 28 ,
175+ R : * RandomUint256Int (15_000_000 ),
176+ S : * RandomUint256Int (15_000_000 ),
177+ },
178+ },
179+ big .NewInt (0 ),
180+ maxCallGasLimit ,
181+ )
182+ require .NoError (t , err )
154183 })
155184 })
156185 })
@@ -186,6 +215,7 @@ func TestViewStateOverrides(t *testing.T) {
186215 testAccount .Address ().ToCommon (),
187216 testContract .DeployedAt .ToCommon (),
188217 testContract .MakeCallData (t , "retrieve" ),
218+ nil ,
189219 big .NewInt (0 ),
190220 uint64 (1_000_000 ),
191221 query .WithStateOverrideState (
@@ -225,6 +255,7 @@ func TestViewStateOverrides(t *testing.T) {
225255 testAccount .Address ().ToCommon (),
226256 testContract .DeployedAt .ToCommon (),
227257 testContract .MakeCallData (t , "retrieve" ),
258+ nil ,
228259 big .NewInt (0 ),
229260 uint64 (1_000_000 ),
230261 query .WithStateOverrideStateDiff (
@@ -264,6 +295,7 @@ func TestViewStateOverrides(t *testing.T) {
264295 testAccount .Address ().ToCommon (),
265296 testContract .DeployedAt .ToCommon (),
266297 testContract .MakeCallData (t , "retrieve" ),
298+ nil ,
267299 big .NewInt (0 ),
268300 uint64 (1_000_000 ),
269301 query .WithStateOverrideState (
@@ -304,6 +336,7 @@ func TestViewStateOverrides(t *testing.T) {
304336 testAccount .Address ().ToCommon (),
305337 testContract .DeployedAt .ToCommon (),
306338 testContract .MakeCallData (t , "retrieve" ),
339+ nil ,
307340 big .NewInt (0 ),
308341 uint64 (1_000_000 ),
309342 query .WithStateOverrideStateDiff (
@@ -346,6 +379,7 @@ func TestViewStateOverrides(t *testing.T) {
346379 testAccount .Address ().ToCommon (),
347380 newContractAddress ,
348381 testContract .MakeCallData (t , "retrieve" ),
382+ nil ,
349383 big .NewInt (0 ),
350384 uint64 (1_000_000 ),
351385 query .WithStateOverrideCode (
@@ -391,6 +425,7 @@ func TestViewStateOverrides(t *testing.T) {
391425 testAccount .Address ().ToCommon (),
392426 newContractAddress ,
393427 testContract .MakeCallData (t , "retrieve" ),
428+ nil ,
394429 big .NewInt (0 ),
395430 uint64 (1_000_000 ),
396431 query .WithStateOverrideCode (
0 commit comments