From cfcdfff54acd25b09ddd368e4b8c60eb84c88825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Wed, 28 Aug 2019 16:22:48 +0200 Subject: [PATCH] Fix comments in j/f tests + add a readme for scaled image --- tests/spec_epoch_processing/README.md | 5 +++++ .../test_process_justification_and_finalization.nim | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 tests/spec_epoch_processing/README.md diff --git a/tests/spec_epoch_processing/README.md b/tests/spec_epoch_processing/README.md new file mode 100644 index 000000000..18d4ba99e --- /dev/null +++ b/tests/spec_epoch_processing/README.md @@ -0,0 +1,5 @@ +# Epoch state transition + +## Finalization and justification + +![](eth2-finalization.png) diff --git a/tests/spec_epoch_processing/test_process_justification_and_finalization.nim b/tests/spec_epoch_processing/test_process_justification_and_finalization.nim index 5135bc07e..511929e01 100644 --- a/tests/spec_epoch_processing/test_process_justification_and_finalization.nim +++ b/tests/spec_epoch_processing/test_process_justification_and_finalization.nim @@ -115,7 +115,7 @@ proc finalizeOn23(state: var BeaconState, epoch: Epoch, sufficient_support: bool doAssert state.finalized_checkpoint == old_finalized # no new finalized checkpoint proc finalizeOn123(state: var BeaconState, epoch: Epoch, sufficient_support: bool) = - ## Check finalization on rule 2 "23" + ## Check finalization on rule 3 "123" doAssert epoch > 5 state.slot = Slot((epoch * SLOTS_PER_EPOCH) - 1) # Skip ahead to just before epoch @@ -168,7 +168,7 @@ proc finalizeOn123(state: var BeaconState, epoch: Epoch, sufficient_support: boo doAssert state.finalized_checkpoint == old_finalized # no new finalized checkpoint proc finalizeOn12(state: var BeaconState, epoch: Epoch, sufficient_support: bool) = - ## Check finalization on rule 2 "23" + ## Check finalization on rule 4 "12" doAssert epoch > 2 state.slot = Slot((epoch * SLOTS_PER_EPOCH) - 1) # Skip ahead to just before epoch