Skip to content
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

fix: Fix testnet well-known time parameters #189

Merged
merged 1 commit into from
Mar 8, 2022
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
6 changes: 3 additions & 3 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ impl ChainWellKnownInfo {
pub fn testnet() -> Self {
ChainWellKnownInfo {
byron_slot_length: 20,
byron_known_slot: 1031,
byron_known_time: 1564020236,
byron_known_hash: "388a82f053603f3552717d61644a353188f2d5500f4c6354cc1ad27a36a7ea91"
byron_known_slot: 0,
byron_known_time: 1564010416,
byron_known_hash: "8f8602837f7c6f8b8867dd1cbc1842cf51a27eaed2c70ef48325d00f8efb320f"
.to_string(),
shelley_slot_length: 1,
shelley_known_slot: 1598400,
Expand Down
8 changes: 6 additions & 2 deletions src/utils/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ mod tests {
fn naive_provider_matches_testnet_values() {
let provider = NaiveProvider::new(ChainWellKnownInfo::testnet());

// Byron origin, value copied from:
// https://explorer.cardano-testnet.iohkdev.io/en/block?id=8f8602837f7c6f8b8867dd1cbc1842cf51a27eaed2c70ef48325d00f8efb320f
assert_slot_matches_timestamp(&provider, 0, 1564010416);

// Byron start, value copied from:
// https://explorer.cardano-testnet.iohkdev.io/en/block?id=388a82f053603f3552717d61644a353188f2d5500f4c6354cc1ad27a36a7ea91
assert_slot_matches_timestamp(&provider, 1031, 1564020236);
assert_slot_matches_timestamp(&provider, 1031, 1564031036);

// Byron middle, value copied from:
// https://explorer.cardano-testnet.iohkdev.io/en/block?id=66102c0b80e1eebc9cddf9cab43c1bf912e4f1963d6f3b8ff948952f8409e779
assert_slot_matches_timestamp(&provider, 561595, 1575231516);
assert_slot_matches_timestamp(&provider, 561595, 1575242316);

// Shelley start, value copied from:
// https://explorer.cardano-testnet.iohkdev.io/en/block?id=02b1c561715da9e540411123a6135ee319b02f60b9a11a603d3305556c04329f
Expand Down