Trait substrate_test_runtime::TestAPI[][src]

pub trait TestAPI<Block: BlockT>: Core<Block> {
Show methods fn balance_of(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        id: AccountId
    ) -> Result<u64, ApiError> { ... }
fn balance_of_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        id: AccountId
    ) -> Result<u64, ApiError> { ... }
fn benchmark_add_one(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        val: &u64
    ) -> Result<u64, ApiError> { ... }
fn benchmark_add_one_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        val: &u64
    ) -> Result<u64, ApiError> { ... }
fn benchmark_vector_add_one(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        vec: &Vec<u64>
    ) -> Result<Vec<u64>, ApiError> { ... }
fn benchmark_vector_add_one_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        vec: &Vec<u64>
    ) -> Result<Vec<u64>, ApiError> { ... }
fn fail_convert_parameter(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        param: DecodeFails<Block>
    ) -> Result<(), ApiError> { ... }
fn fail_convert_parameter_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        param: DecodeFails<Block>
    ) -> Result<(), ApiError> { ... }
fn fail_convert_return_value(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<DecodeFails<Block>, ApiError> { ... }
fn fail_convert_return_value_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<DecodeFails<Block>, ApiError> { ... }
fn function_signature_changed_before_version_2(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<Vec<u64>, ApiError> { ... }
fn function_signature_changed_before_version_2_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<Vec<u64>, ApiError> { ... }
fn function_signature_changed(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<u64, ApiError> { ... }
fn function_signature_changed_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<u64, ApiError> { ... }
fn fail_on_native(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<u64, ApiError> { ... }
fn fail_on_native_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<u64, ApiError> { ... }
fn fail_on_wasm(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<u64, ApiError> { ... }
fn fail_on_wasm_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<u64, ApiError> { ... }
fn use_trie(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<u64, ApiError> { ... }
fn use_trie_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<u64, ApiError> { ... }
fn benchmark_indirect_call(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<u64, ApiError> { ... }
fn benchmark_indirect_call_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<u64, ApiError> { ... }
fn benchmark_direct_call(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<u64, ApiError> { ... }
fn benchmark_direct_call_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<u64, ApiError> { ... }
fn vec_with_capacity(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        size: u32
    ) -> Result<Vec<u8>, ApiError> { ... }
fn vec_with_capacity_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        size: u32
    ) -> Result<Vec<u8>, ApiError> { ... }
fn get_block_number(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<u64, ApiError> { ... }
fn get_block_number_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<u64, ApiError> { ... }
fn take_block_number(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<Option<u64>, ApiError> { ... }
fn take_block_number_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<Option<u64>, ApiError> { ... }
fn test_ed25519_crypto(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<(AppSignature, AppPublic), ApiError> { ... }
fn test_ed25519_crypto_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<(AppSignature, AppPublic), ApiError> { ... }
fn test_sr25519_crypto(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<(AppSignature, AppPublic), ApiError> { ... }
fn test_sr25519_crypto_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<(AppSignature, AppPublic), ApiError> { ... }
fn test_ecdsa_crypto(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<(AppSignature, AppPublic), ApiError> { ... }
fn test_ecdsa_crypto_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<(AppSignature, AppPublic), ApiError> { ... }
fn test_storage(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<(), ApiError> { ... }
fn test_storage_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<(), ApiError> { ... }
fn test_witness(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        proof: StorageProof,
        root: Hash
    ) -> Result<(), ApiError> { ... }
fn test_witness_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        proof: StorageProof,
        root: Hash
    ) -> Result<(), ApiError> { ... }
fn test_multiple_arguments(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        data: Vec<u8>,
        other: Vec<u8>,
        num: u32
    ) -> Result<(), ApiError> { ... }
fn test_multiple_arguments_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        data: Vec<u8>,
        other: Vec<u8>,
        num: u32
    ) -> Result<(), ApiError> { ... }
fn do_trace_log(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<(), ApiError> { ... }
fn do_trace_log_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<(), ApiError> { ... }
}

Provided methods

Return the balance of the given account id.

Return the balance of the given account id.

A benchmark function that adds one to the given value and returns the result.

A benchmark function that adds one to the given value and returns the result.

A benchmark function that adds one to each value in the given vector and returns the result.

A benchmark function that adds one to each value in the given vector and returns the result.

A function that always fails to convert a parameter between runtime and node.

A function that always fails to convert a parameter between runtime and node.

A function that always fails to convert its return value between runtime and node.

A function that always fails to convert its return value between runtime and node.

👎 Deprecated

A function for that the signature changed in version 2.

👎 Deprecated

A function for that the signature changed in version 2.

The new signature.

The new signature.

trie no_std testing

trie no_std testing

Returns the initialized block number.

Returns the initialized block number.

Takes and returns the initialized block number.

Takes and returns the initialized block number.

Test that ed25519 crypto works in the runtime.

Returns the signature generated for the message ed25519 and the public key.

Test that ed25519 crypto works in the runtime.

Returns the signature generated for the message ed25519 and the public key.

Test that sr25519 crypto works in the runtime.

Returns the signature generated for the message sr25519.

Test that sr25519 crypto works in the runtime.

Returns the signature generated for the message sr25519.

Test that ecdsa crypto works in the runtime.

Returns the signature generated for the message ecdsa.

Test that ecdsa crypto works in the runtime.

Returns the signature generated for the message ecdsa.

Run various tests against storage.

Run various tests against storage.

Check a witness.

Check a witness.

Test that ensures that we can call a function that takes multiple arguments.

Test that ensures that we can call a function that takes multiple arguments.

Traces log “Hey I’m runtime.”

Traces log “Hey I’m runtime.”

Trait Implementations

The identifier of the runtime api.

The version of the runtime api.

Implementors