Metadata V15: Derive TypeInfo for describing runtime types (#13272)

* scale_info: Derive TypeInfo for types present in runtime API

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* cargo: Update Cargo.lock

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-02-02 19:14:40 +02:00
committed by GitHub
parent 25388b267e
commit 4b2cc67fc6
18 changed files with 48 additions and 34 deletions
@@ -16,6 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
async-trait = { version = "0.1.57", optional = true }
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
impl-trait-for-tuples = "0.2.2"
thiserror = { version = "1.0.30", optional = true }
sp-core = { version = "7.0.0", default-features = false, path = "../core" }
@@ -30,6 +31,7 @@ default = [ "std" ]
std = [
"async-trait",
"codec/std",
"scale-info/std",
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
+2 -2
View File
@@ -204,7 +204,7 @@ pub enum Error {
pub type InherentIdentifier = [u8; 8];
/// Inherent data to include in a block.
#[derive(Clone, Default, Encode, Decode)]
#[derive(Clone, Default, Encode, Decode, scale_info::TypeInfo)]
pub struct InherentData {
/// All inherent data encoded with parity-scale-codec and an identifier.
data: BTreeMap<InherentIdentifier, Vec<u8>>,
@@ -276,7 +276,7 @@ impl InherentData {
///
/// When a fatal error occurs, all other errors are removed and the implementation needs to
/// abort checking inherents.
#[derive(Encode, Decode, Clone)]
#[derive(Encode, Decode, Clone, scale_info::TypeInfo)]
pub struct CheckInherentsResult {
/// Did the check succeed?
okay: bool,