From d6e6c2bf820bd2067aadd7420f361cacaddbb09e Mon Sep 17 00:00:00 2001 From: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Date: Wed, 14 Jun 2023 14:06:45 +0300 Subject: [PATCH] Metadata V15: Enrich extrinsic type info for decoding (#56) * v15/extrinsic: Add extrinsic type info to decode address, call, sig Signed-off-by: Alexandru Vasile * v15/extrinsic: Add extra ty Signed-off-by: Alexandru Vasile * v15/extrinsic: Remove extrinsic ty and add prefix length ty Signed-off-by: Alexandru Vasile * v15/extrinsic: Remove extrinsic len type Signed-off-by: Alexandru Vasile --------- Signed-off-by: Alexandru Vasile --- frame-metadata/src/v15.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/frame-metadata/src/v15.rs b/frame-metadata/src/v15.rs index 644030e..e113545 100644 --- a/frame-metadata/src/v15.rs +++ b/frame-metadata/src/v15.rs @@ -182,10 +182,16 @@ impl IntoPortable for RuntimeApiMethodParamMetadata { serde(bound(serialize = "T::Type: Serialize, T::String: Serialize")) )] pub struct ExtrinsicMetadata { - /// The type of the extrinsic. - pub ty: T::Type, /// Extrinsic version. pub version: u8, + /// The type of the address that signes the extrinsic + pub address_ty: T::Type, + /// The type of the outermost Call enum. + pub call_ty: T::Type, + /// The type of the extrinsic's signature. + pub signature_ty: T::Type, + /// The type of the outermost Extra enum. + pub extra_ty: T::Type, /// The signed extensions in the order they appear in the extrinsic. pub signed_extensions: Vec>, } @@ -195,8 +201,11 @@ impl IntoPortable for ExtrinsicMetadata { fn into_portable(self, registry: &mut Registry) -> Self::Output { ExtrinsicMetadata { - ty: registry.register_type(&self.ty), version: self.version, + address_ty: registry.register_type(&self.address_ty), + call_ty: registry.register_type(&self.call_ty), + signature_ty: registry.register_type(&self.signature_ty), + extra_ty: registry.register_type(&self.extra_ty), signed_extensions: registry.map_into_portable(self.signed_extensions), } }