From fb165dc14e11cafb273f96f8e75352cc73df73da Mon Sep 17 00:00:00 2001 From: protolambda Date: Sat, 29 Jun 2019 20:33:11 +0200 Subject: [PATCH] fixes a few tests, not all --- test_libs/pyspec/eth2spec/test/helpers/deposits.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_libs/pyspec/eth2spec/test/helpers/deposits.py b/test_libs/pyspec/eth2spec/test/helpers/deposits.py index 7f5975dd4..99c39211e 100644 --- a/test_libs/pyspec/eth2spec/test/helpers/deposits.py +++ b/test_libs/pyspec/eth2spec/test/helpers/deposits.py @@ -43,14 +43,14 @@ def build_deposit(spec, withdrawal_credentials, signed): deposit_data = build_deposit_data(spec, pubkey, privkey, amount, withdrawal_credentials, state=state, signed=signed) - deposit_data_list.append(deposit_data) index = len(deposit_data_list) + deposit_data_list.append(deposit_data) root = hash_tree_root(List[spec.DepositData, 2**spec.DEPOSIT_CONTRACT_TREE_DEPTH](*deposit_data_list)) tree = calc_merkle_tree_from_leaves(tuple([d.hash_tree_root() for d in deposit_data_list])) - proof = list(get_merkle_proof(tree, item_index=index)) + [index.to_bytes(32, 'little')] + proof = list(get_merkle_proof(tree, item_index=index)) + [(index + 1).to_bytes(32, 'little')] leaf = deposit_data.hash_tree_root() assert spec.verify_merkle_branch(leaf, proof, spec.DEPOSIT_CONTRACT_TREE_DEPTH + 1, index, root) - deposit = spec.Deposit(proof, index, deposit_data) + deposit = spec.Deposit(proof=proof, data=deposit_data) return deposit, root, deposit_data_list