Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
new ssz tools importing
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed May 7, 2019
1 parent ccd1163 commit 3f34749
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/eth2/beacon/state-fixtures/test_minimal_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import pytest

from py_ecc import bls
import ssz
from ssz.tools import (
from_formatted_dict,
to_formatted_dict,
)

from eth2.configs import (
Eth2Config,
Expand Down Expand Up @@ -110,12 +113,12 @@ def execute_state_transtion(test_case, base_db):
override_vector_length(config)

# Set pre_state
pre_state = ssz.tools.from_formatted_dict(dict_initial_state, BeaconState)
pre_state = from_formatted_dict(dict_initial_state, BeaconState)

# Set blocks
blocks = ()
for dict_block in dict_blocks:
block = ssz.tools.from_formatted_dict(dict_block, SerenityBeaconBlock)
block = from_formatted_dict(dict_block, SerenityBeaconBlock)
blocks += (block,)

sm_class = SerenityStateMachine.configure(
Expand All @@ -130,7 +133,7 @@ def execute_state_transtion(test_case, base_db):
post_state, _ = sm.import_block(block)

# Use dict diff, easier to see the diff
dict_post_state = ssz.tools.to_formatted_dict(post_state, BeaconState)
dict_post_state = to_formatted_dict(post_state, BeaconState)

for key, value in dict_expected_state.items():
if isinstance(value, list):
Expand Down

0 comments on commit 3f34749

Please sign in to comment.