Trait BuilderClient

Source
pub trait BuilderClient<E: Environment>: ContractsBackend<E> {
Show 14 methods // 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 + DecodeMessageResult<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, Abi>, Self::Error>> + Send + 'async_trait>> where CallBuilderFinal<E, Args, RetType, Abi>: Clone, Args: 'async_trait + Sync + AbiEncodeWith<Abi> + Clone, RetType: 'async_trait + Send + DecodeMessageResult<Abi>, Abi: 'async_trait + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn raw_call_dry_run<'life0, 'life1, 'async_trait, RetType, Abi>( &'life0 mut self, dest: H160, input_data: Vec<u8>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, signer: &'life1 Keypair, ) -> Pin<Box<dyn Future<Output = Result<CallDryRunResult<E, RetType, Abi>, Self::Error>> + Send + 'async_trait>> where RetType: 'async_trait + Send + DecodeMessageResult<Abi>, Abi: 'async_trait + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn raw_call<'life0, 'life1, 'async_trait>( &'life0 mut self, dest: H160, input_data: Vec<u8>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, signer: &'life1 Keypair, ) -> Pin<Box<dyn Future<Output = Result<(Self::EventLog, Option<CallTrace>), Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn bare_upload<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, contract_name: &'life1 str, caller: &'life2 Keypair, storage_deposit_limit: Option<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, 'async_trait, Contract, Args, R, Abi>( &'life0 mut self, code: Vec<u8>, caller: &'life1 Keypair, constructor: &'life2 mut CreateBuilder<E, Contract, Set<LimitParamsV2>, Set<ExecutionInput<Args, Abi>>, Set<ReturnType<R>>, Abi>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<E, 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; fn raw_instantiate<'life0, 'life1, 'async_trait>( &'life0 mut self, code: Vec<u8>, caller: &'life1 Keypair, constructor: Vec<u8>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<E, Self::EventLog>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn raw_instantiate_dry_run<'life0, 'life1, 'async_trait, Abi>( &'life0 mut self, code: Vec<u8>, caller: &'life1 Keypair, constructor: Vec<u8>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<InstantiateDryRunResult<E, Abi>, Self::Error>> + Send + 'async_trait>> where Abi: 'async_trait + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn exec_instantiate<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, signer: &'life1 Keypair, contract_name: &'life2 str, data: Vec<u8>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: E::Balance, ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<E, Self::EventLog>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: '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>>, Abi>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<InstantiateDryRunResult<E, Abi>, 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<Option<Self::EventLog>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn to_account_id<'life0, 'life1, 'async_trait>( &'life0 mut self, addr: &'life1 H160, ) -> Pin<Box<dyn Future<Output = Result<E::AccountId, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn load_code(&self, contract_name: &str) -> Vec<u8> ;
}

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 + DecodeMessageResult<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, Abi>, Self::Error>> + Send + 'async_trait>>
where CallBuilderFinal<E, Args, RetType, Abi>: Clone, Args: 'async_trait + Sync + AbiEncodeWith<Abi> + Clone, RetType: 'async_trait + Send + DecodeMessageResult<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.

Important: For an uncomplicated UX of the E2E testing environment we decided to automatically map the account in pallet-revive, if not yet mapped. This is a side effect, as a transaction is then issued on-chain and the user incurs costs!

Source

fn raw_call_dry_run<'life0, 'life1, 'async_trait, RetType, Abi>( &'life0 mut self, dest: H160, input_data: Vec<u8>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, signer: &'life1 Keypair, ) -> Pin<Box<dyn Future<Output = Result<CallDryRunResult<E, RetType, Abi>, Self::Error>> + Send + 'async_trait>>
where RetType: 'async_trait + Send + DecodeMessageResult<Abi>, Abi: 'async_trait + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes a dry-run call.

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

Important: For an uncomplicated UX of the E2E testing environment we decided to automatically map the account in pallet-revive, if not yet mapped. This is a side effect, as a transaction is then issued on-chain and the user incurs costs!

Source

fn raw_call<'life0, 'life1, 'async_trait>( &'life0 mut self, dest: H160, input_data: Vec<u8>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, signer: &'life1 Keypair, ) -> Pin<Box<dyn Future<Output = Result<(Self::EventLog, Option<CallTrace>), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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: Option<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, 'async_trait, Contract, Args, R, Abi>( &'life0 mut self, code: Vec<u8>, caller: &'life1 Keypair, constructor: &'life2 mut CreateBuilder<E, Contract, Set<LimitParamsV2>, Set<ExecutionInput<Args, Abi>>, Set<ReturnType<R>>, Abi>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<E, 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,

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 raw_instantiate<'life0, 'life1, 'async_trait>( &'life0 mut self, code: Vec<u8>, caller: &'life1 Keypair, constructor: Vec<u8>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<E, Self::EventLog>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn raw_instantiate_dry_run<'life0, 'life1, 'async_trait, Abi>( &'life0 mut self, code: Vec<u8>, caller: &'life1 Keypair, constructor: Vec<u8>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<InstantiateDryRunResult<E, Abi>, Self::Error>> + Send + 'async_trait>>
where Abi: 'async_trait + Sync + Clone, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn exec_instantiate<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, signer: &'life1 Keypair, contract_name: &'life2 str, data: Vec<u8>, value: E::Balance, gas_limit: Weight, storage_deposit_limit: E::Balance, ) -> Pin<Box<dyn Future<Output = Result<BareInstantiationResult<E, Self::EventLog>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

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>>, Abi>, value: E::Balance, storage_deposit_limit: DepositLimit<E::Balance>, ) -> Pin<Box<dyn Future<Output = Result<InstantiateDryRunResult<E, Abi>, 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.

Important: For an uncomplicated UX of the E2E testing environment we decided to automatically map the account in pallet-revive, if not yet mapped. This is a side effect, as a transaction is then issued on-chain and the user incurs costs!

Source

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

Checks if caller was already mapped in pallet-revive. If not, it will do so and return the events associated with that transaction.

Source

fn to_account_id<'life0, 'life1, 'async_trait>( &'life0 mut self, addr: &'life1 H160, ) -> Pin<Box<dyn Future<Output = Result<E::AccountId, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the Environment::AccountId for an H160 address.

Source

fn load_code(&self, contract_name: &str) -> Vec<u8>

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>::Nonce: Into<u32>, <<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> + From<[u8; 32]> + 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,