|
1 | | -import pytest |
| 1 | +# import pytest |
2 | 2 |
|
3 | | -from starknet_py.net.account.account import Account |
4 | | -from starknet_py.net.client_models import TransactionFinalityStatus |
| 3 | +# from starknet_py.net.account.account import Account |
| 4 | +# from starknet_py.net.client_models import TransactionFinalityStatus |
5 | 5 |
|
6 | 6 |
|
7 | | -@pytest.mark.asyncio |
8 | | -async def test_account_outside_execution_any_caller( |
9 | | - client, |
10 | | - argent_account_class_hash, |
11 | | - deployed_balance_contract, |
12 | | - deploy_account_details_factory, |
13 | | -): |
14 | | - # pylint: disable=import-outside-toplevel,too-many-locals |
15 | | - address, key_pair, salt, class_hash = await deploy_account_details_factory.get( |
16 | | - class_hash=argent_account_class_hash, argent_calldata=True |
17 | | - ) |
| 7 | +# @pytest.mark.asyncio |
| 8 | +# async def test_account_outside_execution_any_caller( |
| 9 | +# client, |
| 10 | +# argent_account_class_hash, |
| 11 | +# deployed_balance_contract, |
| 12 | +# deploy_account_details_factory, |
| 13 | +# ): |
| 14 | +# # pylint: disable=import-outside-toplevel,too-many-locals |
| 15 | +# address, key_pair, salt, class_hash = await deploy_account_details_factory.get( |
| 16 | +# class_hash=argent_account_class_hash, argent_calldata=True |
| 17 | +# ) |
18 | 18 |
|
19 | | - deploy_result = await Account.deploy_account_v1( |
20 | | - address=address, |
21 | | - class_hash=class_hash, |
22 | | - salt=salt, |
23 | | - key_pair=key_pair, |
24 | | - client=client, |
25 | | - constructor_calldata=[key_pair.public_key, 0], |
26 | | - max_fee=int(1e18), |
27 | | - ) |
28 | | - await deploy_result.wait_for_acceptance() |
29 | | - account = deploy_result.account |
| 19 | +# deploy_result = await Account.deploy_account_v1( |
| 20 | +# address=address, |
| 21 | +# class_hash=class_hash, |
| 22 | +# salt=salt, |
| 23 | +# key_pair=key_pair, |
| 24 | +# client=client, |
| 25 | +# constructor_calldata=[key_pair.public_key, 0], |
| 26 | +# max_fee=int(1e18), |
| 27 | +# ) |
| 28 | +# await deploy_result.wait_for_acceptance() |
| 29 | +# account = deploy_result.account |
30 | 30 |
|
31 | | - # docs: start |
32 | | - import datetime |
| 31 | +# # docs: start |
| 32 | +# import datetime |
33 | 33 |
|
34 | | - from starknet_py.constants import ANY_CALLER |
35 | | - from starknet_py.hash.selector import get_selector_from_name |
36 | | - from starknet_py.net.client_models import Call, ExecutionTimeBounds |
| 34 | +# from starknet_py.constants import ANY_CALLER |
| 35 | +# from starknet_py.hash.selector import get_selector_from_name |
| 36 | +# from starknet_py.net.client_models import Call, ExecutionTimeBounds |
37 | 37 |
|
38 | | - # Create a call to increase the balance by 100. That will be executed |
39 | | - # as part of external execution |
| 38 | +# # Create a call to increase the balance by 100. That will be executed |
| 39 | +# # as part of external execution |
40 | 40 |
|
41 | | - increase_balance_call = Call( |
42 | | - to_addr=deployed_balance_contract.address, |
43 | | - selector=get_selector_from_name("increase_balance"), |
44 | | - calldata=[0], |
45 | | - ) |
| 41 | +# increase_balance_call = Call( |
| 42 | +# to_addr=deployed_balance_contract.address, |
| 43 | +# selector=get_selector_from_name("increase_balance"), |
| 44 | +# calldata=[0], |
| 45 | +# ) |
46 | 46 |
|
47 | | - # Create a special signed execution call. This call can now be executed by |
48 | | - # the caller specified. In this case, caller is ANY_CALLER, a special constant |
49 | | - # that allows any caller to execute the call. |
50 | | - call = await account.sign_outside_execution_call( |
51 | | - calls=[ |
52 | | - increase_balance_call, |
53 | | - ], |
54 | | - execution_time_bounds=ExecutionTimeBounds( |
55 | | - execute_after=datetime.datetime.now() - datetime.timedelta(hours=1), |
56 | | - execute_before=datetime.datetime.now() + datetime.timedelta(hours=1), |
57 | | - ), |
58 | | - caller=ANY_CALLER, |
59 | | - ) |
| 47 | +# # Create a special signed execution call. This call can now be executed by |
| 48 | +# # the caller specified. In this case, caller is ANY_CALLER, a special constant |
| 49 | +# # that allows any caller to execute the call. |
| 50 | +# call = await account.sign_outside_execution_call( |
| 51 | +# calls=[ |
| 52 | +# increase_balance_call, |
| 53 | +# ], |
| 54 | +# execution_time_bounds=ExecutionTimeBounds( |
| 55 | +# execute_after=datetime.datetime.now() - datetime.timedelta(hours=1), |
| 56 | +# execute_before=datetime.datetime.now() + datetime.timedelta(hours=1), |
| 57 | +# ), |
| 58 | +# caller=ANY_CALLER, |
| 59 | +# ) |
60 | 60 |
|
61 | | - # Execute the call as a normal invoke transaction |
62 | | - tx = await account.execute_v1(calls=[call], max_fee=int(1e18)) |
63 | | - await account.client.wait_for_tx(tx.transaction_hash) |
| 61 | +# # Execute the call as a normal invoke transaction |
| 62 | +# tx = await account.execute_v1(calls=[call], max_fee=int(1e18)) |
| 63 | +# await account.client.wait_for_tx(tx.transaction_hash) |
64 | 64 |
|
65 | | - # docs: end |
| 65 | +# # docs: end |
66 | 66 |
|
67 | | - receipt = await account.client.get_transaction_receipt(tx_hash=tx.transaction_hash) |
| 67 | +# receipt = await account.client.get_transaction_receipt(tx_hash=tx.transaction_hash) |
68 | 68 |
|
69 | | - assert receipt.finality_status == TransactionFinalityStatus.ACCEPTED_ON_L2 |
| 69 | +# assert receipt.finality_status == TransactionFinalityStatus.ACCEPTED_ON_L2 |
0 commit comments