@@ -13,6 +13,7 @@ import type {
13
13
SubscriptionEvent ,
14
14
HttpHeader ,
15
15
} from "@nomicfoundation/edr" ;
16
+ import { l1GenesisState , l1HardforkFromString } from "@nomicfoundation/edr" ;
16
17
import { Common } from "@nomicfoundation/ethereumjs-common" ;
17
18
import picocolors from "picocolors" ;
18
19
import debug from "debug" ;
@@ -218,6 +219,11 @@ export class EdrProviderWrapper
218
219
219
220
const hardforkName = getHardforkName ( config . hardfork ) ;
220
221
222
+ const genesisState =
223
+ fork !== undefined
224
+ ? [ ]
225
+ : l1GenesisState ( l1HardforkFromString ( config . hardfork ) ) ;
226
+
221
227
const context = await getGlobalEdrContext ( ) ;
222
228
const provider = await context . createProvider (
223
229
GENERIC_CHAIN_TYPE ,
@@ -249,13 +255,8 @@ export class EdrProviderWrapper
249
255
coinbase : Buffer . from ( coinbase . slice ( 2 ) , "hex" ) ,
250
256
enableRip7212 : config . enableRip7212 ,
251
257
fork,
258
+ genesisState,
252
259
hardfork : ethereumsjsHardforkToEdrSpecId ( hardforkName ) ,
253
- genesisAccounts : config . genesisAccounts . map ( ( account ) => {
254
- return {
255
- secretKey : account . privateKey ,
256
- balance : BigInt ( account . balance ) ,
257
- } ;
258
- } ) ,
259
260
initialDate,
260
261
initialBaseFeePerGas :
261
262
config . initialBaseFeePerGas !== undefined
@@ -270,6 +271,12 @@ export class EdrProviderWrapper
270
271
} ,
271
272
} ,
272
273
networkId : BigInt ( config . networkId ) ,
274
+ ownedAccounts : config . genesisAccounts . map ( ( account ) => {
275
+ return {
276
+ secretKey : account . privateKey ,
277
+ balance : BigInt ( account . balance ) ,
278
+ } ;
279
+ } ) ,
273
280
} ,
274
281
{
275
282
enable : loggerConfig . enabled ,
0 commit comments