Adjust tests

This commit is contained in:
Hsiao-Wei Wang 2019-04-15 08:29:08 +10:00
parent b6b82ae494
commit 084919e063
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ def create_mock_genesis_validator_deposits(num_validators, deposit_data_leaves=N
amount=spec.MAX_DEPOSIT_AMOUNT,
proof_of_possession=proof_of_possession,
)
item = hash(deposit_data.serialize())
item = deposit_data.hash_tree_root()
deposit_data_leaves.append(item)
tree = calc_merkle_tree_from_leaves(tuple(deposit_data_leaves))
root = get_merkle_root((tuple(deposit_data_leaves)))
@ -180,7 +180,7 @@ def build_deposit(state,
amount):
deposit_data = build_deposit_data(state, pubkey, privkey, amount)
item = hash(deposit_data.serialize())
item = deposit_data.hash_tree_root()
index = len(deposit_data_leaves)
deposit_data_leaves.append(item)
tree = calc_merkle_tree_from_leaves(tuple(deposit_data_leaves))

View File

@ -179,7 +179,7 @@ def test_deposit_in_block(state):
privkey = privkeys[index]
deposit_data = build_deposit_data(pre_state, pubkey, privkey, spec.MAX_DEPOSIT_AMOUNT)
item = hash(deposit_data.serialize())
item = deposit_data.hash_tree_root()
test_deposit_data_leaves.append(item)
tree = calc_merkle_tree_from_leaves(tuple(test_deposit_data_leaves))
root = get_merkle_root((tuple(test_deposit_data_leaves)))
@ -218,7 +218,7 @@ def test_deposit_top_up(state):
deposit_data = build_deposit_data(pre_state, pubkey, privkey, amount)
merkle_index = len(test_deposit_data_leaves)
item = hash(deposit_data.serialize())
item = deposit_data.hash_tree_root()
test_deposit_data_leaves.append(item)
tree = calc_merkle_tree_from_leaves(tuple(test_deposit_data_leaves))
root = get_merkle_root((tuple(test_deposit_data_leaves)))