near_sdk/environment/mock/
mod.rsmod mocked_blockchain;
mod mocked_memory;
mod receipt;
pub use mocked_blockchain::test_vm_config;
pub use self::mocked_blockchain::MockedBlockchain;
pub use self::receipt::{MockAction, Receipt};
use core::cell::RefCell;
thread_local! {
static BLOCKCHAIN_INTERFACE: RefCell<MockedBlockchain>
= RefCell::new(MockedBlockchain::default());
}
pub fn with_mocked_blockchain<F, R>(f: F) -> R
where
F: FnOnce(&mut MockedBlockchain) -> R,
{
BLOCKCHAIN_INTERFACE.with(|b| f(&mut b.borrow_mut()))
}