Function near_sdk::env::set_blockchain_interface[][src]

pub fn set_blockchain_interface(blockchain_interface: MockedBlockchain)
Expand description

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.

let mocked_blockchain = near_sdk::MockedBlockchain::new(
          context,
          vm_config,
          fees_config,
          vec![],
          storage,
          validators,
          None,
      );
near_sdk::env::set_blockchain_interface(mocked_blockchain);