Struct ink_lang::EnvAccess [−][src]
A typed accessor to the environment.
This allows ink! messages to make use of the environment efficiently and user friendly while also maintaining access invariants.
Implementations
impl<'a, T> EnvAccess<'a, T> where
T: Environment,
<T as Environment>::ChainExtension: ChainExtensionInstance,
[src]
T: Environment,
<T as Environment>::ChainExtension: ChainExtensionInstance,
pub fn extension(
self
) -> <<T as Environment>::ChainExtension as ChainExtensionInstance>::Instance
[src]
self
) -> <<T as Environment>::ChainExtension as ChainExtensionInstance>::Instance
Allows to call one of the available defined chain extension methods.
impl<'a, T> EnvAccess<'a, T> where
T: Environment,
[src]
T: Environment,
pub fn caller(self) -> T::AccountId
[src]
Returns the address of the caller of the executed contract.
Note
For more details visit: ink_env::caller
pub fn transferred_balance(self) -> T::Balance
[src]
Returns the transferred balance for the contract execution.
Note
For more details visit: ink_env::transferred_balance
pub fn weight_to_fee(self, gas: u64) -> T::Balance
[src]
Returns the price for the specified amount of gas.
Note
For more details visit: ink_env::weight_to_fee
pub fn gas_left(self) -> T::Balance
[src]
Returns the amount of gas left for the contract execution.
Note
For more details visit: ink_env::gas_left
pub fn block_timestamp(self) -> T::Timestamp
[src]
pub fn account_id(self) -> T::AccountId
[src]
pub fn balance(self) -> T::Balance
[src]
pub fn rent_allowance(self) -> T::Balance
[src]
Returns the current rent allowance for the executed contract.
Note
For more details visit: ink_env::rent_allowance
pub fn block_number(self) -> T::BlockNumber
[src]
pub fn minimum_balance(self) -> T::Balance
[src]
Returns the minimum balance that is required for creating an account.
Note
For more details visit: ink_env::minimum_balance
pub fn tombstone_deposit(self) -> T::Balance
[src]
Returns the tombstone deposit for the contracts chain.
Note
For more details visit: ink_env::tombstone_deposit
pub fn set_rent_allowance(self, new_value: T::Balance)
[src]
Sets the rent allowance of the executed contract to the new value.
Note
For more details visit: ink_env::set_rent_allowance
pub fn invoke_contract<Args>(
self,
params: &CallParams<T, Args, ()>
) -> Result<()> where
Args: Encode,
[src]
self,
params: &CallParams<T, Args, ()>
) -> Result<()> where
Args: Encode,
pub fn eval_contract<Args, R>(
self,
params: &CallParams<T, Args, ReturnType<R>>
) -> Result<R> where
Args: Encode,
R: Decode,
[src]
self,
params: &CallParams<T, Args, ReturnType<R>>
) -> Result<R> where
Args: Encode,
R: Decode,
Evaluates a contract message and returns its result.
Note
For more details visit: ink_env::eval_contract
pub fn instantiate_contract<Args, Salt, C>(
self,
params: &CreateParams<T, Args, Salt, C>
) -> Result<T::AccountId> where
Args: Encode,
Salt: AsRef<[u8]>,
[src]
self,
params: &CreateParams<T, Args, Salt, C>
) -> Result<T::AccountId> where
Args: Encode,
Salt: AsRef<[u8]>,
pub fn restore_contract(
self,
account_id: T::AccountId,
code_hash: T::Hash,
rent_allowance: T::Balance,
filtered_keys: &[Key]
)
[src]
self,
account_id: T::AccountId,
code_hash: T::Hash,
rent_allowance: T::Balance,
filtered_keys: &[Key]
)
Restores a smart contract in tombstone state.
Note
For more details visit: ink_env::restore_contract
pub fn terminate_contract(self, beneficiary: T::AccountId) -> !
[src]
Terminates the existence of a smart contract.
Note
For more details visit: ink_env::terminate_contract
pub fn transfer(
self,
destination: T::AccountId,
value: T::Balance
) -> Result<()>
[src]
self,
destination: T::AccountId,
value: T::Balance
) -> Result<()>
Transfers value from the contract to the destination account ID.
Note
For more details visit: ink_env::transfer
pub fn random(self, subject: &[u8]) -> T::Hash
[src]
pub fn hash_bytes<H>(self, input: &[u8]) -> <H as HashOutput>::Type where
H: CryptoHash,
[src]
H: CryptoHash,
Computes the hash of the given bytes using the cryptographic hash H
.
Note
For more details visit: ink_env::hash_bytes
pub fn hash_encoded<H, V>(self, value: &V) -> <H as HashOutput>::Type where
H: CryptoHash,
V: Encode,
[src]
H: CryptoHash,
V: Encode,
Computes the hash of the given SCALE encoded value using the cryptographic hash H
.
Note
For more details visit: ink_env::hash_encoded
Trait Implementations
impl<'a, T: Clone> Clone for EnvAccess<'a, T>
[src]
impl<'a, T: Copy> Copy for EnvAccess<'a, T>
[src]
impl<'a, E> Debug for EnvAccess<'a, E>
[src]
impl<'a, T> Default for EnvAccess<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for EnvAccess<'a, T>
impl<'a, T> Send for EnvAccess<'a, T>
impl<'a, T> Sync for EnvAccess<'a, T>
impl<'a, T> Unpin for EnvAccess<'a, T>
impl<'a, T> UnwindSafe for EnvAccess<'a, T>
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,