Skip to content

Commit

Permalink
Fix state root being empty (0xSpaceShard#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabijanC committed Sep 12, 2022
1 parent d18ca72 commit 01f82ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion starknet_devnet/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

SUPPORTED_TX_VERSION = 0

DUMMY_STATE_ROOT = bytes()
DUMMY_STATE_ROOT = bytes(32)

DEFAULT_TIMEOUT = 60 # seconds
5 changes: 3 additions & 2 deletions test/test_state_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Test get_state_update endpoint
"""

import re

import pytest
import requests

from starkware.starknet.core.os.class_hash import compute_class_hash
from starkware.starknet.public.abi import get_selector_from_name

Expand Down Expand Up @@ -182,7 +183,7 @@ def test_roots():

new_root = state_update["new_root"]

assert new_root is not None
assert re.match(r"^[a-fA-F0-9]{64}$", new_root)
assert state_update["old_root"] is not None

# creates new block
Expand Down
1 change: 1 addition & 0 deletions test/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ def assert_block(latest_block_number, latest_tx_hash):
latest_block["sequencer_address"], hex(DEFAULT_GENERAL_CONFIG.sequencer_address)
)
assert_equal(latest_block["gas_price"], hex(DEFAULT_GENERAL_CONFIG.min_gas_price))
assert re.match(r"^[a-fA-F0-9]{64}$", latest_block["state_root"])


def assert_block_hash(latest_block_number, expected_block_hash):
Expand Down

0 comments on commit 01f82ad

Please sign in to comment.