Simplify deposits

This commit is contained in:
Justin 2019-05-25 00:35:17 +03:00 committed by GitHub
parent b0a3b436e3
commit d805fb5084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -471,8 +471,6 @@ The types are defined topologically to aid in facilitating an executable version
{ {
# Branch in the deposit tree # Branch in the deposit tree
'proof': ['bytes32', DEPOSIT_CONTRACT_TREE_DEPTH], 'proof': ['bytes32', DEPOSIT_CONTRACT_TREE_DEPTH],
# Index in the deposit tree
'index': 'uint64',
# Data # Data
'data': DepositData, 'data': DepositData,
} }
@ -1763,12 +1761,11 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None:
leaf=hash_tree_root(deposit.data), leaf=hash_tree_root(deposit.data),
proof=deposit.proof, proof=deposit.proof,
depth=DEPOSIT_CONTRACT_TREE_DEPTH, depth=DEPOSIT_CONTRACT_TREE_DEPTH,
index=deposit.index, index=state.deposit_index,
root=state.latest_eth1_data.deposit_root, root=state.latest_eth1_data.deposit_root,
) )
# Deposits must be processed in order # Deposits must be processed in order
assert deposit.index == state.deposit_index
state.deposit_index += 1 state.deposit_index += 1
pubkey = deposit.data.pubkey pubkey = deposit.data.pubkey