|
23 | 23 | from starknet_py.common import create_compiled_contract, create_sierra_compiled_contract |
24 | 24 | from starknet_py.constants import DEFAULT_DEPLOYER_ADDRESS |
25 | 25 | from starknet_py.contract_utils import _extract_compiled_class_hash, _unpack_provider |
26 | | -from starknet_py.hash.address import compute_address |
27 | | -from starknet_py.hash.class_hash import compute_class_hash |
28 | 26 | from starknet_py.hash.selector import get_selector_from_name |
29 | 27 | from starknet_py.net.account.base_account import BaseAccount |
30 | 28 | from starknet_py.net.client import Client |
|
43 | 41 | serializer_for_function, |
44 | 42 | ) |
45 | 43 | from starknet_py.serialization.factory import serializer_for_function_v1 |
46 | | -from starknet_py.utils.constructor_args_translator import ( |
47 | | - _is_abi_v2, |
48 | | - translate_constructor_args, |
49 | | -) |
| 44 | +from starknet_py.utils.constructor_args_translator import _is_abi_v2 |
50 | 45 | from starknet_py.utils.sync import add_sync_methods |
51 | 46 |
|
52 | 47 | # pylint: disable=too-many-lines |
@@ -1059,48 +1054,6 @@ async def deploy_contract_v3( |
1059 | 1054 |
|
1060 | 1055 | return deploy_result |
1061 | 1056 |
|
1062 | | - @staticmethod |
1063 | | - def compute_address( |
1064 | | - salt: int, |
1065 | | - compiled_contract: str, |
1066 | | - constructor_args: Optional[Union[List, Dict]] = None, |
1067 | | - deployer_address: int = 0, |
1068 | | - ) -> int: |
1069 | | - """ |
1070 | | - Computes address for given Cairo 0 contract. |
1071 | | -
|
1072 | | - :param salt: int |
1073 | | - :param compiled_contract: String containing compiled Cairo 0 contract. |
1074 | | - :param constructor_args: A ``list`` or ``dict`` of arguments for the constructor. |
1075 | | - :param deployer_address: Address of the deployer (if not provided default 0 is used). |
1076 | | -
|
1077 | | - :return: Contract's address. |
1078 | | - """ |
1079 | | - |
1080 | | - compiled = create_compiled_contract(compiled_contract) |
1081 | | - assert compiled.abi is not None |
1082 | | - translated_args = translate_constructor_args( |
1083 | | - compiled.abi, constructor_args, cairo_version=0 |
1084 | | - ) |
1085 | | - return compute_address( |
1086 | | - salt=salt, |
1087 | | - class_hash=compute_class_hash(compiled), |
1088 | | - constructor_calldata=translated_args, |
1089 | | - deployer_address=deployer_address, |
1090 | | - ) |
1091 | | - |
1092 | | - @staticmethod |
1093 | | - def compute_contract_hash(compiled_contract: str) -> int: |
1094 | | - """ |
1095 | | - Computes hash for given contract. |
1096 | | -
|
1097 | | - :param compiled_contract: String containing compiled contract. |
1098 | | - :return: Class_hash of the contract. |
1099 | | - """ |
1100 | | - |
1101 | | - contract_class = create_compiled_contract(compiled_contract) |
1102 | | - return compute_class_hash(contract_class) |
1103 | | - |
1104 | 1057 | @classmethod |
1105 | 1058 | def _make_functions( |
1106 | 1059 | cls, |
|
0 commit comments