1616 TransactionStatus ,
1717)
1818from starknet_py .net .gateway_client import GatewayClient
19- from starknet_py .tests .e2e .fixtures .constants import (
20- PREDEPLOYED_EMPTY_CONTRACT_ADDRESS ,
21- PREDEPLOYED_MAP_CONTRACT_ADDRESS ,
22- )
23- from starknet_py .transaction_errors import (
24- TransactionRejectedError ,
25- TransactionRevertedError ,
26- )
19+ from starknet_py .tests .e2e .fixtures .constants import PREDEPLOYED_EMPTY_CONTRACT_ADDRESS
20+ from starknet_py .transaction_errors import TransactionRevertedError
2721
2822
2923@pytest .mark .parametrize (
@@ -53,7 +47,7 @@ async def test_get_transaction_receipt(client_integration, transaction_hash):
5347# Same thing could happen when you run tests locally and then push to run them on CI.
5448@pytest .mark .skipif (
5549 condition = "--client=gateway" in sys .argv ,
56- reason = "Separate FullNode tests from Gateway ones ." ,
50+ reason = "Gateway client has been disabled on integration network ." ,
5751)
5852@pytest .mark .asyncio
5953async def test_wait_for_tx_reverted_full_node (full_node_account_integration ):
@@ -71,71 +65,10 @@ async def test_wait_for_tx_reverted_full_node(full_node_account_integration):
7165 await account .client .wait_for_tx (tx_hash = invoke .transaction_hash )
7266
7367
74- @pytest .mark .skipif (
75- condition = "--client=full_node" in sys .argv ,
76- reason = "Separate FullNode tests from Gateway ones." ,
77- )
78- @pytest .mark .asyncio
79- async def test_wait_for_tx_reverted_gateway (gateway_account_integration ):
80- account = gateway_account_integration
81- # Calldata too long for the function (it has no parameters) to trigger REVERTED status
82- call = Call (
83- to_addr = int (PREDEPLOYED_EMPTY_CONTRACT_ADDRESS , 0 ),
84- selector = get_selector_from_name ("empty" ),
85- calldata = [0x1 , 0x2 , 0x3 , 0x4 , 0x5 ],
86- )
87- sign_invoke = await account .sign_invoke_transaction (calls = call , max_fee = int (1e16 ))
88- invoke = await account .client .send_transaction (sign_invoke )
89-
90- with pytest .raises (TransactionRevertedError , match = "Input too long for arguments" ):
91- await account .client .wait_for_tx (tx_hash = invoke .transaction_hash )
92-
93-
94- # No same test for full_node, because nodes don't know about rejected transactions
95- # https://community.starknet.io/t/efficient-utilization-of-sequencer-capacity-in-starknet-v0-12-1/95607#api-changes-3
96- @pytest .mark .skipif (
97- condition = "--client=full_node" in sys .argv ,
98- reason = "Separate FullNode tests from Gateway ones." ,
99- )
100- @pytest .mark .asyncio
101- async def test_wait_for_tx_rejected_gateway (gateway_account_integration ):
102- account = gateway_account_integration
103- call = Call (
104- to_addr = int (PREDEPLOYED_MAP_CONTRACT_ADDRESS , 0 ),
105- selector = get_selector_from_name ("put" ),
106- calldata = [0x102 , 0x125 ],
107- )
108- call2 = Call (
109- to_addr = int (
110- "0x05cd21d6b3952a869fda11fa9a5bd2657bd68080d3da255655ded47a81c8bd53" , 0
111- ),
112- selector = get_selector_from_name ("put" ),
113- calldata = [0x103 , 0x126 ],
114- )
115- sign_invoke = await account .sign_invoke_transaction (calls = call , max_fee = int (1e16 ))
116- sign_invoke2 = await account .sign_invoke_transaction (calls = call2 , max_fee = int (1e16 ))
117- # same nonces to trigger REJECTED error
118- assert sign_invoke2 .nonce == sign_invoke .nonce
119-
120- # this one should pass
121- invoke = await account .client .send_transaction (sign_invoke )
122- # this should be rejected
123- invoke2 = await account .client .send_transaction (sign_invoke2 )
124-
125- with pytest .raises (TransactionRejectedError ):
126- _ = await account .client .wait_for_tx (tx_hash = invoke2 .transaction_hash )
127-
128- invoke2_receipt = await account .client .get_transaction_receipt (
129- tx_hash = invoke2 .transaction_hash
130- )
131-
132- assert invoke2_receipt .execution_status == TransactionExecutionStatus .REJECTED
133-
134-
13568# Same here as in comment above 'test_wait_for_tx_reverted_full_node'
13669@pytest .mark .skipif (
13770 condition = "--client=gateway" in sys .argv ,
138- reason = "Separate FullNode tests from Gateway ones ." ,
71+ reason = "Gateway client has been disabled on integration network ." ,
13972)
14073@pytest .mark .asyncio
14174async def test_wait_for_tx_full_node_accepted (full_node_account_integration ):
@@ -155,26 +88,9 @@ async def test_wait_for_tx_full_node_accepted(full_node_account_integration):
15588
15689
15790@pytest .mark .skipif (
158- condition = "--client=full_node " in sys .argv ,
159- reason = "Separate FullNode tests from Gateway ones ." ,
91+ condition = "--client=gateway " in sys .argv ,
92+ reason = "Gateway client has been disabled on integration network ." ,
16093)
161- @pytest .mark .asyncio
162- async def test_wait_for_tx_gateway_accepted (gateway_account_integration ):
163- account = gateway_account_integration
164- call = Call (
165- to_addr = int (PREDEPLOYED_EMPTY_CONTRACT_ADDRESS , 0 ),
166- selector = get_selector_from_name ("empty" ),
167- calldata = [],
168- )
169- sign_invoke = await account .sign_invoke_transaction (calls = call , max_fee = int (1e16 ))
170- invoke = await account .client .send_transaction (sign_invoke )
171-
172- result = await account .client .wait_for_tx (tx_hash = invoke .transaction_hash )
173-
174- assert result .execution_status == TransactionExecutionStatus .SUCCEEDED
175- assert result .finality_status == TransactionFinalityStatus .ACCEPTED_ON_L2
176-
177-
17894@pytest .mark .asyncio
17995async def test_transaction_not_received_max_fee_too_small (account_integration ):
18096 account = account_integration
@@ -192,6 +108,10 @@ async def test_transaction_not_received_max_fee_too_small(account_integration):
192108 _ = await account .client .send_transaction (sign_invoke )
193109
194110
111+ @pytest .mark .skipif (
112+ condition = "--client=gateway" in sys .argv ,
113+ reason = "Gateway client has been disabled on integration network." ,
114+ )
195115@pytest .mark .asyncio
196116async def test_transaction_not_received_max_fee_too_big (account_integration ):
197117 account = account_integration
@@ -209,6 +129,10 @@ async def test_transaction_not_received_max_fee_too_big(account_integration):
209129 _ = await account .client .send_transaction (sign_invoke )
210130
211131
132+ @pytest .mark .skipif (
133+ condition = "--client=gateway" in sys .argv ,
134+ reason = "Gateway client has been disabled on integration network." ,
135+ )
212136@pytest .mark .asyncio
213137async def test_transaction_not_received_invalid_nonce (account_integration ):
214138 account = account_integration
@@ -225,6 +149,10 @@ async def test_transaction_not_received_invalid_nonce(account_integration):
225149 _ = await account .client .send_transaction (sign_invoke )
226150
227151
152+ @pytest .mark .skipif (
153+ condition = "--client=gateway" in sys .argv ,
154+ reason = "Gateway client has been disabled on integration network." ,
155+ )
228156@pytest .mark .asyncio
229157async def test_transaction_not_received_invalid_signature (account_integration ):
230158 account = account_integration
0 commit comments