Struct ink_env::call::CreateParams

source ·
pub struct CreateParams<E, ContractRef, Limits, Args, Salt, R>where
    E: Environment,{ /* private fields */ }
Expand description

Builds up contract instantiations.

Implementations§

source§

impl<E, ContractRef, Limits, Args, Salt, R> CreateParams<E, ContractRef, Limits, Args, Salt, R>where E: Environment,

source

pub fn code_hash(&self) -> &E::Hash

The code hash of the contract.

source

pub fn endowment(&self) -> &E::Balance

The endowment for the instantiated contract.

source

pub fn exec_input(&self) -> &ExecutionInput<Args>

The raw encoded input data.

source

pub fn update_selector(&mut self, selector: Selector)

Modify the selector.

Useful when using the CreateParams generated as part of the ContractRef, but using a custom selector.

source§

impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, LimitParamsV2<E>, Args, Salt, R>where E: Environment,

source

pub fn ref_time_limit(&self) -> u64

Gets the ref_time_limit part of the weight limit for the contract instantiation.

source

pub fn proof_size_limit(&self) -> u64

Gets the proof_size_limit part of the weight limit for the contract instantiation.

source

pub fn storage_deposit_limit(&self) -> Option<&E::Balance>

Gets the storage_deposit_limit for the contract instantiation.

source§

impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, LimitParamsV1, Args, Salt, R>where E: Environment,

source

pub fn gas_limit(&self) -> u64

The gas limit for the contract instantiation.

source§

impl<E, ContractRef, Limits, Args, Salt, R> CreateParams<E, ContractRef, Limits, Args, Salt, R>where E: Environment, Salt: AsRef<[u8]>,

source

pub fn salt_bytes(&self) -> &Salt

The salt for determining the hash for the contract account ID.

source§

impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, LimitParamsV2<E>, Args, Salt, R>where E: Environment, ContractRef: FromAccountId<E>, Args: Encode, Salt: AsRef<[u8]>, R: ConstructorReturnType<ContractRef>,

source

pub fn instantiate(&self) -> <R as ConstructorReturnType<ContractRef>>::Output

Instantiates the contract and returns its account ID back to the caller.

Panics

This method panics if it encounters an ink::env::Error or an [ink::primitives::LangError][ink_primitives::LangError]. If you want to handle those use the try_instantiate method instead.

source

pub fn try_instantiate( &self ) -> Result<ConstructorResult<<R as ConstructorReturnType<ContractRef>>::Output>, Error>

Instantiates the contract and returns its account ID back to the caller.

Note

On failure this returns an outer ink::env::Error or inner [ink::primitives::LangError][ink_primitives::LangError], both of which can be handled by the caller.

source§

impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, LimitParamsV1, Args, Salt, R>where E: Environment, ContractRef: FromAccountId<E>, Args: Encode, Salt: AsRef<[u8]>, R: ConstructorReturnType<ContractRef>,

source

pub fn instantiate(&self) -> <R as ConstructorReturnType<ContractRef>>::Output

Instantiates the contract and returns its account ID back to the caller.

Panics

This method panics if it encounters an ink::env::Error or an [ink::primitives::LangError][ink_primitives::LangError]. If you want to handle those use the try_instantiate method instead.

source

pub fn try_instantiate( &self ) -> Result<ConstructorResult<<R as ConstructorReturnType<ContractRef>>::Output>, Error>

Instantiates the contract and returns its account ID back to the caller.

Note

On failure this returns an outer ink::env::Error or inner [ink::primitives::LangError][ink_primitives::LangError], both of which can be handled by the caller.

Trait Implementations§

source§

impl<E, ContractRef: Debug, Limits: Debug, Args: Debug, Salt: Debug, R: Debug> Debug for CreateParams<E, ContractRef, Limits, Args, Salt, R>where E: Environment + Debug, E::Hash: Debug, E::Balance: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E, ContractRef, Limits, Args, Salt, R> RefUnwindSafe for CreateParams<E, ContractRef, Limits, Args, Salt, R>where Args: RefUnwindSafe, Limits: RefUnwindSafe, Salt: RefUnwindSafe, <E as Environment>::Balance: RefUnwindSafe, <E as Environment>::Hash: RefUnwindSafe,

§

impl<E, ContractRef, Limits, Args, Salt, R> Send for CreateParams<E, ContractRef, Limits, Args, Salt, R>where Args: Send, Limits: Send, Salt: Send, <E as Environment>::Balance: Send, <E as Environment>::Hash: Send,

§

impl<E, ContractRef, Limits, Args, Salt, R> Sync for CreateParams<E, ContractRef, Limits, Args, Salt, R>where Args: Sync, Limits: Sync, Salt: Sync, <E as Environment>::Balance: Sync, <E as Environment>::Hash: Sync,

§

impl<E, ContractRef, Limits, Args, Salt, R> Unpin for CreateParams<E, ContractRef, Limits, Args, Salt, R>where Args: Unpin, Limits: Unpin, Salt: Unpin, <E as Environment>::Balance: Unpin, <E as Environment>::Hash: Unpin,

§

impl<E, ContractRef, Limits, Args, Salt, R> UnwindSafe for CreateParams<E, ContractRef, Limits, Args, Salt, R>where Args: UnwindSafe, Limits: UnwindSafe, Salt: UnwindSafe, <E as Environment>::Balance: UnwindSafe, <E as Environment>::Hash: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V