pub struct TxCache { /* private fields */ }
Implementations§
Source§impl TxCache
impl TxCache
pub fn new(source_ref: Arc<dyn TxCacheSource>) -> Self
pub fn blockchain_ref(&self) -> &BlockchainState
pub fn with_account<R, F>(&self, address: &VMAddress, f: F) -> Rwhere
F: FnOnce(&AccountData) -> R,
pub fn with_account_or_else<R, F, Else>( &self, address: &VMAddress, f: F, or_else: Else, ) -> R
pub fn with_account_mut<R, F>(&self, address: &VMAddress, f: F) -> Rwhere
F: FnOnce(&mut AccountData) -> R,
pub fn insert_account(&self, account_data: AccountData)
pub fn increase_acount_nonce(&self, address: &VMAddress)
Sourcepub fn get_new_address(&self, creator_address: &VMAddress) -> VMAddress
pub fn get_new_address(&self, creator_address: &VMAddress) -> VMAddress
Assumes the nonce has already been increased.
pub fn get_new_token_identifiers(&self) -> Vec<String>
pub fn set_new_token_identifiers(&self, token_identifiers: Vec<String>)
pub fn into_blockchain_updates(self) -> BlockchainUpdate
pub fn commit_updates(&self, updates: BlockchainUpdate)
Source§impl TxCache
impl TxCache
pub fn subtract_egld_balance( &self, address: &VMAddress, call_value: &BigUint, ) -> Result<(), TxPanic>
pub fn subtract_tx_gas( &self, address: &VMAddress, gas_limit: u64, gas_price: u64, )
pub fn increase_egld_balance(&self, address: &VMAddress, amount: &BigUint)
pub fn subtract_esdt_balance( &self, address: &VMAddress, esdt_token_identifier: &[u8], nonce: u64, value: &BigUint, ) -> Result<EsdtInstanceMetadata, TxPanic>
pub fn increase_esdt_balance( &self, address: &VMAddress, esdt_token_identifier: &[u8], nonce: u64, value: &BigUint, esdt_metadata: EsdtInstanceMetadata, )
pub fn transfer_egld_balance( &self, from: &VMAddress, to: &VMAddress, value: &BigUint, ) -> Result<(), TxPanic>
pub fn transfer_esdt_balance( &self, from: &VMAddress, to: &VMAddress, esdt_token_identifier: &[u8], nonce: u64, value: &BigUint, ) -> Result<(), TxPanic>
Trait Implementations§
Source§impl TxCacheSource for TxCache
impl TxCacheSource for TxCache
fn load_account(&self, address: &VMAddress) -> Option<AccountData>
fn blockchain_ref(&self) -> &BlockchainState
Auto Trait Implementations§
impl !Freeze for TxCache
impl !RefUnwindSafe for TxCache
impl Send for TxCache
impl Sync for TxCache
impl Unpin for TxCache
impl !UnwindSafe for TxCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more