Trait BuilderClient

Source
pub trait BuilderClient<E: Environment>: ContractsBackend<E> {
    // Required methods
    fn bare_call<'life0, 'life1, 'life2, 'async_trait, Args, RetType, Abi>(
        &'life0 mut self,
        caller: &'life1 Keypair,
        message: &'life2 CallBuilderFinal<E, Args, RetType, Abi>,
        value: E::Balance,
        gas_limit: Weight,
        storage_deposit_limit: DepositLimit<E::Balance>,
    ) -> Pin<Box<dyn Future<Output = Result<(Self::EventLog, Option<CallTrace>), Self::Error>> + Send + 'async_trait>>
       where CallBuilderFinal<E, Args, RetType, Abi>: Clone,
             Args: 'async_trait + Sync + AbiEncodeWith<Abi> + Clone,
             RetType: 'async_trait + Send + AbiDecodeWith<Abi>,
             Abi: 'async_trait + Sync + Clone,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn bare_call_dry_run<'life0, 'life1, 'life2, 'async_trait, Args, RetType, Abi>(
        &'life0 mut self,
        caller: &'life1 Keypair,
        message: &'life2 CallBuilderFinal<E, Args, RetType, Abi>,
        value: E::Balance,
        storage_deposit_limit: DepositLimit<E::Balance>,
    ) -> Pin<Box<dyn Future<Output = Result<CallDryRunResult<E, RetType>, Self::Error>> + Send + 'async_trait>>
       where CallBuilderFinal<E, Args, RetType, Abi>: Clone,
             Args: 'async_trait + Sync + AbiEncodeWith<Abi> + Clone,
             RetType: 'async_trait + Send + AbiDecodeWith<Abi>,
             Abi: 'async_trait + Sync + Clone,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn bare_upload<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        contract_name: &'life1 str,
        caller: &'life2 Keypair,
        storage_deposit_limit: E::Balance,
    ) -> Pin<Box<dyn Future<Output = Result<UploadResult<E, Self::EventLog>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn bare_remove_code<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        caller: &'life1 Keypair,
        code_hash: H256,
    ) -> Pin<Box<dyn Future<Output = Result<Self::EventLog, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn bare_instantiate<'life0, 'life1, 'life2, 'life3, 'async_trait, Contract, Args, R, Abi>(
        &'life0 mut self,
        contract_name: &'life1 str,
        caller: &'life2 Keypair,
        constructor: &'life3 mut CreateBuilder<E, Contract, Set<LimitParamsV2>, Set<ExecutionInput<Args, Abi>>, Set<ReturnType<R>>>,
        value: E::Balance,
        gas_limit: Weight,
        storage_deposit_limit: DepositLimit<E::Balance>,
    ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<Self::EventLog>, Self::Error>> + Send + 'async_trait>>
       where Contract: 'async_trait + Clone,
             Args: 'async_trait + Send + Sync + AbiEncodeWith<Abi> + Clone,
             R: 'async_trait,
             Abi: 'async_trait + Send + Sync + Clone,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn bare_instantiate_dry_run<'life0, 'life1, 'life2, 'life3, 'async_trait, Contract, Args, R, Abi>(
        &'life0 mut self,
        contract_name: &'life1 str,
        caller: &'life2 Keypair,
        constructor: &'life3 mut CreateBuilder<E, Contract, Set<LimitParamsV2>, Set<ExecutionInput<Args, Abi>>, Set<ReturnType<R>>>,
        value: E::Balance,
        storage_deposit_limit: DepositLimit<E::Balance>,
    ) -> Pin<Box<dyn Future<Output = Result<InstantiateDryRunResult<E>, Self::Error>> + Send + 'async_trait>>
       where Contract: 'async_trait + Clone,
             Args: 'async_trait + Send + Sync + AbiEncodeWith<Abi> + Clone,
             R: 'async_trait,
             Abi: 'async_trait + Send + Sync + Clone,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn map_account<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        caller: &'life1 Keypair,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn map_account_dry_run<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        caller: &'life1 Keypair,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn bare_call<'life0, 'life1, 'life2, 'async_trait, Args, RetType, Abi>( &'life0 mut self, caller: &'life1 Keypair, message: &'life2 CallBuilderFinal<E, Args, RetType, Abi>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<(Self::EventLog, Option<CallTrace>), Self::Error>> + Send + 'async_trait>>
where CallBuilderFinal<E, Args, RetType, Abi>: Clone, Args: 'async_trait + Sync + AbiEncodeWith<Abi> + Clone, RetType: 'async_trait + Send + AbiDecodeWith<Abi>, Abi: 'async_trait + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Executes a bare call for the contract at account_id. This function does not perform a dry-run, and the user is expected to provide the gas limit.

Use it when you want to have a more precise control over submitting extrinsic.

Returns when the transaction is included in a block. The return value contains all events that are associated with this transaction.

Source

fn bare_call_dry_run<'life0, 'life1, 'life2, 'async_trait, Args, RetType, Abi>( &'life0 mut self, caller: &'life1 Keypair, message: &'life2 CallBuilderFinal<E, Args, RetType, Abi>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<CallDryRunResult<E, RetType>, Self::Error>> + Send + 'async_trait>>
where CallBuilderFinal<E, Args, RetType, Abi>: Clone, Args: 'async_trait + Sync + AbiEncodeWith<Abi> + Clone, RetType: 'async_trait + Send + AbiDecodeWith<Abi>, Abi: 'async_trait + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Executes a dry-run call.

Returns the result of the dry run, together with the decoded return value of the invoked message.

Source

fn bare_upload<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, contract_name: &'life1 str, caller: &'life2 Keypair, storage_deposit_limit: E::Balance, ) -> Pin<Box<dyn Future<Output = Result<UploadResult<E, Self::EventLog>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Uploads the contract call.

This function extracts the binary of the contract for the specified contract.

Calling this function multiple times should be idempotent, the contract is newly instantiated each time using a unique salt. No existing contract instance is reused!

Source

fn bare_remove_code<'life0, 'life1, 'async_trait>( &'life0 mut self, caller: &'life1 Keypair, code_hash: H256, ) -> Pin<Box<dyn Future<Output = Result<Self::EventLog, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Removes the code of the contract at code_hash.

Source

fn bare_instantiate<'life0, 'life1, 'life2, 'life3, 'async_trait, Contract, Args, R, Abi>( &'life0 mut self, contract_name: &'life1 str, caller: &'life2 Keypair, constructor: &'life3 mut CreateBuilder<E, Contract, Set<LimitParamsV2>, Set<ExecutionInput<Args, Abi>>, Set<ReturnType<R>>>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<Self::EventLog>, Self::Error>> + Send + 'async_trait>>
where Contract: 'async_trait + Clone, Args: 'async_trait + Send + Sync + AbiEncodeWith<Abi> + Clone, R: 'async_trait, Abi: 'async_trait + Send + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Bare instantiate call. This function does not perform a dry-run, and user is expected to provide the gas limit.

Use it when you want to have a more precise control over submitting extrinsic.

The function subsequently uploads and instantiates an instance of the contract.

This function extracts the metadata of the contract at the file path target/ink/$contract_name.contract.

Calling this function multiple times should be idempotent, the contract is newly instantiated each time using a unique salt. No existing contract instance is reused!

Source

fn bare_instantiate_dry_run<'life0, 'life1, 'life2, 'life3, 'async_trait, Contract, Args, R, Abi>( &'life0 mut self, contract_name: &'life1 str, caller: &'life2 Keypair, constructor: &'life3 mut CreateBuilder<E, Contract, Set<LimitParamsV2>, Set<ExecutionInput<Args, Abi>>, Set<ReturnType<R>>>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<InstantiateDryRunResult<E>, Self::Error>> + Send + 'async_trait>>
where Contract: 'async_trait + Clone, Args: 'async_trait + Send + Sync + AbiEncodeWith<Abi> + Clone, R: 'async_trait, Abi: 'async_trait + Send + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Dry run contract instantiation.

Source

fn map_account<'life0, 'life1, 'async_trait>( &'life0 mut self, caller: &'life1 Keypair, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

todo

Source

fn map_account_dry_run<'life0, 'life1, 'async_trait>( &'life0 mut self, caller: &'life1 Keypair, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

todo

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<AccountId: Clone + Send + Sync + From<[u8; 32]> + AsRef<[u8; 32]>, S: Sandbox, E: Environment<AccountId = AccountId, Balance = <<S::Runtime as Config>::Currency as Inspect<AccountIdFor<S::Runtime>>>::Balance> + 'static> BuilderClient<E> for ink_e2e::SandboxClient<AccountId, S>
where S::Runtime: Config + Config, AccountIdFor<S::Runtime>: From<[u8; 32]> + AsRef<[u8; 32]>, <<S::Runtime as Config>::Currency as Inspect<AccountIdFor<S::Runtime>>>::Balance: Send + Sync + Into<U256> + TryFrom<U256> + Bounded, MomentOf<S::Runtime>: Into<U256>, <<S as Sandbox>::Runtime as Config>::Hash: IsType<H256>,

Source§

impl<C, E> BuilderClient<E> for ink_e2e::Client<C, E>
where C: Config + Send + Sync, C::AccountId: Clone + Debug + Send + Sync + Display + Codec + From<PublicKey> + DeserializeOwned, C::Address: From<PublicKey> + Send + Sync, C::Signature: From<Signature>, <C::ExtrinsicParams as ExtrinsicParams<C>>::Params: From<<DefaultExtrinsicParams<C> as ExtrinsicParams<C>>::Params>, E: Environment, E::AccountId: Debug + Send + Sync, E::EventRecord: Debug, E::Balance: Clone + Debug + Send + Sync + From<u128> + HasCompact + Serialize, H256: Debug + Send + Sync + Encode,