Type Definition sp_version::ApiId
source · pub type ApiId = [u8; 8];
Expand description
The identity of a particular API interface that the runtime might provide.
The id is generated by hashing the name of the runtime api with BLAKE2 using a hash size of 8 bytes.
The name of the runtime api is the name of the trait when using decl_runtime_apis!
macro. So,
in the following runtime api declaration:
decl_runtime_apis! {
trait TestApi {
fn do_test();
}
}
The name of the trait would be TestApi
and would be taken as input to the BLAKE2 hash
function.
As Rust supports renaming of traits, the name of a runtime api given to impl_runtime_apis!
doesn’t need to be the same as in decl_runtime_apis!
, but only the name in
decl_runtime_apis!
is the important one!