Skip to content

Commit

Permalink
fix: end2end testing on sepolia (#1468)
Browse files Browse the repository at this point in the history
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Give an estimate of the time you spent on this PR in terms of work
days.
Did you spend 0.5 days on this PR or rather 2 days?  -->

Time spent on this PR: 0.1 day

## Pull request type

<!-- Please try to limit your pull request to one type,
submit multiple pull requests if needed. -->

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.

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1468)
<!-- Reviewable:end -->
  • Loading branch information
greged93 authored Oct 7, 2024
1 parent 064a996 commit 038b3a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions kakarot_scripts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion kakarot_scripts/utils/kakarot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 038b3a3

Please sign in to comment.