Struct primitives::account::Account
source · pub struct Account {
pub balance: U256,
pub nonce: U256,
pub code_hash: H256,
pub staking_balance: U256,
pub collateral_for_storage: U256,
pub accumulated_interest_return: U256,
pub admin: Address,
pub sponsor_info: SponsorInfo,
/* private fields */
}
Fields§
§balance: U256
§nonce: U256
§code_hash: H256
§staking_balance: U256
This is the number of tokens used in staking.
collateral_for_storage: U256
This is the number of tokens used as collateral for storage, which will be returned to balance if the storage is released.
accumulated_interest_return: U256
This is the accumulated interest return.
admin: Address
This is the address of the administrator of the contract.
sponsor_info: SponsorInfo
This is the sponsor information of the contract.
Implementations§
source§impl Account
impl Account
pub fn address(&self) -> &AddressWithSpace
pub fn set_address(&mut self, address: AddressWithSpace)
pub fn new_empty(address: &AddressWithSpace) -> Account
pub fn new_empty_with_balance( address: &AddressWithSpace, balance: &U256, nonce: &U256 ) -> Account
pub fn from_contract_account(address: Address, a: ContractAccount) -> Self
pub fn to_basic_account(&self) -> BasicAccount
pub fn to_contract_account(&self) -> ContractAccount
pub fn to_evm_account(&self) -> EthereumAccount
pub fn new_from_rlp( address: Address, rlp: &Rlp<'_> ) -> Result<Self, AccountError>
Trait Implementations§
source§impl Ord for Account
impl Ord for Account
source§impl PartialEq for Account
impl PartialEq for Account
source§impl PartialOrd for Account
impl PartialOrd for Account
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Account
impl StructuralPartialEq for Account
Auto Trait Implementations§
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
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