[−]Function near_bindgen::env::set_blockchain_interface
pub fn set_blockchain_interface(
blockchain_interface: Box<dyn BlockchainInterface>
)
Replaces the current low-level blockchain interface accessible through env::*
with another
low-level blockchain interfacr that implements BlockchainInterface
trait. In most cases you
want to use testing_env!
macro to set it.
ⓘThis example is not tested
let mocked_blockchain = near_bindgen::MockedBlockchain::new( context, vm_config, fees_config, vec![], storage, ); near_bindgen::env::set_blockchain_interface(Box::new(mocked_blockchain));