From 4634e07f7b06eabb223b08ec22ecbd9bd1b4fe49 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Thu, 3 Mar 2022 15:20:13 +0100 Subject: [PATCH 1/2] Fix genesis timestamp in test. --- massa-consensus-worker/src/tests/scenario_block_creation.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/massa-consensus-worker/src/tests/scenario_block_creation.rs b/massa-consensus-worker/src/tests/scenario_block_creation.rs index f017be5dfaf..7b5a048e21c 100644 --- a/massa-consensus-worker/src/tests/scenario_block_creation.rs +++ b/massa-consensus-worker/src/tests/scenario_block_creation.rs @@ -35,7 +35,9 @@ async fn test_genesis_block_creation() { LedgerData::new(Amount::from_str("1000").unwrap()), ); let mut cfg = ConsensusConfig { - genesis_timestamp: MassaTime::from_str("1633301290000").unwrap(), + genesis_timestamp: MassaTime::now() + .unwrap() + .saturating_sub(MassTime::from(30000)), ..ConsensusConfig::default_with_staking_keys_and_ledger(&[priv_1, priv_2], &ledger) }; // init roll count From d58c0bfd61b828c147119dd791bb5fd8a816f1ab Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Thu, 3 Mar 2022 15:56:48 +0100 Subject: [PATCH 2/2] Fix typo. --- massa-consensus-worker/src/tests/scenario_block_creation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/massa-consensus-worker/src/tests/scenario_block_creation.rs b/massa-consensus-worker/src/tests/scenario_block_creation.rs index 7b5a048e21c..a3b06f4cfe2 100644 --- a/massa-consensus-worker/src/tests/scenario_block_creation.rs +++ b/massa-consensus-worker/src/tests/scenario_block_creation.rs @@ -37,7 +37,7 @@ async fn test_genesis_block_creation() { let mut cfg = ConsensusConfig { genesis_timestamp: MassaTime::now() .unwrap() - .saturating_sub(MassTime::from(30000)), + .saturating_sub(MassaTime::from(30000)), ..ConsensusConfig::default_with_staking_keys_and_ledger(&[priv_1, priv_2], &ledger) }; // init roll count