Struct near_sdk_sim::UserAccount [−][src]
A user that can sign transactions. It includes a signer and an account id.
Fields
account_id: AccountId
signer: InMemorySigner
Implementations
impl UserAccount
[src]
pub fn account_id(&self) -> AccountId
[src]
Returns a copy of the account_id
pub fn valid_account_id(&self) -> ValidAccountId
[src]
pub fn account(&self) -> Option<Account>
[src]
Look up the account information on chain.
pub fn transfer(&self, to: AccountId, deposit: Balance) -> ExecutionResult
[src]
Transfer yoctoNear to another account
pub fn function_call(
&self,
pending_tx: PendingContractTx,
gas: Gas,
deposit: Balance
) -> ExecutionResult
[src]
&self,
pending_tx: PendingContractTx,
gas: Gas,
deposit: Balance
) -> ExecutionResult
Make a contract call. pending_tx
includes the receiver, the method to call as well as its arguments.
Note: You will most likely not be using this method directly but rather the call!
macro.
pub fn call(
&self,
receiver_id: AccountId,
method: &str,
args: &[u8],
gas: Gas,
deposit: Balance
) -> ExecutionResult
[src]
&self,
receiver_id: AccountId,
method: &str,
args: &[u8],
gas: Gas,
deposit: Balance
) -> ExecutionResult
pub fn deploy(
&self,
wasm_bytes: &[u8],
account_id: AccountId,
deposit: Balance
) -> UserAccount
[src]
&self,
wasm_bytes: &[u8],
account_id: AccountId,
deposit: Balance
) -> UserAccount
Deploy a contract and create its account for account_id
.
Note: You will most likely not be using this method directly but rather the deploy!
macro.
pub fn deploy_and_initialize(
&self,
wasm_bytes: &[u8],
pending_tx: PendingContractTx,
deposit: Balance,
gas: Gas
) -> UserAccount
[src]
&self,
wasm_bytes: &[u8],
pending_tx: PendingContractTx,
deposit: Balance,
gas: Gas
) -> UserAccount
Deploy a contract and in the same transaction call its initialization method.
Note: You will most likely not be using this method directly but rather the deploy!
macro.
pub fn deploy_and_init(
&self,
wasm_bytes: &[u8],
account_id: AccountId,
method: &str,
args: &[u8],
deposit: Balance,
gas: Gas
) -> UserAccount
[src]
&self,
wasm_bytes: &[u8],
account_id: AccountId,
method: &str,
args: &[u8],
deposit: Balance,
gas: Gas
) -> UserAccount
pub fn create_transaction(&self, receiver_id: AccountId) -> UserTransaction
[src]
Create a user transaction to receiver_id
to be signed the current user
pub fn view_method_call(&self, pending_tx: PendingContractTx) -> ViewResult
[src]
Call a view method on a contract.
Note: You will most likely not be using this method directly but rather the view!
macro.
pub fn view(
&self,
receiver_id: AccountId,
method: &str,
args: &[u8]
) -> ViewResult
[src]
&self,
receiver_id: AccountId,
method: &str,
args: &[u8]
) -> ViewResult
pub fn create_user_from(
&self,
signer_user: &UserAccount,
account_id: AccountId,
amount: Balance
) -> UserAccount
[src]
&self,
signer_user: &UserAccount,
account_id: AccountId,
amount: Balance
) -> UserAccount
Creates a user and is signed by the signer_user
pub fn create_user(&self, account_id: AccountId, amount: Balance) -> UserAccount
[src]
Create a new user where the signer is this user account
pub fn borrow_runtime(&self) -> Ref<'_, RuntimeStandalone>
[src]
Returns a reference to a memory location of the standalone runtime.
Examples
let master_account = near_sdk_sim::init_simulator(None); let runtime = master_account.borrow_runtime(); // with use let _block = runtime.current_block();
pub fn borrow_runtime_mut(&self) -> RefMut<'_, RuntimeStandalone>
[src]
Returns a mutable memory location to the standalone runtime.
Examples
let master_account = near_sdk_sim::init_simulator(None); let mut runtime = master_account.borrow_runtime_mut(); // with use runtime.produce_block().unwrap();
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for UserAccount
impl !Send for UserAccount
impl !Sync for UserAccount
impl Unpin for UserAccount
impl !UnwindSafe for UserAccount
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,