pub trait TestAPI<Block: BlockT>: Core<Block> {
Show 21 methods
    // Provided methods
    fn balance_of(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        id: AccountId,
    ) -> Result<u64, ApiError> { ... }
    fn benchmark_add_one(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        val: &u64,
    ) -> Result<u64, ApiError> { ... }
    fn benchmark_vector_add_one(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vec: &Vec<u64>,
    ) -> Result<Vec<u64>, ApiError> { ... }
    fn function_signature_changed_before_version_2(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<Vec<u64>, ApiError> { ... }
    fn function_signature_changed(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<u64, ApiError> { ... }
    fn use_trie(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<u64, ApiError> { ... }
    fn benchmark_indirect_call(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<u64, ApiError> { ... }
    fn benchmark_direct_call(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<u64, ApiError> { ... }
    fn vec_with_capacity(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        size: u32,
    ) -> Result<Vec<u8>, ApiError> { ... }
    fn get_block_number(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<u64, ApiError> { ... }
    fn test_ed25519_crypto(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError> { ... }
    fn test_sr25519_crypto(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError> { ... }
    fn test_ecdsa_crypto(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError> { ... }
    fn test_bls381_crypto(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<(Bls381Pop, Bls381Public), ApiError> { ... }
    fn test_ecdsa_bls381_crypto(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<(EcdsaBls381Pop, EcdsaBls381Public), ApiError> { ... }
    fn test_storage(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<(), ApiError> { ... }
    fn test_witness(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        proof: StorageProof,
        root: Hash,
    ) -> Result<(), ApiError> { ... }
    fn test_multiple_arguments(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        data: Vec<u8>,
        other: Vec<u8>,
        num: u32,
    ) -> Result<(), ApiError> { ... }
    fn do_trace_log(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<(), ApiError> { ... }
    fn verify_ed25519(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        sig: Signature,
        public: Public,
        message: Vec<u8>,
    ) -> Result<bool, ApiError> { ... }
    fn write_key_value(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        key: Vec<u8>,
        value: Vec<u8>,
        panic: bool,
    ) -> Result<(), ApiError> { ... }
}Provided Methods§
Sourcefn balance_of(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
    id: AccountId,
) -> Result<u64, ApiError>
 
fn balance_of( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, id: AccountId, ) -> Result<u64, ApiError>
Return the balance of the given account id.
Sourcefn benchmark_add_one(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
    val: &u64,
) -> Result<u64, ApiError>
 
fn benchmark_add_one( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, val: &u64, ) -> Result<u64, ApiError>
A benchmark function that adds one to the given value and returns the result.
Sourcefn benchmark_vector_add_one(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
    vec: &Vec<u64>,
) -> Result<Vec<u64>, ApiError>
 
fn benchmark_vector_add_one( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, vec: &Vec<u64>, ) -> Result<Vec<u64>, ApiError>
A benchmark function that adds one to each value in the given vector and returns the result.
Sourcefn function_signature_changed_before_version_2(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<u64>, ApiError>
 👎Deprecated
fn function_signature_changed_before_version_2( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<u64>, ApiError>
A function for that the signature changed in version 2.
Sourcefn function_signature_changed(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u64, ApiError>
 
fn function_signature_changed( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u64, ApiError>
The new signature.
Sourcefn use_trie(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u64, ApiError>
 
fn use_trie( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u64, ApiError>
trie no_std testing
Sourcefn benchmark_indirect_call(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u64, ApiError>
 
fn benchmark_indirect_call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u64, ApiError>
Calls function in the loop using never-inlined function pointer
Sourcefn benchmark_direct_call(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u64, ApiError>
 
fn benchmark_direct_call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u64, ApiError>
Calls function in the loop
Sourcefn vec_with_capacity(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
    size: u32,
) -> Result<Vec<u8>, ApiError>
 
fn vec_with_capacity( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, size: u32, ) -> Result<Vec<u8>, ApiError>
Allocates vector with given capacity.
Sourcefn get_block_number(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u64, ApiError>
 
fn get_block_number( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u64, ApiError>
Returns the initialized block number.
Sourcefn test_ed25519_crypto(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError>
 
fn test_ed25519_crypto( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError>
Test that ed25519 crypto works in the runtime.
Returns the signature generated for the message ed25519 both the public key and proof of possession.
Sourcefn test_sr25519_crypto(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError>
 
fn test_sr25519_crypto( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError>
Test that sr25519 crypto works in the runtime.
Returns the signature generated for the message sr25519 both the public key and proof of possession.
Sourcefn test_ecdsa_crypto(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError>
 
fn test_ecdsa_crypto( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(AppSignature, AppPublic, AppProofOfPossession), ApiError>
Test that ecdsa crypto works in the runtime.
Returns the signature generated for the message ecdsa both the public key and proof of possession.
Sourcefn test_bls381_crypto(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Bls381Pop, Bls381Public), ApiError>
 
fn test_bls381_crypto( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(Bls381Pop, Bls381Public), ApiError>
Test that bls381 crypto works in the runtime
Returns both the proof of possession and public key.
Sourcefn test_ecdsa_bls381_crypto(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(EcdsaBls381Pop, EcdsaBls381Public), ApiError>
 
fn test_ecdsa_bls381_crypto( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(EcdsaBls381Pop, EcdsaBls381Public), ApiError>
Test that ecdsa_bls381_crypto works in the runtime
Returns both the proof of possession and public key.
Sourcefn test_storage(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(), ApiError>
 
fn test_storage( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(), ApiError>
Run various tests against storage.
Sourcefn test_witness(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
    proof: StorageProof,
    root: Hash,
) -> Result<(), ApiError>
 
fn test_witness( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, proof: StorageProof, root: Hash, ) -> Result<(), ApiError>
Check a witness.
Sourcefn test_multiple_arguments(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
    data: Vec<u8>,
    other: Vec<u8>,
    num: u32,
) -> Result<(), ApiError>
 
fn test_multiple_arguments( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, data: Vec<u8>, other: Vec<u8>, num: u32, ) -> Result<(), ApiError>
Test that ensures that we can call a function that takes multiple arguments.
Sourcefn do_trace_log(
    &self,
    __runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(), ApiError>
 
fn do_trace_log( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(), ApiError>
Traces log “Hey I’m runtime.”