Trait ink_e2e::ContractsBackend
source · pub trait ContractsBackend<E: Environment> {
type Error;
type EventLog;
// Provided methods
fn instantiate<'a, Contract: Clone, Args: Send + Clone + Encode + Sync, R>(
&'a mut self,
contract_name: &'a str,
caller: &'a Keypair,
constructor: &'a mut CreateBuilder<E, Contract, Unset<<E as Environment>::Hash>, Set<LimitParamsV2<E>>, Unset<<E as Environment>::Balance>, Set<ExecutionInput<Args>>, Unset<Salt>, Set<ReturnType<R>>>
) -> InstantiateBuilder<'a, E, Contract, Args, R, Self>
where Self: Sized + BuilderClient<E> { ... }
fn upload<'a>(
&'a mut self,
contract_name: &'a str,
caller: &'a Keypair
) -> UploadBuilder<'_, E, Self>
where Self: Sized + BuilderClient<E> { ... }
fn remove_code<'a>(
&'a mut self,
caller: &'a Keypair,
code_hash: E::Hash
) -> RemoveCodeBuilder<'_, E, Self>
where Self: Sized + BuilderClient<E> { ... }
fn call<'a, Args: Sync + Encode + Clone, RetType: Send + Decode>(
&'a mut self,
caller: &'a Keypair,
message: &'a CallBuilderFinal<E, Args, RetType>
) -> CallBuilder<'a, E, Args, RetType, Self>
where Self: Sized + BuilderClient<E> { ... }
}
Expand description
Contract-specific operations.
Required Associated Types§
Provided Methods§
sourcefn instantiate<'a, Contract: Clone, Args: Send + Clone + Encode + Sync, R>(
&'a mut self,
contract_name: &'a str,
caller: &'a Keypair,
constructor: &'a mut CreateBuilder<E, Contract, Unset<<E as Environment>::Hash>, Set<LimitParamsV2<E>>, Unset<<E as Environment>::Balance>, Set<ExecutionInput<Args>>, Unset<Salt>, Set<ReturnType<R>>>
) -> InstantiateBuilder<'a, E, Contract, Args, R, Self>where
Self: Sized + BuilderClient<E>,
fn instantiate<'a, Contract: Clone, Args: Send + Clone + Encode + Sync, R>(
&'a mut self,
contract_name: &'a str,
caller: &'a Keypair,
constructor: &'a mut CreateBuilder<E, Contract, Unset<<E as Environment>::Hash>, Set<LimitParamsV2<E>>, Unset<<E as Environment>::Balance>, Set<ExecutionInput<Args>>, Unset<Salt>, Set<ReturnType<R>>>
) -> InstantiateBuilder<'a, E, Contract, Args, R, Self>where
Self: Sized + BuilderClient<E>,
Start building an instantiate call using a builder pattern.
§Example
ⓘ
// Constructor method
let mut constructor = FlipperRef::new(false);
let contract = client
.instantiate("flipper", &ink_e2e::alice(), &mut constructor)
// Optional arguments
// Send 100 units with the call.
.value(100)
// Add 10% margin to the gas limit
.extra_gas_portion(10)
.storage_deposit_limit(100)
// Submit the call for on-chain execution.
.submit()
.await
.expect("instantiate failed");
sourcefn upload<'a>(
&'a mut self,
contract_name: &'a str,
caller: &'a Keypair
) -> UploadBuilder<'_, E, Self>where
Self: Sized + BuilderClient<E>,
fn upload<'a>(
&'a mut self,
contract_name: &'a str,
caller: &'a Keypair
) -> UploadBuilder<'_, E, Self>where
Self: Sized + BuilderClient<E>,
sourcefn remove_code<'a>(
&'a mut self,
caller: &'a Keypair,
code_hash: E::Hash
) -> RemoveCodeBuilder<'_, E, Self>where
Self: Sized + BuilderClient<E>,
fn remove_code<'a>(
&'a mut self,
caller: &'a Keypair,
code_hash: E::Hash
) -> RemoveCodeBuilder<'_, E, Self>where
Self: Sized + BuilderClient<E>,
sourcefn call<'a, Args: Sync + Encode + Clone, RetType: Send + Decode>(
&'a mut self,
caller: &'a Keypair,
message: &'a CallBuilderFinal<E, Args, RetType>
) -> CallBuilder<'a, E, Args, RetType, Self>where
Self: Sized + BuilderClient<E>,
fn call<'a, Args: Sync + Encode + Clone, RetType: Send + Decode>(
&'a mut self,
caller: &'a Keypair,
message: &'a CallBuilderFinal<E, Args, RetType>
) -> CallBuilder<'a, E, Args, RetType, Self>where
Self: Sized + BuilderClient<E>,
Start building a call using a builder pattern.
§Example
ⓘ
// Message method
let get = call_builder.get();
let get_res = client
.call(&ink_e2e::bob(), &get)
// Optional arguments
// Send 100 units with the call.
.value(100)
// Add 10% margin to the gas limit
.extra_gas_portion(10)
.storage_deposit_limit(100)
// Submit the call for on-chain execution.
.submit()
.await
.expect("instantiate failed");