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>
impl<E, ContractRef, Limits, Args, Salt, R> CreateParams<E, ContractRef, Limits, Args, Salt, R>
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.
Trait Implementations§
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>where
<E as Environment>::Hash: RefUnwindSafe,
Limits: RefUnwindSafe,
<E as Environment>::Balance: RefUnwindSafe,
Salt: RefUnwindSafe,
Args: RefUnwindSafe,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.