Struct ink_env::call::CreateParams
source · pub struct CreateParams<E, ContractRef, Args, Salt, R>where
E: Environment,{ /* private fields */ }
Expand description
Builds up contract instantiations.
Implementations§
source§impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, Args, Salt, R>where
E: Environment,
impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, 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, Args, Salt, R>where
E: Environment,
Salt: AsRef<[u8]>,
impl<E, ContractRef, Args, Salt, R> CreateParams<E, ContractRef, 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, 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, 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.