use local chain_type and global chain_type as necessary

This commit is contained in:
antiochp
2020-05-22 14:35:35 +01:00
parent 2769436117
commit 72ff4b4e13
19 changed files with 79 additions and 49 deletions
+9 -1
View File
@@ -84,7 +84,15 @@ pub fn clean_output_dir(test_dir: &str) {
pub fn setup(test_dir: &str) {
util::init_test_logger();
clean_output_dir(test_dir);
global::set_mining_mode(ChainTypes::AutomatedTesting);
global::set_local_chain_type(ChainTypes::AutomatedTesting);
}
/// Some tests require the global chain_type to be configured due to threads being spawned internally.
/// It is recommended to avoid relying on this if at all possible as global chain_type
/// leaks across multiple tests and will likely have unintended consequences.
#[allow(dead_code)]
pub fn setup_global_chain_type() {
global::init_global_chain_type(global::ChainTypes::AutomatedTesting);
}
pub fn create_wallet_proxy(