Update 0_beacon-chain.md

This commit is contained in:
Justin 2019-01-11 16:23:10 +00:00 committed by GitHub
parent 7a0d45279c
commit 271e7b5cb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -694,9 +694,9 @@ def get_deposit_root() -> bytes32:
@public
@constant
def get_merkle_branch(deposit_count: uint256) -> bytes32[32]: # size is DEPOSIT_CONTRACT_TREE_DEPTH (symbolic const not supported)
def get_branch(leaf: uint256) -> bytes32[32]: # size is DEPOSIT_CONTRACT_TREE_DEPTH (symbolic const not supported)
branch: bytes32[32] # size is DEPOSIT_CONTRACT_TREE_DEPTH
index: uint256 = deposit_count + TWO_TO_POWER_OF_TREE_DEPTH
index: uint256 = leaf + TWO_TO_POWER_OF_TREE_DEPTH
for i in range(DEPOSIT_CONTRACT_TREE_DEPTH):
branch[i] = self.deposit_tree[bitwise_xor(index, 1)]
index /= 2