From 6146f01400e5b54c025829da12423054ee191311 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Fri, 15 Jul 2022 12:03:09 +0200 Subject: [PATCH] Flip order of `assert` and assignment Co-authored-by: Hsiao-Wei Wang --- specs/altair/sync-protocol.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/altair/sync-protocol.md b/specs/altair/sync-protocol.md index 1fe375012..c8697d13c 100644 --- a/specs/altair/sync-protocol.md +++ b/specs/altair/sync-protocol.md @@ -319,8 +319,8 @@ def validate_light_client_update(store: LightClientStore, assert update.finalized_header == BeaconBlockHeader() else: if update.finalized_header.slot == GENESIS_SLOT: - finalized_root = Bytes32() assert update.finalized_header == BeaconBlockHeader() + finalized_root = Bytes32() else: finalized_root = hash_tree_root(update.finalized_header) assert is_valid_merkle_branch( @@ -508,8 +508,8 @@ def create_light_client_update(state: BeaconState, ) assert hash_tree_root(finalized_header) == attested_state.finalized_checkpoint.root else: - finalized_header = BeaconBlockHeader() assert attested_state.finalized_checkpoint.root == Bytes32() + finalized_header = BeaconBlockHeader() finality_branch = compute_merkle_proof_for_state(attested_state, FINALIZED_ROOT_INDEX) else: finalized_header = BeaconBlockHeader()