Skip to content

Commit

Permalink
add coinbase to network config
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Sep 24, 2024
1 parent 8917724 commit e257a0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions kakarot_scripts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ class ChainId(IntEnum):
or "0x20eB005C0b9c906691F885eca5895338E15c36De", # Defaults to faucet on appchain sepolia
16,
)

NETWORK["coinbase"] = COINBASE

CAIRO_ZERO_DIR = Path("src")
CAIRO_DIR = Path("cairo1_contracts")
TESTS_DIR = Path("tests")
Expand Down
2 changes: 2 additions & 0 deletions kakarot_scripts/deploy_kakarot.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ async def main():
await invoke("kakarot", "set_coinbase", int(bridge.address, 16))

coinbase = (await call("kakarot", "get_coinbase")).coinbase
# Set the coinbase in the network config to be used in the tests
NETWORK["coinbase"] = coinbase

if coinbase == 0:
logger.error("❌ Coinbase is set to 0, all transaction fees will be lost")
Expand Down
4 changes: 2 additions & 2 deletions tests/end_to_end/bytecodes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from kakarot_scripts.constants import BLOCK_GAS_LIMIT, COINBASE, NETWORK
from kakarot_scripts.constants import BLOCK_GAS_LIMIT, NETWORK

test_cases = [
{
Expand Down Expand Up @@ -749,7 +749,7 @@
"value": 0,
"code": "4100",
"calldata": "",
"stack": f"{COINBASE}",
"stack": f"{NETWORK['coinbase']}",
"memory": "",
"return_data": "",
"success": 1,
Expand Down

0 comments on commit e257a0e

Please sign in to comment.