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,
impl<E, ContractRef, Limits, Args, Salt, R> CreateParams<E, ContractRef, Limits, Args, Salt, R>where E: Environment,
sourcepub fn exec_input(&self) -> &ExecutionInput<Args>
pub fn exec_input(&self) -> &ExecutionInput<Args>
The raw encoded input data.
sourcepub fn update_selector(&mut self, selector: Selector)
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,
impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, LimitParamsV2<E>, Args, Salt, R>where E: Environment,
sourcepub fn ref_time_limit(&self) -> u64
pub fn ref_time_limit(&self) -> u64
Gets the ref_time_limit
part of the weight limit for the contract instantiation.
sourcepub fn proof_size_limit(&self) -> u64
pub fn proof_size_limit(&self) -> u64
Gets the proof_size_limit
part of the weight limit for the contract
instantiation.
sourcepub fn storage_deposit_limit(&self) -> Option<&E::Balance>
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,
impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, LimitParamsV1, Args, Salt, R>where E: Environment,
source§impl<E, ContractRef, Limits, Args, Salt, R> CreateParams<E, ContractRef, Limits, Args, Salt, R>where
E: Environment,
Salt: AsRef<[u8]>,
impl<E, ContractRef, Limits, Args, Salt, R> CreateParams<E, ContractRef, Limits, Args, Salt, R>where E: Environment, Salt: AsRef<[u8]>,
sourcepub fn salt_bytes(&self) -> &Salt
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>,
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>,
sourcepub fn instantiate(&self) -> <R as ConstructorReturnType<ContractRef>>::Output
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.
sourcepub fn try_instantiate(
&self
) -> Result<ConstructorResult<<R as ConstructorReturnType<ContractRef>>::Output>, Error>
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>,
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>,
sourcepub fn instantiate(&self) -> <R as ConstructorReturnType<ContractRef>>::Output
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.
sourcepub fn try_instantiate(
&self
) -> Result<ConstructorResult<<R as ConstructorReturnType<ContractRef>>::Output>, Error>
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.