Struct multiversx_chain_vm::world_mock::BlockchainState
source · pub struct BlockchainState {
pub accounts: HashMap<VMAddress, AccountData>,
pub new_addresses: HashMap<(VMAddress, u64), VMAddress>,
pub previous_block_info: BlockInfo,
pub current_block_info: BlockInfo,
pub new_token_identifiers: Vec<String>,
}
Fields§
§accounts: HashMap<VMAddress, AccountData>
§new_addresses: HashMap<(VMAddress, u64), VMAddress>
§previous_block_info: BlockInfo
§current_block_info: BlockInfo
§new_token_identifiers: Vec<String>
Implementations§
source§impl BlockchainState
impl BlockchainState
pub fn add_account(&mut self, acct: AccountData)
pub fn validate_and_add_account(&mut self, acct: AccountData)
pub fn update_accounts(&mut self, accounts: HashMap<VMAddress, AccountData>)
pub fn print_accounts(&self)
pub fn put_new_address( &mut self, creator_address: VMAddress, creator_nonce: u64, new_address: VMAddress )
pub fn get_new_address( &self, creator_address: VMAddress, creator_nonce: u64 ) -> Option<VMAddress>
pub fn validate_account(&self, account: &AccountData)
pub fn check_account_has_code(&self, account: &AccountData) -> bool
source§impl BlockchainState
impl BlockchainState
pub fn commit_updates(&mut self, updates: BlockchainUpdate)
pub fn account_exists(&self, address: &VMAddress) -> bool
pub fn increase_account_nonce(&mut self, address: &VMAddress)
pub fn subtract_tx_gas( &mut self, address: &VMAddress, gas_limit: u64, gas_price: u64 )
pub fn increase_validator_reward( &mut self, address: &VMAddress, amount: &BigUint )
pub fn put_new_token_identifier(&mut self, token_identifier: String)
pub fn get_new_token_identifiers(&self) -> Vec<String>
pub fn update_new_token_identifiers(&mut self, token_identifiers: Vec<String>)
Trait Implementations§
source§impl Clone for BlockchainState
impl Clone for BlockchainState
source§fn clone(&self) -> BlockchainState
fn clone(&self) -> BlockchainState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BlockchainState
impl Debug for BlockchainState
source§impl Default for BlockchainState
impl Default for BlockchainState
source§fn default() -> BlockchainState
fn default() -> BlockchainState
Returns the “default value” for a type. Read more
source§impl TxCacheSource for BlockchainState
impl TxCacheSource for BlockchainState
fn load_account(&self, address: &VMAddress) -> Option<AccountData>
fn blockchain_ref(&self) -> &BlockchainState
Auto Trait Implementations§
impl RefUnwindSafe for BlockchainState
impl Send for BlockchainState
impl Sync for BlockchainState
impl Unpin for BlockchainState
impl UnwindSafe for BlockchainState
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