Update 0_beacon-chain.md
This commit is contained in:
parent
7a0d45279c
commit
271e7b5cb8
|
@ -694,9 +694,9 @@ def get_deposit_root() -> bytes32:
|
||||||
|
|
||||||
@public
|
@public
|
||||||
@constant
|
@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
|
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):
|
for i in range(DEPOSIT_CONTRACT_TREE_DEPTH):
|
||||||
branch[i] = self.deposit_tree[bitwise_xor(index, 1)]
|
branch[i] = self.deposit_tree[bitwise_xor(index, 1)]
|
||||||
index /= 2
|
index /= 2
|
||||||
|
|
Loading…
Reference in New Issue