diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 665eb4fbe..61fa8e974 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ jobs: id: cached-poetry uses: actions/cache@v3 with: - path: ~/.local # the path depends on the OS. - key: poetry # use new date to reset poetry cache + path: ~/.local + key: self-hosted-poetry - name: Install Poetry if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 @@ -62,8 +62,8 @@ jobs: id: cached-poetry uses: actions/cache@v3 with: - path: ~/.local # the path depends on the OS. - key: poetry # use new date to reset poetry cache + path: ~/.local + key: self-hosted-poetry - name: Install Poetry if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 @@ -107,8 +107,8 @@ jobs: id: cached-poetry uses: actions/cache@v3 with: - path: ~/.local # the path depends on the OS. - key: poetry # use new date to reset poetry cache + path: ~/.local + key: self-hosted-poetry - name: Install Poetry if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 diff --git a/.github/workflows/deployments.yml b/.github/workflows/deployments.yml index 063ec14e2..25ad6c392 100644 --- a/.github/workflows/deployments.yml +++ b/.github/workflows/deployments.yml @@ -20,8 +20,8 @@ jobs: id: cached-poetry uses: actions/cache@v3 with: - path: ~/.local # the path depends on the OS. - key: poetry # use new date to reset poetry cache + path: ~/.local + key: ubuntu-latest-poetry - name: Install Poetry if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 @@ -35,7 +35,8 @@ jobs: with: path: .venv key: - self-hosted-venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + ubuntu-latest-venv-${{ runner.os }}-${{ + hashFiles('**/poetry.lock')}} - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: make setup diff --git a/scripts/utils.py b/scripts/utils.py index b9eb25f43..862be17fa 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -121,12 +121,28 @@ async def get_account( ) -> AccountClient: address = int(address or ACCOUNT_ADDRESS, 16) key_pair = KeyPair.from_private_key(int(private_key or PRIVATE_KEY, 16)) - call = Call( - to_addr=address, - selector=get_selector_from_name("get_public_key"), - calldata=[], - ) - public_key = await GATEWAY_CLIENT.call_contract(call=call, block_hash="pending") + try: + call = Call( + to_addr=address, + selector=get_selector_from_name("get_public_key"), + calldata=[], + ) + public_key = await GATEWAY_CLIENT.call_contract(call=call, block_hash="pending") + except Exception as err: + if ( + json.loads(re.findall("{.*}", err.args[0], re.DOTALL)[0])["code"] + == "StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT" + ): + call = Call( + to_addr=address, + selector=get_selector_from_name("getPublicKey"), + calldata=[], + ) + public_key = await GATEWAY_CLIENT.call_contract( + call=call, block_hash="pending" + ) + else: + raise err if key_pair.public_key != public_key[0]: raise ValueError( f"Public key of account 0x{address:064x} is not consistent with provided private key" diff --git a/src/kakarot/library.cairo b/src/kakarot/library.cairo index 2566067e7..2af565d9b 100644 --- a/src/kakarot/library.cairo +++ b/src/kakarot/library.cairo @@ -25,7 +25,6 @@ from kakarot.constants import ( contract_account_class_hash, externally_owned_account_class_hash, blockhash_registry_address, - Constants, account_proxy_class_hash, ) from kakarot.accounts.library import Accounts diff --git a/tests/utils/helpers.py b/tests/utils/helpers.py index 7cf055645..90d7018ce 100644 --- a/tests/utils/helpers.py +++ b/tests/utils/helpers.py @@ -152,7 +152,7 @@ def ec_sign( def get_multicall_from_evm_txs( evm_txs: list, private_key: PrivateKey -) -> Tuple[list, str, list]: +) -> Tuple[list, bytes, list]: calls = [] calldata = b"" expected_result = []