From 2561589546df5ece3292e15546202f64e368916a Mon Sep 17 00:00:00 2001 From: antiochp <30642645+antiochp@users.noreply.github.com> Date: Sat, 23 May 2020 10:10:23 +0100 Subject: [PATCH] set_local_chain_type in owner and foreign tests --- api/src/foreign.rs | 5 +++-- api/src/owner.rs | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/foreign.rs b/api/src/foreign.rs index b42a3e1..7a97238 100644 --- a/api/src/foreign.rs +++ b/api/src/foreign.rs @@ -121,7 +121,7 @@ where /// use impls::{DefaultWalletImpl, DefaultLCProvider, HTTPNodeClient}; /// use libwallet::WalletInst; /// - /// global::init_global_chain_type(global::ChainTypes::Mainnet); + /// global::set_local_chain_type(global::ChainTypes::AutomatedTesting); /// /// let mut wallet_config = WalletConfig::default(); /// # let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap(); @@ -427,7 +427,8 @@ macro_rules! doctest_helper_setup_doc_env_foreign { use impls::{DefaultLCProvider, DefaultWalletImpl, HTTPNodeClient}; use libwallet::{BlockFees, IssueInvoiceTxArgs, Slate, WalletInst}; - global::init_global_chain_type(global::ChainTypes::Mainnet); + // Set our local chain_type for testing. + global::set_local_chain_type(global::ChainTypes::AutomatedTesting); let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap(); let dir = dir diff --git a/api/src/owner.rs b/api/src/owner.rs index 1123e22..5ed758b 100644 --- a/api/src/owner.rs +++ b/api/src/owner.rs @@ -127,7 +127,7 @@ where /// use impls::{DefaultWalletImpl, DefaultLCProvider, HTTPNodeClient}; /// use libwallet::WalletInst; /// - /// global::init_global_chain_type(global::ChainTypes::Mainnet); + /// global::set_local_chain_type(global::ChainTypes::AutomatedTesting); /// /// let mut wallet_config = WalletConfig::default(); /// # let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap(); @@ -2132,9 +2132,8 @@ macro_rules! doctest_helper_setup_doc_env { use uuid::Uuid; - // Various levels of magic going on in these doctests and we need to ensure - // the global chain_type is set correctly. - global::init_global_chain_type(global::ChainTypes::Mainnet); + // Set our local chain_type for testing. + global::set_local_chain_type(global::ChainTypes::AutomatedTesting); let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap(); let dir = dir