Skip to content

Commit

Permalink
Merge #2358
Browse files Browse the repository at this point in the history
2358: Fix wrong rooting configuration for Sandbox r=adrien-zinger a=adrien-zinger

Before with `cargo run --features sandbox` we launched the node with *default_testing* instead of *default*.

Co-authored-by: Adrien Zinger <[email protected]>
  • Loading branch information
bors[bot] and adrien-zinger authored Mar 2, 2022
2 parents 6cae0d3 + f83dbff commit 8e40158
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
14 changes: 2 additions & 12 deletions massa-models/src/node_configuration/default_testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,13 @@ lazy_static::lazy_static! {
};

/// TESTNET: time when the blockclique is ended.
pub static ref END_TIMESTAMP: Option<MassaTime> = if cfg!(feature = "sandbox") || cfg!(feature = "testing") {
None
} else {
Some(1646078400000.into())
};
pub static ref END_TIMESTAMP: Option<MassaTime> = None;
// Be carefull:
// The `GENESIS_TIMESTAMP` shouldn't be used as it in test because if you start the full test
// process, the first use is effectivelly `MassaTime::now().unwrap()` but will be outdated for
// the latest test. That's the reason why we choose to reset it each time we get a ConsensusConfig.
pub static ref POS_MISS_RATE_DEACTIVATION_THRESHOLD: Ratio<u64> = Ratio::new(1, 1);
pub static ref VERSION: Version = if cfg!(feature = "sandbox") {
"SAND.0.0"
} else {
"TEST.7.0"
}
.parse()
.unwrap();
pub static ref VERSION: Version = "DEVE.0.0".parse().unwrap();
}

/// Size of the random bytes array used for the bootstrap, safe to import
Expand Down
18 changes: 16 additions & 2 deletions massa-models/src/node_configuration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@
//! use massa_models::constants::default_testing::*;
//! ```
//!
//! # Note about rooting
//!
//! |T|S| not(T) or S | T and not(S)
//! |0|0| 1 | 0
//! |1|0| 0 | 1
//! |0|1| 1 | 0
//! |1|1| 1 | 0
//!
//! #[cfg(any(not(feature = "testing"), feature = "sandbox"))]
//! On `cargo run --release` or `cargo run --features sandbox`
//!
//! #[cfg(all(feature = "testing", not(feature = "sandbox")))]
//! On `cargo run` or `cargo test`
//!
// **************************************************************
// Note:
Expand All @@ -48,9 +62,9 @@
pub mod default;
pub mod default_testing;

#[cfg(not(feature = "testing"))]
#[cfg(any(not(feature = "testing"), feature = "sandbox"))]
pub use default::*;
#[cfg(feature = "testing")]
#[cfg(all(feature = "testing", not(feature = "sandbox")))]
pub use default_testing::*;

mod compact_config;
Expand Down

0 comments on commit 8e40158

Please sign in to comment.