no is_mainnet() to keep tests close to mainnet (#2496)

This commit is contained in:
Antioch Peverell 2019-01-31 09:23:19 +00:00 committed by GitHub
parent 5dbb478d3e
commit 422db82667
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -267,17 +267,14 @@ pub fn is_production_mode() -> bool {
} }
/// Are we in floonet? /// Are we in floonet?
/// Note: We do not have a corresponding is_mainnet() as we want any tests to be as close
/// as possible to "mainnet" configuration as possible.
/// We want to avoid missing any mainnet only code paths.
pub fn is_floonet() -> bool { pub fn is_floonet() -> bool {
let param_ref = CHAIN_TYPE.read(); let param_ref = CHAIN_TYPE.read();
ChainTypes::Floonet == *param_ref ChainTypes::Floonet == *param_ref
} }
/// Are we for real?
pub fn is_mainnet() -> bool {
let param_ref = CHAIN_TYPE.read();
ChainTypes::Mainnet == *param_ref
}
/// Helper function to get a nonce known to create a valid POW on /// Helper function to get a nonce known to create a valid POW on
/// the genesis block, to prevent it taking ages. Should be fine for now /// the genesis block, to prevent it taking ages. Should be fine for now
/// as the genesis block POW solution turns out to be the same for every new /// as the genesis block POW solution turns out to be the same for every new