@@ -12,23 +12,17 @@ use starknet_api::hash::StarkHash;
12
12
use tar:: Archive ;
13
13
use tempfile:: { tempdir, TempDir } ;
14
14
use tracing:: debug;
15
- use url:: Url ;
16
15
17
16
use crate :: ethereum_base_layer_contract:: {
18
17
EthereumBaseLayerConfig ,
19
18
EthereumBaseLayerContract ,
20
19
EthereumContractAddress ,
21
- Starknet ,
22
- StarknetL1Contract ,
23
20
} ;
24
21
25
22
type TestEthereumNodeHandle = ( GanacheInstance , TempDir ) ;
26
23
27
24
const MINIMAL_GANACHE_VERSION : u8 = 7 ;
28
25
29
- // See Anvil documentation:
30
- // https://docs.rs/ethers-core/latest/ethers_core/utils/struct.Anvil.html#method.new.
31
- const DEFAULT_ANVIL_PORT : u16 = 8545 ;
32
26
// This address is commonly used as the L1 address of the Starknet core contract.
33
27
// TODO(Arni): Replace with constant with use of `AnvilInstance::address(&self)`.
34
28
pub const DEFAULT_ANVIL_L1_DEPLOYED_ADDRESS : & str = "0x5fbdb2315678afecb367f032d93f642f64180aa3" ;
@@ -129,37 +123,6 @@ pub fn anvil(port: Option<u16>) -> AnvilInstance {
129
123
} )
130
124
}
131
125
132
- pub fn ethereum_base_layer_config_for_anvil ( port : Option < u16 > ) -> EthereumBaseLayerConfig {
133
- // Use the specified port if provided; otherwise, default to Anvil's default port.
134
- let non_optional_port = port. unwrap_or ( DEFAULT_ANVIL_PORT ) ;
135
- let endpoint = format ! ( "http://localhost:{non_optional_port}" ) ;
136
- EthereumBaseLayerConfig {
137
- node_url : Url :: parse ( & endpoint) . unwrap ( ) ,
138
- starknet_contract_address : DEFAULT_ANVIL_L1_DEPLOYED_ADDRESS . parse ( ) . unwrap ( ) ,
139
- ..Default :: default ( )
140
- }
141
- }
142
-
143
- pub fn anvil_instance_from_config ( config : & EthereumBaseLayerConfig ) -> AnvilInstance {
144
- let port = config. node_url . port ( ) ;
145
- let anvil = anvil ( port) ;
146
- assert_eq ! ( config. node_url, anvil. endpoint_url( ) , "Unexpected config for Anvil instance." ) ;
147
- anvil
148
- }
149
-
150
- pub async fn spawn_anvil_and_deploy_starknet_l1_contract (
151
- config : & EthereumBaseLayerConfig ,
152
- ) -> ( AnvilInstance , StarknetL1Contract ) {
153
- let anvil = anvil_instance_from_config ( config) ;
154
- let starknet_l1_contract = deploy_starknet_l1_contract ( config. clone ( ) ) . await ;
155
- ( anvil, starknet_l1_contract)
156
- }
157
-
158
- pub async fn deploy_starknet_l1_contract ( config : EthereumBaseLayerConfig ) -> StarknetL1Contract {
159
- let ethereum_base_layer_contract = EthereumBaseLayerContract :: new ( config) ;
160
- Starknet :: deploy ( ethereum_base_layer_contract. contract . provider ( ) . clone ( ) ) . await . unwrap ( )
161
- }
162
-
163
126
// FIXME: This should be part of AnvilBaseLayer, however the usage in the simulator doesn't allow
164
127
// that, since it is coupled with a manual invocation of an anvil instance that is managed inside
165
128
// the github workflow.
0 commit comments