Struct near_vm_logic::mocks::mock_external::MockedExternal [−][src]
pub struct MockedExternal {
pub fake_trie: HashMap<Vec<u8>, Vec<u8>>,
pub validators: HashMap<AccountId, Balance>,
// some fields omitted
}
Expand description
Emulates the trie and the mock handling code.
Fields
fake_trie: HashMap<Vec<u8>, Vec<u8>>
validators: HashMap<AccountId, Balance>
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
Write value
to the key
of the storage trie associated with the current account. Read more
Read key
from the storage trie associated with the current account. Read more
Removes the key
from the storage trie associated with the current account. Read more
Removes all keys with a given prefix
from the storage trie associated with current
account. Read more
Check whether the key
is present in the storage trie associated with the current account. Read more
fn create_receipt(
&mut self,
receipt_indices: Vec<u64>,
receiver_id: AccountId
) -> Result<u64, VMLogicError>
fn create_receipt(
&mut self,
receipt_indices: Vec<u64>,
receiver_id: AccountId
) -> Result<u64, VMLogicError>
Create a receipt which will be executed after all the receipts identified by
receipt_indices
are complete. Read more
Attach the [CreateAccountAction
] action to an existing receipt. Read more
fn append_action_deploy_contract(
&mut self,
receipt_index: u64,
code: Vec<u8>
) -> Result<(), VMLogicError>
fn append_action_deploy_contract(
&mut self,
receipt_index: u64,
code: Vec<u8>
) -> Result<(), VMLogicError>
Attach the [DeployContractAction
] action to an existing receipt. Read more
Attach the [FunctionCallAction
] action to an existing receipt. Read more
fn append_action_transfer(
&mut self,
receipt_index: u64,
amount: u128
) -> Result<(), VMLogicError>
fn append_action_transfer(
&mut self,
receipt_index: u64,
amount: u128
) -> Result<(), VMLogicError>
Attach the [TransferAction
] action to an existing receipt. Read more
fn append_action_stake(
&mut self,
receipt_index: u64,
stake: u128,
public_key: Vec<u8>
) -> Result<(), VMLogicError>
fn append_action_stake(
&mut self,
receipt_index: u64,
stake: u128,
public_key: Vec<u8>
) -> Result<(), VMLogicError>
Attach the [StakeAction
] action to an existing receipt. Read more
fn append_action_add_key_with_full_access(
&mut self,
receipt_index: u64,
public_key: Vec<u8>,
nonce: u64
) -> Result<(), VMLogicError>
fn append_action_add_key_with_full_access(
&mut self,
receipt_index: u64,
public_key: Vec<u8>,
nonce: u64
) -> Result<(), VMLogicError>
Attach the [AddKeyAction
] action to an existing receipt. Read more
Attach the [AddKeyAction
] action an existing receipt. Read more
fn append_action_delete_key(
&mut self,
receipt_index: u64,
public_key: Vec<u8>
) -> Result<(), VMLogicError>
fn append_action_delete_key(
&mut self,
receipt_index: u64,
public_key: Vec<u8>
) -> Result<(), VMLogicError>
Attach the [DeleteKeyAction
] action to an existing receipt. Read more
fn append_action_delete_account(
&mut self,
receipt_index: u64,
beneficiary_id: AccountId
) -> Result<(), VMLogicError>
fn append_action_delete_account(
&mut self,
receipt_index: u64,
beneficiary_id: AccountId
) -> Result<(), VMLogicError>
Attach the [DeleteAccountAction
] action to an existing receipt Read more
Returns amount of touched trie nodes by storage operations
Returns the validator stake for given account in the current epoch.
If the account is not a validator, returns None
. Read more
Returns total stake of validators in the current epoch.
Auto Trait Implementations
impl RefUnwindSafe for MockedExternal
impl Send for MockedExternal
impl Sync for MockedExternal
impl Unpin for MockedExternal
impl UnwindSafe for MockedExternal
Blanket Implementations
Mutably borrows from an owned value. Read more