|
1 | 1 | from sys import platform |
| 2 | +from unittest.mock import MagicMock, Mock |
2 | 3 |
|
3 | 4 | import pytest |
4 | 5 |
|
5 | | -from starknet_py.common import create_sierra_compiled_contract |
6 | 6 | from starknet_py.constants import EIP_2645_PATH_LENGTH |
7 | 7 | from starknet_py.contract import Contract |
8 | 8 | from starknet_py.hash.address import compute_address |
9 | 9 | from starknet_py.hash.selector import get_selector_from_name |
10 | 10 | from starknet_py.net.account.account import Account |
11 | 11 | from starknet_py.net.client_models import Call |
12 | 12 | from starknet_py.net.full_node_client import FullNodeClient |
13 | | -from starknet_py.net.models import DeclareV3, DeployAccountV1, InvokeV1, StarknetChainId |
| 13 | +from starknet_py.net.models import DeclareV3, DeployAccountV3, InvokeV3, StarknetChainId |
14 | 14 | from starknet_py.net.signer.ledger_signer import LedgerSigner |
15 | 15 | from starknet_py.tests.e2e.fixtures.accounts import mint_token_on_devnet |
16 | | -from starknet_py.tests.e2e.fixtures.constants import ( |
17 | | - MAX_RESOURCE_BOUNDS, |
18 | | - STRK_FEE_CONTRACT_ADDRESS, |
19 | | -) |
20 | | -from starknet_py.tests.e2e.fixtures.misc import load_contract |
| 16 | +from starknet_py.tests.e2e.fixtures.constants import STRK_FEE_CONTRACT_ADDRESS |
21 | 17 |
|
22 | 18 |
|
23 | 19 | # TODO (#1425): Currently Ledger tests are skipped on Windows due to different Speculos setup. |
@@ -46,39 +42,12 @@ def test_init_with_invalid_derivation_path(): |
46 | 42 | ) |
47 | 43 |
|
48 | 44 |
|
49 | | -compiled_contract = load_contract("HelloStarknet")["sierra"] |
50 | | -sierra_contract_class = create_sierra_compiled_contract(compiled_contract) |
51 | | - |
52 | | - |
53 | 45 | @pytest.mark.parametrize( |
54 | 46 | "transaction", |
55 | 47 | [ |
56 | | - InvokeV1( |
57 | | - sender_address=0x1, |
58 | | - calldata=[1, 2, 3], |
59 | | - max_fee=10000, |
60 | | - signature=[], |
61 | | - nonce=23, |
62 | | - version=1, |
63 | | - ), |
64 | | - DeployAccountV1( |
65 | | - class_hash=0x1, |
66 | | - contract_address_salt=0x2, |
67 | | - constructor_calldata=[1, 2, 3, 4], |
68 | | - max_fee=10000, |
69 | | - signature=[], |
70 | | - nonce=23, |
71 | | - version=1, |
72 | | - ), |
73 | | - DeclareV3( |
74 | | - contract_class=sierra_contract_class.convert_to_sierra_contract_class(), |
75 | | - compiled_class_hash=0x1, |
76 | | - sender_address=0x123, |
77 | | - signature=[], |
78 | | - nonce=4, |
79 | | - version=3, |
80 | | - resource_bounds=MAX_RESOURCE_BOUNDS, |
81 | | - ), |
| 48 | + Mock(spec=InvokeV3, calculate_hash=MagicMock(return_value=111)), |
| 49 | + Mock(spec=DeployAccountV3, calculate_hash=MagicMock(return_value=222)), |
| 50 | + Mock(spec=DeclareV3, calculate_hash=MagicMock(return_value=333)), |
82 | 51 | ], |
83 | 52 | ) |
84 | 53 | # TODO (#1425): Currently Ledger tests are skipped on Windows due to different Speculos setup. |
|
0 commit comments