Skip to content

Commit 3f446a7

Browse files
authored
Merge pull request #2159 from AleoHQ/fix/verify-authority-check
[TOB] Remove unreachable check in `verify_authority`
2 parents 7f3ab68 + 43ad690 commit 3f446a7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ledger/block/src/verify.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,11 @@ impl<N: Network> Block<N> {
137137
previous_height: u32,
138138
current_committee: &Committee<N>,
139139
) -> Result<(u64, u32, i64)> {
140+
#[cfg(not(any(test, feature = "test")))]
141+
ensure!(self.authority.is_quorum(), "The next block must be a quorum block");
142+
140143
// Determine the expected height.
141144
let expected_height = previous_height.saturating_add(1);
142-
// Ensure the block type is correct.
143-
match expected_height == 0 {
144-
true => ensure!(self.authority.is_beacon(), "The genesis block must be a beacon block"),
145-
false => {
146-
#[cfg(not(any(test, feature = "test")))]
147-
ensure!(self.authority.is_quorum(), "The next block must be a quorum block");
148-
}
149-
}
150145

151146
// Determine the expected round.
152147
let expected_round = match &self.authority {

0 commit comments

Comments
 (0)