Expand description
Module for the logic behind ink!’s End-to-End testing framework.
Re-exports§
pub use subxt;
pub use subxt_signer;
pub use tokio;
pub use tracing;
pub use tracing_subscriber;
Modules§
Structs§
- Bare
Instantiation Result - Result of a contract instantiation using bare call.
- Call
Builder - Allows to build an end-to-end call using a builder pattern.
- Call
DryRun Result - Result of the dry run of a contract call.
- Call
Result - Result of a contract call.
- Call
Trace - A smart contract execution call trace.
- Client
- The
Client
takes care of communicating with the node. - Contract
Result - Result type of a
bare_call
,bare_instantiate
,ReviveApi::call
, andReviveApi::instantiate
. - Contracts
Registry - Registry of contracts that can be loaded.
- Instantiate
Builder - Allows to build an end-to-end instantiation call using a builder pattern.
- Instantiate
DryRun Result - Result of the dry run of a contract call.
- Instantiation
Result - Result of a contract instantiation.
- Keypair
- An sr25519 keypair implementation. While the API is slightly different, the logic for
this has been taken from
sp_core::sr25519
and we test against this to ensure conformity. - RpcClient
- A concrete wrapper around an [
RpcClientT
] which provides some higher level helper methods and is cheaply cloneable. - Test
Node Process - Spawn a local substrate node for testing.
- Test
Node Process Builder - Construct a test node process.
- Upload
Result - Result of a contract upload.
- Weight
Enums§
- Polkadot
Config - Default set of commonly used types by Polkadot nodes.
- Sr25519
Keyring - Set of test accounts.
Constants§
- LOG_
PREFIX - This prefix will be used for log output. It is set by each
#[ink_e2e::test]
with the function name as String. This way it is possible to distinguish the lines in stdout and stderr, to still know which line belongs to which test.
Statics§
- INIT
- We use this to only initialize
env_logger
once.
Traits§
- Builder
Client - Chain
Backend - General chain operations useful in contract testing.
- Contracts
Backend - Contract-specific operations.
- E2EBackend
- Full E2E testing backend: combines general chain API and contract-specific operations.
Functions§
- account_
id - Get an ink! [
ink_primitives::AccountId
] for a given keyring account. - address
- Returns the [
ink::Address
] for a given keyring account. - address_
from_ account_ id - Returns the [
ink::Address
] for a given account id. - address_
from_ keypair - Returns the [
ink::Address
] for a givenKeypair
. - alice
- Equivalent to
{DEV_PHRASE}//Alice
. - bob
- Equivalent to
{DEV_PHRASE}//Bob
. - build_
root_ and_ contract_ dependencies - Builds the “root” contract (the contract in which the E2E tests are defined) together with any contracts which are a dependency of the root contract.
- charlie
- Equivalent to
{DEV_PHRASE}//Charlie
. - code_
hash - Returns the
H256
hash of the code slice. - constructor_
exec_ input - Get the encoded constructor arguments from the partially initialized
CreateBuilder
- create_
call_ builder - Creates a call builder for
Contract
, based on an account id. - create_
call_ builder_ abi - Creates a call builder for
Contract
for the specified ABI, based on an account id. - dave
- Equivalent to
{DEV_PHRASE}//Dave
. - eve
- Equivalent to
{DEV_PHRASE}//Eve
. - ferdie
- Equivalent to
{DEV_PHRASE}//Ferdie
. - keypair_
to_ account - Transforms a
Keypair
into an account id. - log_
error - Writes
msg
to stderr. - log_
info - Writes
msg
to stdout. - log_
prefix - Returns the name of the test which is currently executed.
- one
- Equivalent to
{DEV_PHRASE}//One
. - salt
- Generates a unique salt based on the system time.
- two
- Equivalent to
{DEV_PHRASE}//Two
.
Type Aliases§
- Call
Builder Final - Represents an initialized contract message builder.
- Contract
Exec Result For - Alias for the contract exec result.
- Create
Builder Partial - The type returned from
ContractRef
constructors, partially initialized with the execution input arguments. - Error
Attribute Macros§
- test
- Defines an End-to-End test.