@@ -3,22 +3,16 @@ use alloy::primitives::B256;
3
3
use alloy:: providers:: mock:: Asserter ;
4
4
use alloy:: providers:: { Provider , ProviderBuilder } ;
5
5
use alloy:: rpc:: types:: { Block , BlockTransactions , Header as AlloyRpcHeader } ;
6
- use assert_matches:: assert_matches;
7
6
use pretty_assertions:: assert_eq;
8
7
use starknet_api:: block:: { BlockHash , BlockHashAndNumber , BlockNumber } ;
9
- use starknet_api:: core:: EntryPointSelector ;
10
- use starknet_api:: transaction:: L1HandlerTransaction ;
11
- use starknet_api:: { calldata, contract_address, felt} ;
8
+ use starknet_api:: felt;
12
9
13
- use crate :: anvil_base_layer:: { send_message_to_l2, AnvilBaseLayer } ;
14
- use crate :: constants:: { EventIdentifier , LOG_MESSAGE_TO_L2_EVENT_IDENTIFIER } ;
15
10
use crate :: ethereum_base_layer_contract:: {
16
11
EthereumBaseLayerConfig ,
17
12
EthereumBaseLayerContract ,
18
13
Starknet ,
19
14
} ;
20
- use crate :: test_utils:: DEFAULT_ANVIL_L1_ACCOUNT_ADDRESS ;
21
- use crate :: { BaseLayerContract , L1Event } ;
15
+ use crate :: BaseLayerContract ;
22
16
23
17
// TODO(Gilad): Use everywhere instead of relying on the confusing `#[ignore]` api to mark slow
24
18
// tests.
@@ -112,60 +106,3 @@ async fn get_gas_price_and_timestamps() {
112
106
let expected_original_blob_calc = 19 ;
113
107
assert_eq ! ( header. blob_fee, expected_original_blob_calc) ;
114
108
}
115
-
116
- // Ensure that the base layer instance filters out events from other deployments of the core
117
- // contract.
118
- #[ tokio:: test]
119
- async fn events_from_other_contract ( ) {
120
- if !in_ci ( ) {
121
- return ;
122
- }
123
- const EVENT_IDENTIFIERS : & [ EventIdentifier ] = & [ LOG_MESSAGE_TO_L2_EVENT_IDENTIFIER ] ;
124
-
125
- let anvil_base_layer = AnvilBaseLayer :: new ( ) . await ;
126
- // Anvil base layer already auto-deployed a starknet contract.
127
- let this_contract = & anvil_base_layer. ethereum_base_layer . contract ;
128
-
129
- // Setup.
130
-
131
- // Deploy another instance of the contract to the same anvil instance.
132
- let other_contract = Starknet :: deploy ( this_contract. provider ( ) . clone ( ) ) . await . unwrap ( ) ;
133
- assert_ne ! (
134
- this_contract. address( ) ,
135
- other_contract. address( ) ,
136
- "The two contracts should be different."
137
- ) ;
138
-
139
- let this_l1_handler = L1HandlerTransaction {
140
- contract_address : contract_address ! ( "0x12" ) ,
141
- entry_point_selector : EntryPointSelector ( felt ! ( "0x34" ) ) ,
142
- calldata : calldata ! ( DEFAULT_ANVIL_L1_ACCOUNT_ADDRESS , felt!( "0x1" ) , felt!( "0x2" ) ) ,
143
- ..Default :: default ( )
144
- } ;
145
- let this_receipt = send_message_to_l2 ( this_contract, & this_l1_handler. clone ( ) ) . await ;
146
- assert ! ( this_receipt. status( ) ) ;
147
- let this_block_number = this_receipt. block_number . unwrap ( ) ;
148
-
149
- let other_l1_handler = L1HandlerTransaction {
150
- contract_address : contract_address ! ( "0x56" ) ,
151
- entry_point_selector : EntryPointSelector ( felt ! ( "0x78" ) ) ,
152
- calldata : calldata ! ( DEFAULT_ANVIL_L1_ACCOUNT_ADDRESS , felt!( "0x1" ) , felt!( "0x2" ) ) ,
153
- ..Default :: default ( )
154
- } ;
155
- let other_receipt = send_message_to_l2 ( & other_contract, & other_l1_handler. clone ( ) ) . await ;
156
- assert ! ( other_receipt. status( ) ) ;
157
- let other_block_number = other_receipt. block_number . unwrap ( ) ;
158
-
159
- let min_block_number = this_block_number. min ( other_block_number) . saturating_sub ( 1 ) ;
160
- let max_block_number = this_block_number. max ( other_block_number) . saturating_add ( 1 ) ;
161
-
162
- // Test the events.
163
- let mut events = anvil_base_layer
164
- . ethereum_base_layer
165
- . events ( min_block_number..=max_block_number, EVENT_IDENTIFIERS )
166
- . await
167
- . unwrap ( ) ;
168
-
169
- assert_eq ! ( events. len( ) , 1 , "Expected only events from this contract." ) ;
170
- assert_matches ! ( events. remove( 0 ) , L1Event :: LogMessageToL2 { tx, .. } if tx == this_l1_handler) ;
171
- }
0 commit comments