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.
fn balance_of_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
id: AccountId
) -> Result<u64, ApiError>
fn balance_of_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
id: AccountId
) -> Result<u64, ApiError>
Return the balance of the given account id.
A benchmark function that adds one to the given value and returns the result.
fn benchmark_add_one_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
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>
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.
fn benchmark_vector_add_one_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
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>
A benchmark function that adds one to each value in the given vector and returns the result.
fn fail_convert_parameter(
&self,
__runtime_api_at_param__: &BlockId<Block>,
param: DecodeFails<Block>
) -> Result<(), ApiError>
fn fail_convert_parameter(
&self,
__runtime_api_at_param__: &BlockId<Block>,
param: DecodeFails<Block>
) -> Result<(), ApiError>
A function that always fails to convert a parameter between runtime and node.
fn fail_convert_parameter_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
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>
A function that always fails to convert a parameter between runtime and node.
fn fail_convert_return_value(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<DecodeFails<Block>, ApiError>
fn fail_convert_return_value(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<DecodeFails<Block>, ApiError>
A function that always fails to convert its return value between runtime and node.
fn fail_convert_return_value_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<DecodeFails<Block>, ApiError>
fn fail_convert_return_value_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<DecodeFails<Block>, ApiError>
A function that always fails to convert its return value between runtime and node.
A function for that the signature changed in version 2
.
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_before_version_2_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Vec<u64>, ApiError>
A function for that the signature changed in version 2
.
The new signature.
fn function_signature_changed_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
fn function_signature_changed_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
The new signature.
fn fail_on_native_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
fn fail_on_wasm_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
trie no_std testing
fn use_trie_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
fn use_trie_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
trie no_std testing
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>
Returns the initialized block number.
fn get_block_number_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
fn get_block_number_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<u64, ApiError>
Returns the initialized block number.
Takes and returns the initialized block number.
fn take_block_number_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Option<u64>, ApiError>
fn take_block_number_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Option<u64>, ApiError>
Takes and returns the initialized block number.
fn test_ed25519_crypto(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(AppSignature, AppPublic), ApiError>
fn test_ed25519_crypto(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(AppSignature, AppPublic), ApiError>
Test that ed25519
crypto works in the runtime.
Returns the signature generated for the message ed25519
and the public key.
fn test_ed25519_crypto_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(AppSignature, AppPublic), ApiError>
fn test_ed25519_crypto_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(AppSignature, AppPublic), ApiError>
Test that ed25519
crypto works in the runtime.
Returns the signature generated for the message ed25519
and the public key.
fn test_sr25519_crypto(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(AppSignature, AppPublic), ApiError>
fn test_sr25519_crypto(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(AppSignature, AppPublic), ApiError>
Test that sr25519
crypto works in the runtime.
Returns the signature generated for the message sr25519
.
fn test_sr25519_crypto_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(AppSignature, AppPublic), ApiError>
fn test_sr25519_crypto_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(AppSignature, AppPublic), ApiError>
Test that sr25519
crypto works in the runtime.
Returns the signature generated for the message sr25519
.
fn test_ecdsa_crypto(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(AppSignature, AppPublic), ApiError>
fn test_ecdsa_crypto(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(AppSignature, AppPublic), ApiError>
Test that ecdsa
crypto works in the runtime.
Returns the signature generated for the message ecdsa
.
fn test_ecdsa_crypto_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(AppSignature, AppPublic), ApiError>
fn test_ecdsa_crypto_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(AppSignature, AppPublic), ApiError>
Test that ecdsa
crypto works in the runtime.
Returns the signature generated for the message ecdsa
.
Run various tests against storage.
fn test_storage_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(), ApiError>
fn test_storage_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(), ApiError>
Run various tests against storage.
fn test_witness(
&self,
__runtime_api_at_param__: &BlockId<Block>,
proof: StorageProof,
root: Hash
) -> Result<(), ApiError>
fn test_witness(
&self,
__runtime_api_at_param__: &BlockId<Block>,
proof: StorageProof,
root: Hash
) -> Result<(), ApiError>
Check a witness.
fn test_witness_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
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>
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.”
fn do_trace_log_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(), ApiError>
fn do_trace_log_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(), ApiError>
Traces log “Hey I’m runtime.”
Trait Implementations
Implementors
impl<__SR_API_BLOCK__: BlockT + UnwindSafe + RefUnwindSafe, RuntimeApiImplCall: CallApiAt<__SR_API_BLOCK__> + 'static> TestAPI<__SR_API_BLOCK__> for RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall> where
RuntimeApiImplCall::StateBackend: StateBackend<HashFor<__SR_API_BLOCK__>>,
AccountId: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
Vec<u64>: UnwindSafe + RefUnwindSafe,
Vec<u64>: UnwindSafe + RefUnwindSafe,
DecodeFails<__SR_API_BLOCK__>: UnwindSafe + RefUnwindSafe,
DecodeFails<__SR_API_BLOCK__>: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
u32: UnwindSafe + RefUnwindSafe,
Vec<u8>: UnwindSafe + RefUnwindSafe,
u64: UnwindSafe + RefUnwindSafe,
Option<u64>: UnwindSafe + RefUnwindSafe,
(AppSignature, AppPublic): UnwindSafe + RefUnwindSafe,
(AppSignature, AppPublic): UnwindSafe + RefUnwindSafe,
(AppSignature, AppPublic): UnwindSafe + RefUnwindSafe,
StorageProof: UnwindSafe + RefUnwindSafe,
Hash: UnwindSafe + RefUnwindSafe,
Vec<u8>: UnwindSafe + RefUnwindSafe,
Vec<u8>: UnwindSafe + RefUnwindSafe,
u32: UnwindSafe + RefUnwindSafe,
__SR_API_BLOCK__::Header: UnwindSafe + RefUnwindSafe,