Skip to content

Commit

Permalink
fix: unused deps + feature issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef committed Oct 5, 2023
1 parent 78aecdb commit e1b4ed0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ aes-gcm = "0.10"
anyhow = "1.0"
assert_matches = "1.5"
async-trait = "0.1"
is-terminal = "0.4"
bitvec = "1.0"
blake3 = "=1.4"
bs58 = "=0.5"
clap = { version = "4.4", features = ["derive", "cargo"] }
config = "0.13"
console = "0.15"
criterion = "0.5"
Expand All @@ -134,6 +134,7 @@ http = "0.2"
humantime = "2.1"
hyper = "0.14"
ip_rfc = "0.1"
is-terminal = "0.4"
itertools = "0.11"
jsonrpsee = "0.20"
jsonrpsee-http-client = "0.20"
Expand All @@ -148,7 +149,6 @@ num = "=0.4"
num_enum = "0.7"
paginate = "1.1"
parking_lot = "0.12"
paw = "1.0"
pbkdf2 = { version = "=0.12", features = ["simple"] }
prometheus = "0.13"
rand = "0.8"
Expand All @@ -172,7 +172,6 @@ sha3 = "=0.10"
socket2 = "0.5"
stream_limiter = "3.2"
structopt = "0.3"
clap = { version = "4.4", features = ["derive", "cargo"] }
strum = "0.25"
strum_macros = "0.25"
tempfile = "3.5"
Expand Down
44 changes: 24 additions & 20 deletions massa-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,36 +153,40 @@ async fn launch(
}
}

use massa_models::config::constants::DOWNTIME_END_TIMESTAMP;
use massa_models::config::constants::DOWNTIME_START_TIMESTAMP;

// Simulate downtime
// last_start_period should be set to trigger after the DOWNTIME_END_TIMESTAMP
#[cfg(not(feature = "bootstrap_server"))]
if now >= DOWNTIME_START_TIMESTAMP && now <= DOWNTIME_END_TIMESTAMP {
let (days, hours, mins, secs) = DOWNTIME_END_TIMESTAMP
.saturating_sub(now)
.days_hours_mins_secs()
.unwrap();
{
use massa_models::config::constants::DOWNTIME_END_TIMESTAMP;
use massa_models::config::constants::DOWNTIME_START_TIMESTAMP;

// Simulate downtime
// last_start_period should be set to trigger after the DOWNTIME_END_TIMESTAMP
#[cfg(not(feature = "bootstrap_server"))]
if now >= DOWNTIME_START_TIMESTAMP && now <= DOWNTIME_END_TIMESTAMP {
let (days, hours, mins, secs) = DOWNTIME_END_TIMESTAMP
.saturating_sub(now)
.days_hours_mins_secs()
.unwrap();

if let Ok(Some(end_period)) = massa_models::timeslots::get_latest_block_slot_at_timestamp(
THREAD_COUNT,
T0,
*GENESIS_TIMESTAMP,
DOWNTIME_END_TIMESTAMP,
) {
panic!(
if let Ok(Some(end_period)) =
massa_models::timeslots::get_latest_block_slot_at_timestamp(
THREAD_COUNT,
T0,
*GENESIS_TIMESTAMP,
DOWNTIME_END_TIMESTAMP,
)
{
panic!(
"We are in downtime! {} days, {} hours, {} minutes, {} seconds remaining to the end of the downtime. Downtime end period: {}",
days, hours, mins, secs, end_period.period
);
}
}

panic!(
panic!(
"We are in downtime! {} days, {} hours, {} minutes, {} seconds remaining to the end of the downtime",
days, hours, mins, secs,
);
}
}

// Storage shared by multiple components.
let shared_storage: Storage = Storage::create_root();

Expand Down

0 comments on commit e1b4ed0

Please sign in to comment.