pub struct CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment,{ /* private fields */ }
Expand description
Builds up contract instantiations.
Implementations§
source§impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment,
impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment,
sourcepub fn code_hash(
self,
code_hash: H256,
) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
pub fn code_hash( self, code_hash: H256, ) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
Sets the used code hash for the contract instantiation.
source§impl<E, ContractRef, Args, RetType> CreateBuilder<E, ContractRef, Set<LimitParamsV2>, Args, RetType>where
E: Environment,
impl<E, ContractRef, Args, RetType> CreateBuilder<E, ContractRef, Set<LimitParamsV2>, Args, RetType>where
E: Environment,
sourcepub fn ref_time_limit(self, ref_time_limit: u64) -> Self
pub fn ref_time_limit(self, ref_time_limit: u64) -> Self
Sets the ref_time_limit
part of the weight limit for the contract instantiation.
sourcepub fn proof_size_limit(self, proof_size_limit: u64) -> Self
pub fn proof_size_limit(self, proof_size_limit: u64) -> Self
Sets the proof_size_limit
part of the weight limit for the contract
instantiation.
sourcepub fn storage_deposit_limit(self, storage_deposit_limit: U256) -> Self
pub fn storage_deposit_limit(self, storage_deposit_limit: U256) -> Self
Sets the storage_deposit_limit
for the contract instantiation.
source§impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment,
impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment,
sourcepub fn endowment(
self,
endowment: U256,
) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
pub fn endowment( self, endowment: U256, ) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
Sets the value transferred upon the execution of the call.
source§impl<E, ContractRef, Limits, RetType> CreateBuilder<E, ContractRef, Limits, Unset<ExecutionInput<EmptyArgumentList>>, RetType>where
E: Environment,
impl<E, ContractRef, Limits, RetType> CreateBuilder<E, ContractRef, Limits, Unset<ExecutionInput<EmptyArgumentList>>, RetType>where
E: Environment,
sourcepub fn exec_input<Args>(
self,
exec_input: ExecutionInput<Args>,
) -> CreateBuilder<E, ContractRef, Limits, Set<ExecutionInput<Args>>, RetType>
pub fn exec_input<Args>( self, exec_input: ExecutionInput<Args>, ) -> CreateBuilder<E, ContractRef, Limits, Set<ExecutionInput<Args>>, RetType>
Sets the value transferred upon the execution of the call.
source§impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment,
impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment,
sourcepub fn salt_bytes(
self,
salt: Option<[u8; 32]>,
) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
pub fn salt_bytes( self, salt: Option<[u8; 32]>, ) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
Sets the salt used for the execution of the call.
source§impl<E, ContractRef, Limits, Args> CreateBuilder<E, ContractRef, Limits, Args, Unset<ReturnType<()>>>where
E: Environment,
impl<E, ContractRef, Limits, Args> CreateBuilder<E, ContractRef, Limits, Args, Unset<ReturnType<()>>>where
E: Environment,
sourcepub fn returns<R>(
self,
) -> CreateBuilder<E, ContractRef, Limits, Args, Set<ReturnType<R>>>where
ContractRef: FromAddr,
R: ConstructorReturnType<ContractRef>,
pub fn returns<R>(
self,
) -> CreateBuilder<E, ContractRef, Limits, Args, Set<ReturnType<R>>>where
ContractRef: FromAddr,
R: ConstructorReturnType<ContractRef>,
Sets the type of the returned value upon the execution of the constructor.
§Note
Constructors are not able to return arbitrary values. Instead, a successful call to a constructor returns the address at which the contract was instantiated.
Therefore this must always be a reference (i.e. ContractRef
) to the contract
you’re trying to instantiate.
source§impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Set<Limits>, Set<ExecutionInput<Args>>, Set<ReturnType<RetType>>>where
E: Environment,
impl<E, ContractRef, Limits, Args, RetType> CreateBuilder<E, ContractRef, Set<Limits>, Set<ExecutionInput<Args>>, Set<ReturnType<RetType>>>where
E: Environment,
sourcepub fn params(self) -> CreateParams<E, ContractRef, Limits, Args, RetType>
pub fn params(self) -> CreateParams<E, ContractRef, Limits, Args, RetType>
Finalizes the CreateBuilder
, allowing it to instantiate a contract.
source§impl<E, ContractRef, Args, RetType> CreateBuilder<E, ContractRef, Set<LimitParamsV2>, Set<ExecutionInput<Args>>, Set<ReturnType<RetType>>>where
E: Environment,
ContractRef: FromAddr + ContractReverseReference,
<ContractRef as ContractReverseReference>::Type: ContractConstructorDecoder + ContractMessageDecoder,
Args: Encode,
RetType: ConstructorReturnType<ContractRef>,
impl<E, ContractRef, Args, RetType> CreateBuilder<E, ContractRef, Set<LimitParamsV2>, Set<ExecutionInput<Args>>, Set<ReturnType<RetType>>>where
E: Environment,
ContractRef: FromAddr + ContractReverseReference,
<ContractRef as ContractReverseReference>::Type: ContractConstructorDecoder + ContractMessageDecoder,
Args: Encode,
RetType: ConstructorReturnType<ContractRef>,
sourcepub fn instantiate(
self,
) -> <RetType as ConstructorReturnType<ContractRef>>::Output
pub fn instantiate( self, ) -> <RetType as ConstructorReturnType<ContractRef>>::Output
todo check comment 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<<RetType as ConstructorReturnType<ContractRef>>::Output>, Error>
pub fn try_instantiate( self, ) -> Result<ConstructorResult<<RetType as ConstructorReturnType<ContractRef>>::Output>, Error>
todo check comment 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: Clone, Limits: Clone, Args: Clone, RetType: Clone> Clone for CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment + Clone,
impl<E, ContractRef: Clone, Limits: Clone, Args: Clone, RetType: Clone> Clone for CreateBuilder<E, ContractRef, Limits, Args, RetType>where
E: Environment + Clone,
source§fn clone(&self) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
fn clone(&self) -> CreateBuilder<E, ContractRef, Limits, Args, RetType>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<E, ContractRef, Limits, Args, RetType> Freeze for CreateBuilder<E, ContractRef, Limits, Args, RetType>
impl<E, ContractRef, Limits, Args, RetType> RefUnwindSafe for CreateBuilder<E, ContractRef, Limits, Args, RetType>
impl<E, ContractRef, Limits, Args, RetType> Send for CreateBuilder<E, ContractRef, Limits, Args, RetType>
impl<E, ContractRef, Limits, Args, RetType> Sync for CreateBuilder<E, ContractRef, Limits, Args, RetType>
impl<E, ContractRef, Limits, Args, RetType> Unpin for CreateBuilder<E, ContractRef, Limits, Args, RetType>
impl<E, ContractRef, Limits, Args, RetType> UnwindSafe for CreateBuilder<E, ContractRef, Limits, Args, RetType>
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> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for 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, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§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
.