Files
solana/ledger/src/block_error.rs
Justin Starry ff1ca1e0d3 Consolidate entry tick verification into one function (#7740)
* Consolidate entry tick verification into one function

* Mark bad slots as dead in blocktree processor

* more feedback

* Add bank.is_complete

* feedback
2020-01-15 09:15:26 +08:00

30 lines
886 B
Rust

use thiserror::Error;
#[derive(Error, Debug, PartialEq)]
pub enum BlockError {
/// Block did not have enough ticks or was not marked full
#[error("incomplete block")]
Incomplete,
/// Block entries hashes must all be valid
#[error("invalid entry hash")]
InvalidEntryHash,
/// Blocks must end in a tick that has been marked as the last tick.
#[error("invalid last tick")]
InvalidLastTick,
/// Blocks can not have extra ticks or missing ticks
#[error("invalid tick count")]
InvalidTickCount,
/// All ticks must contain the same number of hashes within a block
#[error("invalid tick hash count")]
InvalidTickHashCount,
/// Blocks must end in a tick entry, trailing transaction entries are not allowed to guarantee
/// that each block has the same number of hashes
#[error("trailing entry")]
TrailingEntry,
}