Skip to content

Commit

Permalink
beefy_finalizing_after_pallet_genesis
Browse files Browse the repository at this point in the history
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
  • Loading branch information
turuslan committed Feb 26, 2024
1 parent ea6129e commit e7a3e5d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/core/consensus/beefy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,21 @@ TEST_F(Test, should_initialize_voter_at_custom_genesis) {

// TODO(turuslan): #1651, multiple beefy genesis
}

TEST_F(Test, beefy_finalizing_after_pallet_genesis) {
genesis_ = 15;
makePeers(2);
// push 42 blocks including `AuthorityChange` digests every 10 blocks.
generate_blocks_and_sync(42, 10);
// GRANDPA finalize blocks leading up to BEEFY pallet genesis -> BEEFY should
// finalize nothing.
finalize_block_and_wait_for_beefy(14, {});
// GRANDPA finalize block #16 -> BEEFY should finalize #15 (genesis mandatory)
// and #16.
finalize_block_and_wait_for_beefy(16, {15, 16});
// GRANDPA finalize #21 -> BEEFY finalize #20 (mandatory) and #21
finalize_block_and_wait_for_beefy(21, {20, 21});
}

// TODO(turuslan): #1651, report equivocation
// TEST_F(Test, beefy_reports_equivocations) {}

0 comments on commit e7a3e5d

Please sign in to comment.