File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
crates/apollo_integration_tests/src Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,19 @@ impl AnvilBaseLayer {
4444 const DEFAULT_ANVIL_PORT : u16 = 8545 ;
4545 const DEFAULT_ANVIL_L1_DEPLOYED_ADDRESS : & str = "0x5fbdb2315678afecb367f032d93f642f64180aa3" ;
4646
47- /// Note: if you have port conflicts, this is because you are running anvil in unit tests, see
48- /// usage docstring of the struct. Alternatively , you might have a zombie anvil instance
49- /// running, but that should be impossible if using this service .
47+ /// Note: if you have port conflicts, you might have a zombie anvil instance
48+ /// running, but that should be impossible if using through this service , you probably have a
49+ /// manually triggered Anvil instance somewhere in your shell .
5050 pub async fn new ( ) -> Self {
51+ let is_unit_test = cfg ! ( test) ;
52+ if is_unit_test {
53+ panic ! (
54+ "Don't use Anvil in unit tests, only in integration tests defined in the \
55+ integration tests crate. For unit tests, mock l1 using `alloy`'s mocked_provider \
56+ interface."
57+ ) ;
58+ }
59+
5160 // TODO(Arni): Remove the allow(deprecated) once we remove the deprecated function.
5261 #[ allow( deprecated) ]
5362 let anvil_client = ProviderBuilder :: new ( )
You can’t perform that action at this time.
0 commit comments