mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-12-04 04:43:58 +01:00
use local chain_type and global chain_type as necessary
This commit is contained in:
+11
-1
@@ -131,7 +131,17 @@ 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(global::ChainTypes::AutomatedTesting);
|
||||
}
|
||||
|
||||
/// Some tests require the global chain_type to be configured.
|
||||
/// If tokio is used in any tests we need to ensure any threads spawned
|
||||
/// have the chain_type configured correctly.
|
||||
/// 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);
|
||||
}
|
||||
|
||||
/// Create a wallet config file in the given current directory
|
||||
|
||||
Reference in New Issue
Block a user