@@ -167,7 +167,6 @@ def __init__(
167167 kwargs_ctor : dict = {
168168 "data_dir" : self .data_dir ,
169169 "geth_executable" : executable [0 ],
170- "network_id" : f"{ chain_id } " ,
171170 }
172171 if hostname is not None :
173172 kwargs_ctor ["rpc_addr" ] = hostname
@@ -199,7 +198,6 @@ def __init__(
199198 geth_kwargs = construct_test_chain_kwargs (** kwargs_ctor )
200199 if is_reth :
201200 geth_kwargs .pop ("max_peers" , None )
202- geth_kwargs .pop ("network_id" , None )
203201 geth_kwargs .pop ("no_discover" , None )
204202
205203 # NOTE: --verbosity _is_ available in reth, but it is a different type (flag only).
@@ -219,6 +217,10 @@ def __init__(
219217 self ._clean ()
220218
221219 geth_kwargs ["dev_mode" ] = True
220+
221+ # Does not work with --dev mode.
222+ geth_kwargs .pop ("network_id" , None )
223+
222224 hd_path = hd_path or DEFAULT_TEST_HD_PATH
223225
224226 if generate_accounts :
@@ -243,6 +245,7 @@ def __init__(
243245 idx = self .command .index (executable [0 ])
244246 self .command = self .command [:idx ] + executable + self .command [idx + 1 :]
245247
248+
246249 @classmethod
247250 def from_uri (cls , uri : str , data_folder : Path , ** kwargs ):
248251 mnemonic = kwargs .get ("mnemonic" , DEFAULT_TEST_MNEMONIC )
0 commit comments