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 <alexandru.vasile@parity.io>

* v15/extrinsic: Add extra ty

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

* v15/extrinsic: Remove extrinsic ty and add prefix length ty

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

* v15/extrinsic: Remove extrinsic len type

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-06-14 14:06:45 +03:00
committed by GitHub
parent 4912047c47
commit d6e6c2bf82
+12 -3
View File
@@ -182,10 +182,16 @@ impl IntoPortable for RuntimeApiMethodParamMetadata {
serde(bound(serialize = "T::Type: Serialize, T::String: Serialize"))
)]
pub struct ExtrinsicMetadata<T: Form = MetaForm> {
/// 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<SignedExtensionMetadata<T>>,
}
@@ -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),
}
}