diff --git a/packages/vm/src/testing/mock.rs b/packages/vm/src/testing/mock.rs index e2621c868..4a260a5f9 100644 --- a/packages/vm/src/testing/mock.rs +++ b/packages/vm/src/testing/mock.rs @@ -2,15 +2,9 @@ use cosmwasm_std::testing::{digit_sum, riffle_shuffle}; use cosmwasm_std::{ Addr, BlockInfo, Coin, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo, }; -use std::cell::RefCell; -use std::collections::HashMap; -use std::sync::RwLock; -use std::thread_local; -use wasmer::Module; use super::querier::MockQuerier; use super::storage::MockStorage; -use crate::instance::Instance; use crate::{Backend, BackendApi, BackendError, BackendResult, GasInfo}; pub const MOCK_CONTRACT_ADDR: &str = "cosmos2contract"; @@ -39,13 +33,6 @@ pub fn mock_backend_with_balances( } } -type MockInstance = Instance; -thread_local! { - // INSTANCE_CACHE and MODULE_CACHE are intended to replace wasmvm's cache layer in the mock. - // Unlike wasmvm, you have to initialize them yourself in the place where you test the dynamic call. - pub static INSTANCE_CACHE: RwLock>> = RwLock::new(HashMap::new()); - pub static MODULE_CACHE: RwLock>> = RwLock::new(HashMap::new()); -} /// Length of canonical addresses created with this API. Contracts should not make any assumtions /// what this value is. /// The value here must be restorable with `SHUFFLES_ENCODE` + `SHUFFLES_DECODE` in-shuffles. diff --git a/packages/vm/src/testing/mod.rs b/packages/vm/src/testing/mod.rs index 2948e226e..b6da71c48 100644 --- a/packages/vm/src/testing/mod.rs +++ b/packages/vm/src/testing/mod.rs @@ -23,8 +23,7 @@ pub use instance::{ test_io, MockInstanceOptions, }; pub use mock::{ - mock_backend, mock_backend_with_balances, mock_env, mock_info, MockApi, INSTANCE_CACHE, - MOCK_CONTRACT_ADDR, + mock_backend, mock_backend_with_balances, mock_env, mock_info, MockApi, MOCK_CONTRACT_ADDR, }; pub use querier::MockQuerier; pub use result::{TestingError, TestingResult};