Skip to content

Commit da38a36

Browse files
authored
Merge pull request #92 from datachainlab/BELC3
BELC3
2 parents 518d5d6 + fe82b8a commit da38a36

File tree

4 files changed

+337
-33
lines changed

4 files changed

+337
-33
lines changed

light-client/src/errors.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ pub enum Error {
144144
UnexpectedMissingForkSpecInCurrentEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
145145
UnexpectedMissingForkSpecInPreviousEpochCalculation(BlockNumber, alloc::boxed::Box<Error>),
146146
UnexpectedPreviousEpochInCalculatingNextEpoch(BlockNumber, BlockNumber, BlockNumber),
147+
EmptyPreviousForkSpecs,
147148
UnexpectedEpochLength(u64, u64),
148149
MustBeEpoch(BlockNumber, ForkSpec),
149150
MustNotBeEpoch(BlockNumber, ForkSpec),
@@ -512,6 +513,9 @@ impl core::fmt::Display for Error {
512513
Error::UnexpectedEpochInfo(e1, e2) => {
513514
write!(f, "UnexpectedEpochInfo : {} {}", e1, e2)
514515
}
516+
Error::EmptyPreviousForkSpecs => {
517+
write!(f, "EmptyPreviousForkSpecs")
518+
}
515519
Error::UnexpectedNotEmptyMixHash(e1, e2) => {
516520
write!(f, "UnexpectedNotEmptyMixHash : {} {:?}", e1, e2)
517521
}

light-client/src/fixture/mod.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,33 @@ pub fn fork_spec_after_lorentz() -> ForkSpec {
9393

9494
pub fn fork_spec_after_maxwell() -> ForkSpec {
9595
ForkSpec {
96-
height_or_timestamp: HeightOrTimestamp::Height(2),
96+
height_or_timestamp: HeightOrTimestamp::Height(1),
97+
additional_header_item_count: 1,
98+
epoch_length: 1000,
99+
max_turn_length: 64,
100+
enable_header_msec: true,
101+
gas_limit_bound_divider: 1024,
102+
}
103+
}
104+
105+
pub fn fork_spec_after_post_maxwell_1() -> ForkSpec {
106+
ForkSpec {
107+
height_or_timestamp: HeightOrTimestamp::Height(1),
97108
additional_header_item_count: 1,
98109
epoch_length: 1000,
99110
max_turn_length: 64,
100111
enable_header_msec: true,
101112
gas_limit_bound_divider: 1024,
102113
}
103114
}
115+
116+
pub fn fork_spec_after_post_maxwell_2() -> ForkSpec {
117+
ForkSpec {
118+
height_or_timestamp: HeightOrTimestamp::Height(1),
119+
additional_header_item_count: 1,
120+
epoch_length: 2000,
121+
max_turn_length: 64,
122+
enable_header_msec: true,
123+
gas_limit_bound_divider: 1024,
124+
}
125+
}

0 commit comments

Comments
 (0)