diff --git a/substrate/wasm-runtime/polkadot/src/support/environment.rs b/substrate/wasm-runtime/polkadot/src/support/environment.rs index c01a1f4e92..02c29afc1b 100644 --- a/substrate/wasm-runtime/polkadot/src/support/environment.rs +++ b/substrate/wasm-runtime/polkadot/src/support/environment.rs @@ -37,7 +37,7 @@ pub fn with_env T>(f: F) -> T { f(&mut *eb) } -#[cfg(not(test))] +#[cfg(target_arch = "wasm32")] fn env() -> Rc> { // Initialize it to a null value static mut SINGLETON: *const Rc> = 0 as *const Rc>; @@ -56,7 +56,7 @@ fn env() -> Rc> { } } -#[cfg(test)] +#[cfg(not(target_arch = "wasm32"))] fn env() -> Rc> { // Initialize it to a null value thread_local!{