Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Mar 7, 2019
1 parent 3f9f8a6 commit d884d9b
Show file tree
Hide file tree
Showing 3 changed files with 567 additions and 542 deletions.
7 changes: 4 additions & 3 deletions spec_pythonizer/sanity_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
advance_slot,
process_block,
state_transition,
store_state_root,
verify_merkle_branch,
)
from utils.merkle_normal import (
Expand Down Expand Up @@ -168,6 +169,7 @@ def build_attestation_data(state, slot, shard):

def test_slot_transition(state):
test_state = deepcopy(state)
store_state_root(test_state)
advance_slot(test_state)
assert test_state.slot == state.slot + 1
assert get_state_root(test_state, state.slot) == state.hash_tree_root()
Expand All @@ -177,9 +179,8 @@ def test_slot_transition(state):
def test_empty_block_transition(state):
test_state = deepcopy(state)

block = construct_empty_block_for_next_slot(state)
advance_slot(test_state)
process_block(test_state, block)
block = construct_empty_block_for_next_slot(test_state)
state_transition(test_state, block)

assert len(test_state.eth1_data_votes) == len(state.eth1_data_votes) + 1
assert get_block_root(test_state, state.slot) == block.previous_block_root
Expand Down
Loading

0 comments on commit d884d9b

Please sign in to comment.