Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -144,6 +144,7 @@ pub enum Error {
UnexpectedMissingForkSpecInCurrentEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
UnexpectedMissingForkSpecInPreviousEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
UnexpectedPreviousEpochInCalculatingNextEpoch(BlockNumber, BlockNumber, BlockNumber),
EmptyPreviousForkSpecs,
UnexpectedEpochLength(u64, u64),
MustBeEpoch(BlockNumber, ForkSpec),
MustNotBeEpoch(BlockNumber, ForkSpec),
Expand Down Expand Up @@ -512,6 +513,9 @@ impl core::fmt::Display for Error {
Error::UnexpectedEpochInfo(e1, e2) => {
write!(f, "UnexpectedEpochInfo : {} {}", e1, e2)
}
Error::EmptyPreviousForkSpecs => {
write!(f, "EmptyPreviousForkSpecs")
}
Error::UnexpectedNotEmptyMixHash(e1, e2) => {
write!(f, "UnexpectedNotEmptyMixHash : {} {:?}", e1, e2)
}
Expand Down
24 changes: 23 additions & 1 deletion light-client/src/fixture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,33 @@ 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,
enable_header_msec: true,
gas_limit_bound_divider: 1024,
}
}

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,
enable_header_msec: true,
gas_limit_bound_divider: 1024,
}
}

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,
enable_header_msec: true,
gas_limit_bound_divider: 1024,
}
}
Loading
Loading