mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 09:51:10 +00:00
This PR reverts #2280 which introduced `TransactionExtension` to replace `SignedExtension`. As a result of the discussion [here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700), the changes will be reverted for now with plans to reintroduce the concept in the future. --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
This commit is contained in:
@@ -84,7 +84,7 @@ mod test {
|
||||
call_ty: meta_type::<()>(),
|
||||
signature_ty: meta_type::<()>(),
|
||||
extra_ty: meta_type::<()>(),
|
||||
extensions: vec![],
|
||||
signed_extensions: vec![],
|
||||
},
|
||||
ty: meta_type::<()>(),
|
||||
apis: vec![],
|
||||
|
||||
@@ -166,11 +166,10 @@ pub struct ExtrinsicMetadataIR<T: Form = MetaForm> {
|
||||
pub call_ty: T::Type,
|
||||
/// The type of the extrinsic's signature.
|
||||
pub signature_ty: T::Type,
|
||||
/// The type of the outermost Extra/Extensions enum.
|
||||
// TODO: metadata-v16: rename this to `extension_ty`.
|
||||
/// The type of the outermost Extra enum.
|
||||
pub extra_ty: T::Type,
|
||||
/// The transaction extensions in the order they appear in the extrinsic.
|
||||
pub extensions: Vec<TransactionExtensionMetadataIR<T>>,
|
||||
/// The signed extensions in the order they appear in the extrinsic.
|
||||
pub signed_extensions: Vec<SignedExtensionMetadataIR<T>>,
|
||||
}
|
||||
|
||||
impl IntoPortable for ExtrinsicMetadataIR {
|
||||
@@ -184,27 +183,27 @@ impl IntoPortable for ExtrinsicMetadataIR {
|
||||
call_ty: registry.register_type(&self.call_ty),
|
||||
signature_ty: registry.register_type(&self.signature_ty),
|
||||
extra_ty: registry.register_type(&self.extra_ty),
|
||||
extensions: registry.map_into_portable(self.extensions),
|
||||
signed_extensions: registry.map_into_portable(self.signed_extensions),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Metadata of an extrinsic's signed extension.
|
||||
#[derive(Clone, PartialEq, Eq, Encode, Debug)]
|
||||
pub struct TransactionExtensionMetadataIR<T: Form = MetaForm> {
|
||||
pub struct SignedExtensionMetadataIR<T: Form = MetaForm> {
|
||||
/// The unique signed extension identifier, which may be different from the type name.
|
||||
pub identifier: T::String,
|
||||
/// The type of the signed extension, with the data to be included in the extrinsic.
|
||||
pub ty: T::Type,
|
||||
/// The type of the additional signed data, with the data to be included in the signed payload.
|
||||
/// The type of the additional signed data, with the data to be included in the signed payload
|
||||
pub additional_signed: T::Type,
|
||||
}
|
||||
|
||||
impl IntoPortable for TransactionExtensionMetadataIR {
|
||||
type Output = TransactionExtensionMetadataIR<PortableForm>;
|
||||
impl IntoPortable for SignedExtensionMetadataIR {
|
||||
type Output = SignedExtensionMetadataIR<PortableForm>;
|
||||
|
||||
fn into_portable(self, registry: &mut Registry) -> Self::Output {
|
||||
TransactionExtensionMetadataIR {
|
||||
SignedExtensionMetadataIR {
|
||||
identifier: self.identifier.into_portable(registry),
|
||||
ty: registry.register_type(&self.ty),
|
||||
additional_signed: registry.register_type(&self.additional_signed),
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
use super::types::{
|
||||
ExtrinsicMetadataIR, MetadataIR, PalletCallMetadataIR, PalletConstantMetadataIR,
|
||||
PalletErrorMetadataIR, PalletEventMetadataIR, PalletMetadataIR, PalletStorageMetadataIR,
|
||||
StorageEntryMetadataIR, StorageEntryModifierIR, StorageEntryTypeIR, StorageHasherIR,
|
||||
TransactionExtensionMetadataIR,
|
||||
SignedExtensionMetadataIR, StorageEntryMetadataIR, StorageEntryModifierIR, StorageEntryTypeIR,
|
||||
StorageHasherIR,
|
||||
};
|
||||
|
||||
use frame_metadata::v14::{
|
||||
@@ -137,8 +137,8 @@ impl From<PalletErrorMetadataIR> for PalletErrorMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<TransactionExtensionMetadataIR> for SignedExtensionMetadata {
|
||||
fn from(ir: TransactionExtensionMetadataIR) -> Self {
|
||||
impl From<SignedExtensionMetadataIR> for SignedExtensionMetadata {
|
||||
fn from(ir: SignedExtensionMetadataIR) -> Self {
|
||||
SignedExtensionMetadata {
|
||||
identifier: ir.identifier,
|
||||
ty: ir.ty,
|
||||
@@ -152,7 +152,7 @@ impl From<ExtrinsicMetadataIR> for ExtrinsicMetadata {
|
||||
ExtrinsicMetadata {
|
||||
ty: ir.ty,
|
||||
version: ir.version,
|
||||
signed_extensions: ir.extensions.into_iter().map(Into::into).collect(),
|
||||
signed_extensions: ir.signed_extensions.into_iter().map(Into::into).collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::OuterEnumsIR;
|
||||
|
||||
use super::types::{
|
||||
ExtrinsicMetadataIR, MetadataIR, PalletMetadataIR, RuntimeApiMetadataIR,
|
||||
RuntimeApiMethodMetadataIR, RuntimeApiMethodParamMetadataIR, TransactionExtensionMetadataIR,
|
||||
RuntimeApiMethodMetadataIR, RuntimeApiMethodParamMetadataIR, SignedExtensionMetadataIR,
|
||||
};
|
||||
|
||||
use frame_metadata::v15::{
|
||||
@@ -87,8 +87,8 @@ impl From<PalletMetadataIR> for PalletMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<TransactionExtensionMetadataIR> for SignedExtensionMetadata {
|
||||
fn from(ir: TransactionExtensionMetadataIR) -> Self {
|
||||
impl From<SignedExtensionMetadataIR> for SignedExtensionMetadata {
|
||||
fn from(ir: SignedExtensionMetadataIR) -> Self {
|
||||
SignedExtensionMetadata {
|
||||
identifier: ir.identifier,
|
||||
ty: ir.ty,
|
||||
@@ -105,7 +105,7 @@ impl From<ExtrinsicMetadataIR> for ExtrinsicMetadata {
|
||||
call_ty: ir.call_ty,
|
||||
signature_ty: ir.signature_ty,
|
||||
extra_ty: ir.extra_ty,
|
||||
signed_extensions: ir.extensions.into_iter().map(Into::into).collect(),
|
||||
signed_extensions: ir.signed_extensions.into_iter().map(Into::into).collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user