parent
44d2f44993
commit
8c12896fa0
|
@ -955,9 +955,12 @@ def get_beacon_proposer_index(state: BeaconState,
|
|||
|
||||
```python
|
||||
def merkle_root(values):
|
||||
"""
|
||||
Merkleize ``values`` (where ``len(values)`` is a power of two) and return the Merkle root.
|
||||
"""
|
||||
o = [0] * len(values) + values
|
||||
for i in range(len(values)-1, 0, -1):
|
||||
o[i] = hash(o[i*2] + o[i*2+1])
|
||||
for i in range(len(values) - 1, 0, -1):
|
||||
o[i] = hash(o[i * 2] + o[i * 2 + 1])
|
||||
return o[1]
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue