public void Should_fill_beacon_block_metadata_when_not_moved_to_main_chain()
 {
     BlockTreeTestScenario.GoesLikeThis()
     .WithBlockTrees(4, 10, false)
     .InsertBeaconPivot(7)
     .InsertHeaders(4, 6)
     .InsertBeaconBlocks(8, 9)
     .SuggestBlocksUsingChainLevels()
     .AssertMetadata(0, 9, BlockMetadata.None);
 }
 public void Should_set_correct_metadata_after_suggest_blocks_using_chain_levels()
 {
     BlockTreeTestScenario.GoesLikeThis()
     .WithBlockTrees(4, 10)
     .InsertBeaconPivot(7)
     .InsertHeaders(4, 6)
     .InsertBeaconBlocks(8, 9)
     .SuggestBlocksUsingChainLevels()
     .AssertMetadata(0, 9, BlockMetadata.None);
 }
 public void Should_set_correct_metadata()
 {
     BlockTreeTestScenario.GoesLikeThis()
     .WithBlockTrees(4, 10)
     .InsertBeaconPivot(7)
     .InsertHeaders(4, 6)
     .InsertBeaconBlocks(8, 9)
     .AssertMetadata(0, 4, BlockMetadata.None)
     .AssertMetadata(5, 6, BlockMetadata.BeaconHeader | BlockMetadata.BeaconMainChain)
     .AssertMetadata(7, 9, BlockMetadata.BeaconBody | BlockMetadata.BeaconHeader | BlockMetadata.BeaconMainChain);
 }
 public void Can_sync_using_chain_levels()
 {
     BlockTreeTestScenario.GoesLikeThis()
     .WithBlockTrees(4, 10)
     .InsertBeaconPivot(7)
     .InsertHeaders(4, 6)
     .InsertBeaconBlocks(8, 9)
     .SuggestBlocksUsingChainLevels()
     .AssertBestKnownNumber(9)
     .AssertBestSuggestedHeader(9)
     .AssertBestSuggestedBody(9);
 }
 public void Correct_levels_with_chain_fork()
 {
     BlockTreeTestScenario.GoesLikeThis()
     .WithBlockTrees(4, 10)
     .InsertBeaconPivot(7)
     .InsertHeaders(4, 6)
     .InsertBeaconBlocks(8, 9)
     .InsertFork(1, 9)
     .AssertBestSuggestedBody(3)
     .SuggestBlocksUsingChainLevels()
     .AssertBestSuggestedBody(9)
     .AssertChainLevel(0, 9);
 }
 public void Correct_levels_after_chain_level_sync_with_zero_td()
 {
     BlockTreeTestScenario.GoesLikeThis()
     .WithBlockTrees(4, 10)
     .InsertBeaconPivot(7)
     .InsertHeaders(4, 6, BlockTreeTestScenario.ScenarioBuilder.TotalDifficultyMode.Zero)
     .InsertBeaconBlocks(8, 9, BlockTreeTestScenario.ScenarioBuilder.TotalDifficultyMode.Zero)
     .SuggestBlocksUsingChainLevels()
     .AssertBestKnownNumber(9)
     .AssertBestSuggestedHeader(9)
     .AssertBestSuggestedBody(9, 10000000)
     .AssertChainLevel(0, 9);
 }