@@ -159,7 +159,7 @@ def test_invalid_block_list(cronos):
159159 assert "failed to read header" in str (exc .value )
160160
161161
162- def test_block_list_eip7702 (cronos ):
162+ def test_block_list_eip7022 (cronos ):
163163 gen_validator_identity (cronos )
164164 cli = cronos .cosmos_cli ()
165165 w3 = cronos .w3
@@ -208,3 +208,35 @@ def test_block_list_eip7702(cronos):
208208 wait_for_new_blocks (cli , 1 )
209209 assert nonce + 1 == get_nonce (cli , sender )
210210 assert w3 .eth .get_filter_changes (flt .filter_id ) == []
211+
212+
213+ def test_block_list_contract (cronos ):
214+ gen_validator_identity (cronos )
215+ cli = cronos .cosmos_cli ()
216+ user = cli .address ("signer2" )
217+ blocked_destination = cli .address ("signer1" )
218+ # set blocklist
219+ encrypt_to_validators (cli , {"addresses" : [blocked_destination ]})
220+ tx = {
221+ "from" : to_checksum_address (bech32_to_eth (user )),
222+ "to" : to_checksum_address (bech32_to_eth (blocked_destination )),
223+ "value" : 1 ,
224+ }
225+ base_port = cronos .base_port (0 )
226+ wait_for_port (ports .evmrpc_ws_port (base_port ))
227+ w3 = cronos .w3
228+ flt = w3 .eth .filter ("pending" )
229+ assert flt .get_new_entries () == []
230+
231+ txhash = w3 .eth .send_transaction (tx ).hex ()
232+ nonce = get_nonce (cli , user )
233+ # check tx in mempool
234+ assert HexBytes (txhash ) in w3 .eth .get_filter_changes (flt .filter_id )
235+
236+ # clear blocklist
237+ encrypt_to_validators (cli , {})
238+
239+ # the blocked tx should be unblocked now
240+ wait_for_new_blocks (cli , 1 )
241+ assert nonce + 1 == get_nonce (cli , user )
242+ assert w3 .eth .get_filter_changes (flt .filter_id ) == []
0 commit comments