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> Freeze for CreateParams<E, ContractRef, Limits, Args, Salt, R>
where <E as Environment>::Hash: Freeze, Limits: Freeze, <E as Environment>::Balance: Freeze, Salt: Freeze, Args: Freeze,

§

impl<E, ContractRef, Limits, Args, Salt, R> RefUnwindSafe for CreateParams<E, ContractRef, Limits, Args, Salt, R>

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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
§

impl<T> SaturatedConversion for T

§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

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

§

fn vzip(self) -> V