2020 PendingStarknetBlockWithReceipts ,
2121 ResourceBoundsMapping ,
2222 StarknetBlockWithReceipts ,
23+ Transaction ,
2324 TransactionExecutionStatus ,
2425 TransactionFinalityStatus ,
2526 TransactionReceipt ,
@@ -208,23 +209,21 @@ async def test_estimate_message_fee_invalid_eth_address_assertion_error(
208209 (
209210 (
210211 "0xbe1259ff905cadbbaa62514388b71bdefb8aacc1" ,
211- "0x2137 " ,
212+ "0x1234 " ,
212213 ), # valid `from_address`, invalid `to_address`
213214 (
214215 "0xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" ,
215- "0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82 " ,
216+ "0x06524771cb912945bf2db355b5a12355ca2e2ff05e15ee35366336a602293f2d " ,
216217 ), # invalid `from_address` (passes through assert), valid `to_address`
217218 ),
218219)
219220@pytest .mark .asyncio
220221async def test_estimate_message_fee_throws (
221- client_sepolia_integration , from_address , to_address
222+ client_sepolia_testnet , from_address , to_address
222223):
223- client = client_sepolia_integration
224-
225224 with pytest .raises (ClientError ):
226- _ = await client .estimate_message_fee (
227- block_number = 123123 ,
225+ _ = await client_sepolia_testnet .estimate_message_fee (
226+ block_number = 80000 ,
228227 from_address = from_address ,
229228 to_address = to_address ,
230229 entry_point_selector = "0x3248" ,
@@ -235,78 +234,57 @@ async def test_estimate_message_fee_throws(
235234
236235
237236@pytest .mark .asyncio
238- async def test_get_tx_receipt_reverted (client_sepolia_integration ):
239- client = client_sepolia_integration
237+ async def test_get_tx_receipt_reverted (client_sepolia_testnet ):
240238 reverted_tx_hash = (
241- "0x01b2d9e5a725069ae40e3149813ffe05b8c4405e253e9f8ab29d0a3b2e279927 "
239+ "0x00fecca6a328dd11f40b79c30fe22d23bc6975d1a0923a95b90aff4016a84333 "
242240 )
243241
244- res = await client .get_transaction_receipt (tx_hash = reverted_tx_hash )
242+ res = await client_sepolia_testnet .get_transaction_receipt (tx_hash = reverted_tx_hash )
245243
246244 assert res .execution_status == TransactionExecutionStatus .REVERTED
247245 assert res .finality_status == TransactionFinalityStatus .ACCEPTED_ON_L1
248246 assert "Got an exception while executing a hint" in res .revert_reason
249247
250248
251249@pytest .mark .parametrize (
252- "block_number, transaction_index " ,
250+ "block_number, index, expected_hash " ,
253251 [
254- # declare: https://integration-sepolia.starkscan.co/tx/0x0544a629990d2bed8ccf11910b30f2f1e18228ed5be06660bea20cae13b2aced
255- (9707 , 0 ),
256- # deploy_account: https://integration-sepolia.starkscan.co/tx/0x012debae2435ea43c06610a31ccf8e7ea5de9aec43dac7c7aa86905b4ccdec49
257- (9708 , 6 ),
258- # invoke: https://integration-sepolia.starkscan.co/tx/0x069125fd85a199a5d06445e1ece5067781aa46c745e3e2993c696c60bbd5992c
259- (9708 , 0 ),
260- # l1_handler: https://integration-sepolia.starkscan.co/tx/0x0117be3e303704f0acb630149250a78a262ecff8bef3ee8a53a02f18b472f873
261- (9708 , 7 ),
252+ (81116 , 0 , 0x38FC01353196AEEBA62C74A8C8479FFF94AAA8CD4C3655782D49D755BBE63A8 ),
253+ (81116 , 26 , 0x3F873FE2CC884A88B8D4378EAC1786145F7167D61B0A9442DA15B0181582522 ),
254+ (80910 , 23 , 0x67C1E282F64DAD5682B1F377A5FDA1778311D894B2EE47A06058790A8B08460 ),
262255 ],
263256)
264257@pytest .mark .asyncio
265258async def test_get_transaction_by_block_id_and_index (
266- client_sepolia_integration , block_number , transaction_index
259+ client_sepolia_testnet , block_number , index , expected_hash
267260):
268- client = client_sepolia_integration
269-
270- tx = await client .get_transaction_by_block_id (
271- block_number = block_number , index = transaction_index
261+ tx = await client_sepolia_testnet .get_transaction_by_block_id (
262+ block_number = block_number , index = index
272263 )
273264
274- assert tx .hash is not None
275-
276- receipt = await client .get_transaction_receipt (tx_hash = tx .hash )
277-
278- assert receipt .finality_status is not None
279- assert receipt .execution_status is not None
280-
281-
282- @pytest .mark .asyncio
283- async def test_get_block (client_sepolia_integration ):
284- client = client_sepolia_integration
285- res = await client .get_block (block_number = "latest" )
286-
287- for tx in res .transactions :
288- assert tx .hash is not None
265+ assert isinstance (tx , Transaction )
266+ assert tx .hash == expected_hash
289267
290268
291269@pytest .mark .asyncio
292- async def test_get_l1_message_hash (client_sepolia_integration ):
293- tx_hash = "0x065b2b6543e49f2f8a22541e9141f506752d984b4d8c690526001025109cee30 "
294- l1_message_hash = await client_sepolia_integration .get_l1_message_hash (tx_hash )
270+ async def test_get_l1_message_hash (client_sepolia_testnet ):
271+ tx_hash = "0x067d959200d65d4ad293aa4b0da21bb050a1f669bce37d215c6edbf041269c07 "
272+ l1_message_hash = await client_sepolia_testnet .get_l1_message_hash (tx_hash )
295273 assert (
296274 hex (l1_message_hash )
297- == "0x4aed43247e106a0687258bfc835131e5dee15c24fb18222d382dbff470df0f9e "
275+ == "0x2e350fa9d830482605cb68be4fdb9f0cb3e1f95a0c51623ac1a5d1bd997c2090 "
298276 )
299277
300278
301279@pytest .mark .asyncio
302280async def test_get_l1_message_hash_raises_on_incorrect_transaction_type (
303- client_sepolia_integration ,
281+ client_sepolia_testnet ,
304282):
305- tx_hash = "0x044a5565cde76c445db6205d208f584879d9e6e8f8b6b2ebb58e658680320cfa "
283+ tx_hash = "0x38FC01353196AEEBA62C74A8C8479FFF94AAA8CD4C3655782D49D755BBE63A8 "
306284 with pytest .raises (
307285 TypeError , match = f"Transaction { tx_hash } is not a result of L1->L2 interaction."
308286 ):
309- await client_sepolia_integration .get_l1_message_hash (tx_hash )
287+ await client_sepolia_testnet .get_l1_message_hash (tx_hash )
310288
311289
312290@pytest .mark .asyncio
@@ -399,13 +377,6 @@ async def test_get_chain_id_sepolia_testnet(client_sepolia_testnet):
399377 assert chain_id == hex (StarknetChainId .SEPOLIA .value )
400378
401379
402- @pytest .mark .asyncio
403- async def test_get_chain_id_sepolia_integration (client_sepolia_integration ):
404- chain_id = await client_sepolia_integration .get_chain_id ()
405- assert isinstance (chain_id , str )
406- assert chain_id == hex (StarknetChainId .SEPOLIA_INTEGRATION .value )
407-
408-
409380@pytest .mark .asyncio
410381async def test_get_events_sepolia_testnet (client_sepolia_testnet ):
411382 events_chunk = await client_sepolia_testnet .get_events (
@@ -425,21 +396,6 @@ async def test_get_events_sepolia_testnet(client_sepolia_testnet):
425396 assert events_chunk .events [0 ].keys is not None
426397
427398
428- @pytest .mark .asyncio
429- async def test_get_tx_receipt_with_execution_resources (client_sepolia_integration ):
430- receipt = await client_sepolia_integration .get_transaction_receipt (
431- tx_hash = 0x077E84B7C0C4CC88B778EEAEF32B7CED4500FE4AAEE62FD2F849B7DD90A87826
432- )
433-
434- assert receipt .execution_resources is not None
435- assert receipt .execution_resources .data_availability is not None
436- assert receipt .execution_resources .steps is not None
437- assert receipt .execution_resources .bitwise_builtin_applications is not None
438- assert receipt .execution_resources .ec_op_builtin_applications is not None
439- assert receipt .execution_resources .pedersen_builtin_applications is not None
440- assert receipt .execution_resources .range_check_builtin_applications is not None
441-
442-
443399@pytest .mark .asyncio
444400async def test_get_block_with_receipts (client_sepolia_testnet ):
445401 block_with_receipts = await client_sepolia_testnet .get_block_with_receipts (
@@ -456,8 +412,8 @@ async def test_get_block_with_receipts(client_sepolia_testnet):
456412
457413
458414@pytest .mark .asyncio
459- async def test_get_pending_block_with_receipts (client_sepolia_integration ):
460- block_with_receipts = await client_sepolia_integration .get_block_with_receipts (
415+ async def test_get_pending_block_with_receipts (client_sepolia_testnet ):
416+ block_with_receipts = await client_sepolia_testnet .get_block_with_receipts (
461417 block_number = "pending"
462418 )
463419
0 commit comments