From 038b3a3fa66cd1b8959665fed3e2eb7934e146b1 Mon Sep 17 00:00:00 2001 From: greged93 <82421016+greged93@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:10:55 +0200 Subject: [PATCH] fix: end2end testing on sepolia (#1468) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Time spent on this PR: 0.1 day ## Pull request type Please check the type of change your PR introduces: - [x] Bugfix - [ ] Feature - [ ] Code style update (formatting, renaming) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the new behavior? Fixes issues with the end 2 end testing of Kakarot on Sepolia Starknet. - - - This change is [Reviewable](https://reviewable.io/reviews/kkrt-labs/kakarot/1468) --- kakarot_scripts/constants.py | 9 ++------- kakarot_scripts/utils/kakarot.py | 2 +- tests/utils/errors.py | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/kakarot_scripts/constants.py b/kakarot_scripts/constants.py index 87e3bc11c..61dfa7029 100644 --- a/kakarot_scripts/constants.py +++ b/kakarot_scripts/constants.py @@ -51,7 +51,7 @@ class NetworkType(Enum): "type": NetworkType.STAGING, "chain_id": StarknetChainId.SEPOLIA, "check_interval": 1, - "max_wait": 10, + "max_wait": 20, "class_hash": 0x061DAC032F228ABEF9C6626F995015233097AE253A7F72D68552DB02F2971B8F, "voyager_api_url": "https://sepolia-api.voyager.online/beta", }, @@ -202,12 +202,7 @@ class NetworkType(Enum): f"⚠️ Could not get chain Id from {NETWORK['rpc_url']}: {e}, defaulting to KKRT" ) starknet_chain_id = int.from_bytes(b"KKRT", "big") - chain_id = starknet_chain_id % ( - # TODO: remove once Kakarot is redeployed on sepolia - 2**53 - if NETWORK["name"] != "starknet-sepolia" - else 2**32 - ) + chain_id = starknet_chain_id % 2**53 class ChainId(IntEnum): diff --git a/kakarot_scripts/utils/kakarot.py b/kakarot_scripts/utils/kakarot.py index 1d53cca8b..a3f9ebcdc 100644 --- a/kakarot_scripts/utils/kakarot.py +++ b/kakarot_scripts/utils/kakarot.py @@ -270,7 +270,7 @@ async def deploy( evm_address = int(receipt.contractAddress or receipt.to, 16) starknet_address = ( await _call_starknet("kakarot", "get_starknet_address", evm_address) - ).contract_address + ).starknet_address else: starknet_address, evm_address = response contract.address = Web3.to_checksum_address(f"0x{evm_address:040x}") diff --git a/tests/utils/errors.py b/tests/utils/errors.py index 86a2c65aa..bcfb58a72 100644 --- a/tests/utils/errors.py +++ b/tests/utils/errors.py @@ -34,7 +34,7 @@ def cairo_error(message=None): yield e if message is None: return - if type(e.value) == ClientError: + if e.value is ClientError: error = re.search(r"Error message: (.*)", str(e.value.data["revert_error"])) else: error = re.search(r"Error message: (.*)", str(e.value))