Struct near_sdk::test_utils::VMContextBuilder[][src]

pub struct VMContextBuilder {
    pub context: VMContext,
}

Simple VMContext builder that allows to quickly create custom context in tests.

Fields

context: VMContext

Implementations

impl VMContextBuilder[src]

pub fn new() -> Self[src]

pub fn current_account_id(&mut self, account_id: ValidAccountId) -> &mut Self[src]

pub fn signer_account_id(&mut self, account_id: ValidAccountId) -> &mut Self[src]

pub fn signer_account_pk(&mut self, pk: PublicKey) -> &mut Self[src]

pub fn predecessor_account_id(
    &mut self,
    account_id: ValidAccountId
) -> &mut Self
[src]

pub fn block_index(&mut self, block_index: BlockHeight) -> &mut Self[src]

pub fn block_timestamp(&mut self, block_timestamp: u64) -> &mut Self[src]

pub fn epoch_height(&mut self, epoch_height: EpochHeight) -> &mut Self[src]

pub fn account_balance(&mut self, amount: Balance) -> &mut Self[src]

pub fn account_locked_balance(&mut self, amount: Balance) -> &mut Self[src]

pub fn storage_usage(&mut self, usage: StorageUsage) -> &mut Self[src]

pub fn attached_deposit(&mut self, amount: Balance) -> &mut Self[src]

pub fn prepaid_gas(&mut self, gas: Gas) -> &mut Self[src]

pub fn random_seed(&mut self, seed: Vec<u8>) -> &mut Self[src]

pub fn is_view(&mut self, is_view: bool) -> &mut Self[src]

pub fn build(&self) -> VMContext[src]

Trait Implementations

impl Clone for VMContextBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.