Struct multiversx_chain_vm::tx_mock::TxContextRef
source · pub struct TxContextRef(_);Expand description
The VM API implementation based on a blockchain mock written in Rust. Implemented as a smart pointer to a TxContext structure, which tracks a blockchain transaction.
Implementations§
source§impl TxContextRef
impl TxContextRef
pub fn insert_new_managed_buffer( &self, value: Vec<u8> ) -> <Self as HandleTypeInfo>::ManagedBufferHandle
pub fn insert_new_managed_buffer_old( &self, value: Vec<u8> ) -> ManagedBuffer<Self>
pub fn mb_handle_to_value( &self, mb_handle: <Self as HandleTypeInfo>::ManagedBufferHandle ) -> Vec<u8> ⓘ
pub fn address_handle_to_value( &self, address_handle: <Self as HandleTypeInfo>::ManagedBufferHandle ) -> Address
pub fn insert_new_big_uint( &self, value: BigUint ) -> <Self as HandleTypeInfo>::BigIntHandle
pub fn set_big_uint( &self, handle: <Self as HandleTypeInfo>::BigIntHandle, value: BigUint )
pub fn insert_new_big_uint_old(&self, value: BigUint) -> BigUint<Self>
pub fn insert_new_big_uint_zero(&self) -> <Self as HandleTypeInfo>::BigIntHandle
pub fn big_uint_handle_to_value( &self, bu_handle: <Self as HandleTypeInfo>::BigIntHandle ) -> BigUint
source§impl TxContextRef
impl TxContextRef
pub fn new(tx_context_rc: Rc<TxContext>) -> Self
pub fn new_from_static() -> Self
pub fn dummy() -> Self
pub fn into_blockchain_updates(self) -> BlockchainUpdate
sourcepub fn into_tx_result(self) -> TxResult
pub fn into_tx_result(self) -> TxResult
Consumes the current API and returns the contained output. Should be called at the end of a tx execution. Will fail if any other references to the tx context survive, this must be the last.
sourcepub fn printed_messages(&self) -> Vec<String>
pub fn printed_messages(&self) -> Vec<String>
Will yield a copy of all messages printed on this context.
sourcepub fn printed_messages_clear(&self)
pub fn printed_messages_clear(&self)
Clears entire print history.
Methods from Deref<Target = TxContext>§
pub fn input_ref(&self) -> &TxInput
pub fn blockchain_cache(&self) -> &TxCache
pub fn blockchain_cache_rc(&self) -> Rc<TxCache>
pub fn blockchain_ref(&self) -> &BlockchainMock
pub fn with_account<R, F>(&self, address: &Address, f: F) -> Rwhere F: FnOnce(&AccountData) -> R,
pub fn with_contract_account<R, F>(&self, f: F) -> Rwhere F: FnOnce(&AccountData) -> R,
pub fn with_account_mut<R, F>(&self, address: &Address, f: F) -> Rwhere F: FnOnce(&mut AccountData) -> R,
pub fn with_contract_account_mut<R, F>(&self, f: F) -> Rwhere F: FnOnce(&mut AccountData) -> R,
pub fn m_types_borrow(&self) -> Ref<'_, TxManagedTypes>
pub fn m_types_borrow_mut(&self) -> RefMut<'_, TxManagedTypes>
pub fn result_borrow_mut(&self) -> RefMut<'_, TxResult>
pub fn extract_result(&self) -> TxResult
pub fn rng_borrow_mut(&self) -> RefMut<'_, BlockchainRng>
pub fn create_new_contract( &self, new_address: &Address, contract_path: Vec<u8>, contract_owner: Address )
Trait Implementations§
source§impl Clone for TxContextRef
impl Clone for TxContextRef
source§impl Debug for TxContextRef
impl Debug for TxContextRef
source§impl Deref for TxContextRef
impl Deref for TxContextRef
source§impl PartialEq<TxContextRef> for DebugApi
impl PartialEq<TxContextRef> for DebugApi
Auto Trait Implementations§
impl !CodecFromSelf for TxContextRef
impl !RefUnwindSafe for TxContextRef
impl !Send for TxContextRef
impl !Sync for TxContextRef
impl Unpin for TxContextRef
impl !UnwindSafe for TxContextRef
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.