-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add example crate for incremental Cardano database #2337
Conversation
Test Results 3 files ±0 52 suites ±0 10m 23s ⏱️ -15s Results for commit d505bb5. ± Comparison against base commit 09ab67d. This pull request removes 4 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
50dc7d6
to
60f722f
Compare
60f722f
to
079bae2
Compare
079bae2
to
a56fa49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
I'm wondering if the CardanoDbV2DownloadCommand::number_of_immutable_files_restored
tests in mithril-client-cli
are still useful?
mithril/mithril-client-cli/src/commands/cardano_db_v2/download.rs
Lines 584 to 659 in a56fa49
#[test] | |
fn number_of_immutable_files_restored_with_full_restoration() { | |
let cardano_database_snapshot = CardanoDatabaseSnapshot { | |
beacon: CardanoDbBeacon::new(999, 20), | |
..CardanoDatabaseSnapshot::dummy() | |
}; | |
let immutable_file_range = ImmutableFileRange::Full; | |
let number_of_immutable_files_restored = | |
CardanoDbV2DownloadCommand::number_of_immutable_files_restored( | |
&cardano_database_snapshot, | |
&immutable_file_range, | |
); | |
assert_eq!(number_of_immutable_files_restored, 20); | |
} | |
#[test] | |
fn number_of_immutable_files_restored_with_from() { | |
let cardano_database_snapshot = CardanoDatabaseSnapshot { | |
beacon: CardanoDbBeacon::new(999, 20), | |
..CardanoDatabaseSnapshot::dummy() | |
}; | |
let immutable_file_range = ImmutableFileRange::From(12); | |
let number_of_immutable_files_restored = | |
CardanoDbV2DownloadCommand::number_of_immutable_files_restored( | |
&cardano_database_snapshot, | |
&immutable_file_range, | |
); | |
let expected_number_of_immutable_files_restored = 20 - 12 + 1; | |
assert_eq!( | |
number_of_immutable_files_restored, | |
expected_number_of_immutable_files_restored | |
); | |
} | |
#[test] | |
fn number_of_immutable_files_restored_with_up_to() { | |
let cardano_database_snapshot = CardanoDatabaseSnapshot { | |
beacon: CardanoDbBeacon::new(999, 20), | |
..CardanoDatabaseSnapshot::dummy() | |
}; | |
let immutable_file_range = ImmutableFileRange::UpTo(14); | |
let number_of_immutable_files_restored = | |
CardanoDbV2DownloadCommand::number_of_immutable_files_restored( | |
&cardano_database_snapshot, | |
&immutable_file_range, | |
); | |
assert_eq!(number_of_immutable_files_restored, 14); | |
} | |
#[test] | |
fn number_of_immutable_files_restored_with_range() { | |
let cardano_database_snapshot = CardanoDatabaseSnapshot { | |
beacon: CardanoDbBeacon::new(999, 20), | |
..CardanoDatabaseSnapshot::dummy() | |
}; | |
let immutable_file_range = ImmutableFileRange::Range(12, 14); | |
let number_of_immutable_files_restored = | |
CardanoDbV2DownloadCommand::number_of_immutable_files_restored( | |
&cardano_database_snapshot, | |
&immutable_file_range, | |
); | |
let expected_number_of_immutable_files_restored = 14 - 12 + 1; | |
assert_eq!( | |
number_of_immutable_files_restored, | |
expected_number_of_immutable_files_restored | |
); | |
} | |
} |
a56fa49
to
161a774
Compare
Co-authored-by: Damien Lachaume <[email protected]> Co-authored-by: DJO <[email protected]> Co-authored-by: Sébastien Fauvel <[email protected]>
161a774
to
eff5d76
Compare
eff5d76
to
9915ab7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ate its unstable status
* examples/client-cardano-database to `0.0.1` * mithril-client-cli from `0.11.3` to `0.11.4` * mithril-client from `0.11.5` to `0.11.6`
70dd1e9
to
d505bb5
Compare
I have removed the function |
Content
This PR includes an example crate for the incremental Cardano database.
Pre-submit checklist
Issue(s)
Closes #2330