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§

source

type Error

Error type.

source

type EventLog

Event log type.

Provided Methods§

source

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");
source

fn upload<'a>( &'a mut self, contract_name: &'a str, caller: &'a Keypair ) -> UploadBuilder<'_, E, Self>
where Self: Sized + BuilderClient<E>,

Start building an upload call.

§Example
let contract = client
    .upload("flipper", &ink_e2e::alice())
    // Optional arguments
    .storage_deposit_limit(100)
    // Submit the call for on-chain execution.
    .submit()
    .await
    .expect("upload failed");
source

fn remove_code<'a>( &'a mut self, caller: &'a Keypair, code_hash: E::Hash ) -> RemoveCodeBuilder<'_, E, Self>
where Self: Sized + BuilderClient<E>,

Start building a remove code call.

§Example
let contract = client
    .remove_code(&ink_e2e::alice(), code_hash)
    // Submit the call for on-chain execution.
    .submit()
    .await
    .expect("remove failed");
source

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");

Implementors§