Skip to content

Commit 134fd58

Browse files
committed
fix(client): retrieve '00000' immutable files in client
For Cardano DB v2 restoration.
1 parent d25b8b2 commit 134fd58

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

mithril-client/src/cardano_database_client/immutable_file_range.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ impl ImmutableFileRange {
2626
&self,
2727
last_immutable_file_number: ImmutableFileNumber,
2828
) -> StdResult<RangeInclusive<ImmutableFileNumber>> {
29-
// The immutable file numbers start from 1 on all the networks except the 'devnet'
30-
// when it is configured with aggressive protocol parameters for fast epochs (used in the e2e tests).
31-
// We have taken the choice to consider that the file numbers start from 1 for all the networks.
32-
const FIRST_IMMUTABLE_FILE_NUMBER: ImmutableFileNumber = 1;
29+
const FIRST_IMMUTABLE_FILE_NUMBER: ImmutableFileNumber = 0;
3330
let full_range = FIRST_IMMUTABLE_FILE_NUMBER..=last_immutable_file_number;
3431

3532
match self {
@@ -74,7 +71,7 @@ mod tests {
7471
let result = immutable_file_range
7572
.to_range_inclusive(last_immutable_file_number)
7673
.unwrap();
77-
assert_eq!(1..=10, result);
74+
assert_eq!(0..=10, result);
7875
}
7976

8077
#[test]
@@ -124,7 +121,7 @@ mod tests {
124121
let result = immutable_file_range
125122
.to_range_inclusive(last_immutable_file_number)
126123
.unwrap();
127-
assert_eq!(1..=8, result);
124+
assert_eq!(0..=8, result);
128125

129126
let last_immutable_file_number = 7;
130127
immutable_file_range

0 commit comments

Comments
 (0)