From 77df87c0ba41a788cd429b8dae628eca3c5a0371 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Mon, 2 Sep 2019 16:45:27 +1000 Subject: [PATCH] Update README.md Specifies how `voting_period` should be serialized before hashing. `int_to_bytes` is not technically defined in this scope but that seems consistent. Also, not sure if `deposit_root=deposit_root,` can be simplified to `deposit_root`? --- interop/mocked_eth1data/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interop/mocked_eth1data/README.md b/interop/mocked_eth1data/README.md index d6c910a..edb6b9a 100644 --- a/interop/mocked_eth1data/README.md +++ b/interop/mocked_eth1data/README.md @@ -14,8 +14,9 @@ This has validators agreeing upon a stubbed `deposit_root` and `block_hash` but def get_eth1data_stub(state: BeaconState, current_epoch: Epoch) -> Eth1Data: epochs_per_period = SLOTS_PER_ETH1_VOTING_PERIOD // SLOTS_PER_EPOCH voting_period = current_epoch // epochs_per_period + deposit_root = hash(int_to_bytes(voting_period, length=32)) return Eth1Data( - deposit_root=hash(voting_period), + deposit_root=deposit_root, deposit_count=state.eth1_deposit_index, - block_hash=hash(hash(voting_period)), + block_hash=hash(deposit_root), )