Skip to content

Commit 40f59e8

Browse files
authored
Remove skipping of certain tests (#1470)
* Remove skip 'test_get_declare_transaction' * Remove skip 'test_get_invoke_transaction' * Remove skip 'test_get_deploy_account_transaction' * Remove skip 'test_get_block_by_hash' * Remove skip 'test_multicall' * Remove skipping of several tests * Remove skipping of several tests * Remove skipping of several tests * Remove skipping of several tests * Remove skipping of several tests * Remove ledger from CI * Update 'max_fee' in 'test_declare_v2' * Skip ledger tests * Update 'max_fee' in 'test_declaring_contracts' * Add copy of map contract * Add copy of account contract * Add second copy of map contract * Fix 'lib.cairo' * Fix import * Fix import * Fix 'test_compute_sierra_class_hash' * Revert "Remove ledger from CI" This reverts commit a2efffa. * Revert "Skip ledger tests" This reverts commit 376e6fe. * Rename 'account_copy.cario' -> 'account_copy1.cairo' * Fix imports in 'lib.cairo' * Revert "Fix 'test_compute_sierra_class_hash'" This reverts commit 82a21e4. * Reapply "Remove ledger from CI" This reverts commit ec492e6. * Reapply "Skip ledger tests" This reverts commit dd560e7. * Revert "Reapply "Skip ledger tests"" This reverts commit c88cb42. * Revert "Reapply "Remove ledger from CI"" This reverts commit 203de83. * Remove unnecessary line * Rename copy fizture names * Fix lint * Rename contracts
1 parent 688fd8f commit 40f59e8

File tree

14 files changed

+135
-56
lines changed

14 files changed

+135
-56
lines changed

starknet_py/tests/e2e/block_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ async def test_block_with_tx_hashes_pending(account):
3434
assert isinstance(blk.transactions, list)
3535

3636

37-
# TODO (#1419): Fix contract redeclaration
38-
@pytest.mark.skip(reason="Redeclaration occurred")
3937
@pytest.mark.asyncio
4038
async def test_block_with_tx_hashes_latest(account):
4139
blk = await account.client.get_block_with_tx_hashes(block_number="latest")
@@ -64,7 +62,6 @@ async def test_get_block_with_txs_pending(account):
6462
assert isinstance(blk.transactions, list)
6563

6664

67-
# TODO (#1419): Fix contract redeclaration
6865
@pytest.mark.asyncio
6966
async def test_get_block_with_txs_latest(account, map_class_hash):
7067
# pylint: disable=unused-argument

starknet_py/tests/e2e/client/client_test.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
)
4242

4343

44-
# TODO (#1419): Fix contract redeclaration
45-
@pytest.mark.skip(reason="Redeclaration occurred")
4644
@pytest.mark.asyncio
4745
async def test_get_declare_transaction(
4846
client, declare_transaction_hash, class_hash, account
@@ -55,8 +53,6 @@ async def test_get_declare_transaction(
5553
assert transaction.sender_address == account.address
5654

5755

58-
# TODO (#1419): Fix contract redeclaration
59-
@pytest.mark.skip(reason="Redeclaration occurred")
6056
@pytest.mark.asyncio
6157
async def test_get_invoke_transaction(
6258
client,
@@ -69,8 +65,6 @@ async def test_get_invoke_transaction(
6965
assert transaction.hash == invoke_transaction_hash
7066

7167

72-
# TODO (#1419): Fix contract redeclaration
73-
@pytest.mark.skip(reason="Redeclaration occurred")
7468
@pytest.mark.asyncio
7569
async def test_get_deploy_account_transaction(client, deploy_account_transaction_hash):
7670
transaction = await client.get_transaction(deploy_account_transaction_hash)
@@ -89,8 +83,6 @@ async def test_get_transaction_raises_on_not_received(client):
8983
await client.get_transaction(tx_hash=0x9999)
9084

9185

92-
# TODO (#1419): Fix contract redeclaration
93-
@pytest.mark.skip(reason="Redeclaration occurred")
9486
@pytest.mark.asyncio
9587
async def test_get_block_by_hash(
9688
client,
@@ -104,8 +96,6 @@ async def test_get_block_by_hash(
10496
assert len(block.transactions) != 0
10597

10698

107-
# TODO (#1419): Fix contract redeclaration
108-
@pytest.mark.skip(reason="Redeclaration occurred")
10999
@pytest.mark.asyncio
110100
async def test_get_block_by_number(
111101
client,
@@ -119,8 +109,6 @@ async def test_get_block_by_number(
119109
assert len(block.transactions) != 0
120110

121111

122-
# TODO (#1419): Fix contract redeclaration
123-
@pytest.mark.skip(reason="Redeclaration occurred")
124112
@pytest.mark.asyncio
125113
async def test_get_storage_at(client, contract_address):
126114
storage = await client.get_storage_at(
@@ -132,8 +120,6 @@ async def test_get_storage_at(client, contract_address):
132120
assert storage == 1897
133121

134122

135-
# TODO (#1419): Fix contract redeclaration
136-
@pytest.mark.skip(reason="Redeclaration occurred")
137123
@pytest.mark.asyncio
138124
async def test_get_transaction_receipt(
139125
client, invoke_transaction_hash, block_with_invoke_number
@@ -145,8 +131,6 @@ async def test_get_transaction_receipt(
145131
assert receipt.type == TransactionType.INVOKE
146132

147133

148-
# TODO (#1419): Fix contract redeclaration
149-
@pytest.mark.skip(reason="Redeclaration occurred")
150134
@pytest.mark.asyncio
151135
async def test_estimate_fee_invoke(account, contract_address):
152136
invoke_tx = await account.sign_invoke_v1(
@@ -169,8 +153,6 @@ async def test_estimate_fee_invoke(account, contract_address):
169153
assert estimate_fee.data_gas_consumed > 0
170154

171155

172-
# TODO (#1419): Fix contract redeclaration
173-
@pytest.mark.skip(reason="Redeclaration occurred")
174156
@pytest.mark.asyncio
175157
async def test_estimate_fee_invoke_v3(account, contract_address):
176158
invoke_tx = await account.sign_invoke_v3(
@@ -228,8 +210,6 @@ async def test_estimate_fee_deploy_account(client, deploy_account_transaction):
228210
assert estimate_fee.data_gas_consumed > 0
229211

230212

231-
# TODO (#1419): Fix contract redeclaration
232-
@pytest.mark.skip(reason="Redeclaration occurred")
233213
@pytest.mark.asyncio
234214
async def test_estimate_fee_for_multiple_transactions(
235215
client, deploy_account_transaction, contract_address, account
@@ -260,8 +240,6 @@ async def test_estimate_fee_for_multiple_transactions(
260240
assert estimated_fee.data_gas_consumed > 0
261241

262242

263-
# TODO (#1419): Fix contract redeclaration
264-
@pytest.mark.skip(reason="Redeclaration occurred")
265243
@pytest.mark.asyncio
266244
async def test_call_contract(client, contract_address):
267245
call = Call(
@@ -292,8 +270,6 @@ async def test_add_transaction(map_contract, client, account):
292270
assert transaction_receipt.type == TransactionType.INVOKE
293271

294272

295-
# TODO (#1419): Fix contract redeclaration
296-
@pytest.mark.skip(reason="Redeclaration occurred")
297273
@pytest.mark.asyncio
298274
async def test_get_class_hash_at(client, contract_address, class_hash):
299275
received_class_hash = await client.get_class_hash_at(
@@ -302,8 +278,6 @@ async def test_get_class_hash_at(client, contract_address, class_hash):
302278
assert received_class_hash == class_hash
303279

304280

305-
# TODO (#1419): Fix contract redeclaration
306-
@pytest.mark.skip(reason="Redeclaration occurred")
307281
@pytest.mark.asyncio
308282
async def test_get_class_by_hash(client, class_hash):
309283
contract_class = await client.get_class_by_hash(class_hash=class_hash)
@@ -501,8 +475,6 @@ async def test_state_update_storage_diffs(
501475
assert isinstance(state_update, BlockStateUpdate)
502476

503477

504-
# TODO (#1419): Fix contract redeclaration
505-
@pytest.mark.skip(reason="Redeclaration occurred")
506478
@pytest.mark.run_on_devnet
507479
@pytest.mark.asyncio
508480
async def test_state_update_deployed_contracts(

starknet_py/tests/e2e/client/full_node_test.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ def _parse_event_name(event: str) -> str:
4040
EVENT_TWO_PARSED_NAME = _parse_event_name("AnotherPutCalled")
4141

4242

43-
# TODO (#1419): Fix contract redeclaration
44-
@pytest.mark.skip(reason="Redeclaration occurred")
4543
@pytest.mark.run_on_devnet
4644
@pytest.mark.asyncio
4745
async def test_node_get_declare_transaction_by_block_number_and_index(
@@ -57,8 +55,6 @@ async def test_node_get_declare_transaction_by_block_number_and_index(
5755
assert tx.version == 2
5856

5957

60-
# TODO (#1419): Fix contract redeclaration
61-
@pytest.mark.skip(reason="Redeclaration occurred")
6258
@pytest.mark.run_on_devnet
6359
@pytest.mark.asyncio
6460
async def test_get_class_at(
@@ -496,8 +492,6 @@ async def test_simulate_transactions_invoke(account, deployed_balance_contract):
496492
assert simulated_txs[0].transaction_trace.execution_resources is not None
497493

498494

499-
# TODO (#1419): Fix contract redeclaration
500-
@pytest.mark.skip(reason="Redeclaration occurred")
501495
@pytest.mark.asyncio
502496
async def test_simulate_transactions_two_txs(account, deployed_balance_contract):
503497
assert isinstance(deployed_balance_contract, Contract)

starknet_py/tests/e2e/docs/code_examples/test_contract.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ async def test_from_address(account, contract_address):
5353
# docs-end: from_address
5454

5555

56-
# TODO (#1419): Fix contract redeclaration
57-
@pytest.mark.skip(reason="Redeclaration occurred")
5856
@pytest.mark.asyncio
5957
async def test_declare_v2(account):
6058
compiled_contract = load_contract(
@@ -66,7 +64,7 @@ async def test_declare_v2(account):
6664
account,
6765
compiled_contract=compiled_contract["sierra"],
6866
compiled_contract_casm=compiled_contract["casm"],
69-
max_fee=int(1e15),
67+
max_fee=int(1e18),
7068
)
7169
# docs-end: declare_v2
7270
await declare_result.wait_for_acceptance()

starknet_py/tests/e2e/docs/code_examples/test_full_node_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,6 @@ async def test_trace_transaction(client):
233233
# docs-end: trace_transaction
234234

235235

236-
# TODO (#1419): Fix contract redeclaration
237-
@pytest.mark.skip(reason="Redeclaration occurred")
238236
@pytest.mark.asyncio
239237
async def test_simulate_transactions(
240238
account, deployed_balance_contract, deploy_account_transaction

starknet_py/tests/e2e/docs/guide/test_declaring_contracts.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
import sys
2+
13
import pytest
24

35
from starknet_py.net.client_models import ResourceBounds
46

57

6-
# TODO (#1419): Fix contract redeclaration
7-
@pytest.mark.skip(reason="Redeclaration occurred")
8+
@pytest.mark.skipif(
9+
"--contract_dir=v2" not in sys.argv,
10+
reason="Contract exists only in v2 directory",
11+
)
812
@pytest.mark.asyncio
9-
async def test_declaring_contracts(account, map_compiled_contract_and_class_hash):
10-
(compiled_contract, class_hash) = map_compiled_contract_and_class_hash
13+
async def test_declaring_contracts(
14+
account, map_compiled_contract_and_class_hash_copy_1
15+
):
16+
(compiled_contract, class_hash) = map_compiled_contract_and_class_hash_copy_1
1117

1218
# docs: start
1319
# Account.sign_declare_v2 and Account.sign_declare_v3 take string containing a compiled contract (sierra)
@@ -18,7 +24,7 @@ async def test_declaring_contracts(account, map_compiled_contract_and_class_hash
1824
compiled_contract=compiled_contract,
1925
compiled_class_hash=class_hash,
2026
l1_resource_bounds=ResourceBounds(
21-
max_amount=5000, max_price_per_unit=int(1e12)
27+
max_amount=int(1e5), max_price_per_unit=int(1e13)
2228
),
2329
)
2430

starknet_py/tests/e2e/docs/guide/test_multicall.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import pytest
22

33

4-
# TODO (#1419): Fix contract redeclaration
5-
@pytest.mark.skip(reason="Redeclaration occurred")
64
@pytest.mark.asyncio
75
async def test_multicall(account, deployed_balance_contract):
86
# pylint: disable=import-outside-toplevel

starknet_py/tests/e2e/docs/guide/test_simple_declare_and_deploy_cairo1.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1+
import sys
2+
13
import pytest
24

35
from starknet_py.tests.e2e.fixtures.misc import load_contract
46

57

6-
# TODO (#1419): Fix contract redeclaration
7-
@pytest.mark.skip(reason="Redeclaration occurred")
8+
@pytest.mark.skipif(
9+
"--contract_dir=v2" not in sys.argv,
10+
reason="Contract exists only in v2 directory",
11+
)
812
@pytest.mark.asyncio
913
async def test_simple_declare_and_deploy(account):
1014
# pylint: disable=import-outside-toplevel
1115
# docs: start
1216
from starknet_py.contract import Contract
1317

1418
# docs: end
15-
compiled_contract = load_contract("Account")
19+
compiled_contract = load_contract("AccountCopy1")
1620
constructor_args = {"public_key": 0x123}
1721

1822
# docs: start

starknet_py/tests/e2e/docs/quickstart/test_using_account.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import os
2+
import sys
23

34
import pytest
45

56
directory = os.path.dirname(__file__)
67

78

8-
# TODO (#1419): Fix contract redeclaration
9-
@pytest.mark.skip(reason="Redeclaration occurred")
9+
@pytest.mark.skipif(
10+
"--contract_dir=v2" not in sys.argv,
11+
reason="Contract exists only in v2 directory",
12+
)
1013
@pytest.mark.asyncio
11-
async def test_using_account(account, map_compiled_contract_and_class_hash):
12-
(compiled_contract, class_hash) = map_compiled_contract_and_class_hash
14+
async def test_using_account(account, map_compiled_contract_and_class_hash_copy_2):
15+
(compiled_contract, class_hash) = map_compiled_contract_and_class_hash_copy_2
1316
# pylint: disable=import-outside-toplevel, duplicate-code, too-many-locals
1417
# docs: start
1518
from starknet_py.contract import Contract

starknet_py/tests/e2e/fixtures/contracts_v1.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,26 @@ def map_compiled_contract_and_class_hash() -> Tuple[str, int]:
240240
)
241241

242242

243+
@pytest.fixture(scope="package")
244+
def map_compiled_contract_and_class_hash_copy_1() -> Tuple[str, int]:
245+
contract = load_contract("MapCopy1")
246+
247+
return (
248+
contract["sierra"],
249+
compute_casm_class_hash(create_casm_class(contract["casm"])),
250+
)
251+
252+
253+
@pytest.fixture(scope="package")
254+
def map_compiled_contract_and_class_hash_copy_2() -> Tuple[str, int]:
255+
contract = load_contract("MapCopy2")
256+
257+
return (
258+
contract["sierra"],
259+
compute_casm_class_hash(create_casm_class(contract["casm"])),
260+
)
261+
262+
243263
@pytest.fixture(scope="package")
244264
def map_compiled_contract_casm() -> str:
245265
contract = load_contract("Map")

0 commit comments

Comments
 (0)