Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions light-client/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ pub enum Error {
UnexpectedMissingForkSpecInCurrentEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
UnexpectedMissingForkSpecInPreviousEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
UnexpectedPreviousEpochInCalculatingNextEpoch(BlockNumber, BlockNumber, BlockNumber),
EmptyPreviousForkSpecs,

// Misbehaviour
MissingHeader1,
Expand Down Expand Up @@ -506,6 +507,9 @@ impl core::fmt::Display for Error {
Error::UnexpectedEpochInfo(e1, e2) => {
write!(f, "UnexpectedEpochInfo : {} {}", e1, e2)
}
Error::EmptyPreviousForkSpecs => {
write!(f, "EmptyPreviousForkSpecs")
}
}
}
}
Expand Down
20 changes: 19 additions & 1 deletion light-client/src/fixture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,27 @@ pub fn fork_spec_after_lorentz() -> ForkSpec {

pub fn fork_spec_after_maxwell() -> ForkSpec {
ForkSpec {
height_or_timestamp: HeightOrTimestamp::Height(2),
height_or_timestamp: HeightOrTimestamp::Height(1),
additional_header_item_count: 1,
epoch_length: 1000,
max_turn_length: 64,
}
}

pub fn fork_spec_after_post_maxwell_1() -> ForkSpec {
ForkSpec {
height_or_timestamp: HeightOrTimestamp::Height(1),
additional_header_item_count: 1,
epoch_length: 1000,
max_turn_length: 64,
}
}

pub fn fork_spec_after_post_maxwell_2() -> ForkSpec {
ForkSpec {
height_or_timestamp: HeightOrTimestamp::Height(1),
additional_header_item_count: 1,
epoch_length: 2000,
max_turn_length: 64,
}
}
Loading
Loading