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 Freeze for BlockchainState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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