Update 0_beacon-chain.md

* Avoid abbreviations
* Use `branch` as a more suggestive variable name than `ret`
* Cleanup spacing after comma
* Avoid having two index variables (`index` and `idx`)—Does this break anything?
This commit is contained in:
Justin 2019-01-11 11:52:04 +00:00 committed by GitHub
parent 78fcda7ce0
commit dd532d7887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -695,12 +695,12 @@ def get_deposit_root() -> bytes32:
@public
@constant
def get_merkle_branch(index: uint256) -> bytes32[32]: # size is DEPOSIT_CONTRACT_TREE_DEPTH (symbolic const not supported)
idx: uint256 = index + TWO_TO_POWER_OF_TREE_DEPTH
ret: bytes32[32] # size is DEPOSIT_CONTRACT_TREE_DEPTH
index = index + TWO_TO_POWER_OF_TREE_DEPTH
branch: bytes32[32] # size is DEPOSIT_CONTRACT_TREE_DEPTH
for i in range(DEPOSIT_CONTRACT_TREE_DEPTH):
ret[i] = self.deposit_tree[bitwise_xor(idx,1)]
idx /= 2
return ret
branch[i] = self.deposit_tree[bitwise_xor(index, 1)]
index /= 2
return branch
```
## Beacon chain processing