Skip to content

Commit 53b678e

Browse files
author
Naohiro Yoshida
committed
fix BELC3
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
1 parent ddfd92e commit 53b678e

File tree

3 files changed

+327
-28
lines changed

3 files changed

+327
-28
lines changed

light-client/src/errors.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ pub enum Error {
141141
UnexpectedMissingForkSpecInCurrentEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
142142
UnexpectedMissingForkSpecInPreviousEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
143143
UnexpectedPreviousEpochInCalculatingNextEpoch(BlockNumber, BlockNumber, BlockNumber),
144+
EmptyPreviousForkSpecs,
144145

145146
// Misbehaviour
146147
MissingHeader1,
@@ -506,6 +507,9 @@ impl core::fmt::Display for Error {
506507
Error::UnexpectedEpochInfo(e1, e2) => {
507508
write!(f, "UnexpectedEpochInfo : {} {}", e1, e2)
508509
}
510+
Error::EmptyPreviousForkSpecs => {
511+
write!(f, "EmptyPreviousForkSpecs")
512+
}
509513
}
510514
}
511515
}

light-client/src/fixture/mod.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,27 @@ pub fn fork_spec_after_lorentz() -> ForkSpec {
8989

9090
pub fn fork_spec_after_maxwell() -> ForkSpec {
9191
ForkSpec {
92-
height_or_timestamp: HeightOrTimestamp::Height(2),
92+
height_or_timestamp: HeightOrTimestamp::Height(1),
93+
additional_header_item_count: 1,
94+
epoch_length: 1000,
95+
max_turn_length: 64,
96+
}
97+
}
98+
99+
pub fn fork_spec_after_post_maxwell_1() -> ForkSpec {
100+
ForkSpec {
101+
height_or_timestamp: HeightOrTimestamp::Height(1),
93102
additional_header_item_count: 1,
94103
epoch_length: 1000,
95104
max_turn_length: 64,
96105
}
97106
}
107+
108+
pub fn fork_spec_after_post_maxwell_2() -> ForkSpec {
109+
ForkSpec {
110+
height_or_timestamp: HeightOrTimestamp::Height(1),
111+
additional_header_item_count: 1,
112+
epoch_length: 2000,
113+
max_turn_length: 64,
114+
}
115+
}

0 commit comments

Comments
 (0)