diff --git a/frame-metadata/src/v14.rs b/frame-metadata/src/v14.rs index 72cf250..2592a9b 100644 --- a/frame-metadata/src/v14.rs +++ b/frame-metadata/src/v14.rs @@ -27,7 +27,7 @@ use codec::Encode; use scale_info::prelude::vec::Vec; use scale_info::{ form::{Form, MetaForm, PortableForm}, - meta_type, IntoPortable, PortableRegistry, Registry, TypeInfo, + IntoPortable, PortableRegistry, Registry, }; /// Current prefix of metadata @@ -434,57 +434,3 @@ impl IntoPortable for PalletErrorMetadata { } } } - -/// A type specification. -/// -/// This contains the actual type as well as an optional compile-time -/// known displayed representation of the type. This is useful for cases -/// where the type is used through a type alias in order to provide -/// information about the alias name. -/// -/// # Examples -/// -/// Consider the following Rust function: -/// ```no_compile -/// fn is_sorted(input: &[i32], pred: Predicate) -> bool; -/// ``` -/// In this above example `input` would have no displayable name, -/// `pred`'s display name is `Predicate` and the display name of -/// the return type is simply `bool`. Note that `Predicate` could -/// simply be a type alias to `fn(i32, i32) -> Ordering`. -#[derive(Clone, PartialEq, Eq, Encode)] -#[cfg_attr(feature = "std", derive(Decode, Serialize, Debug))] -#[cfg_attr( - feature = "std", - serde(bound(serialize = "T::Type: Serialize, T::String: Serialize")) -)] -pub struct TypeSpec { - /// The actual type. - pub ty: T::Type, - /// The compile-time known displayed representation of the type. - pub name: T::String, -} - -impl IntoPortable for TypeSpec { - type Output = TypeSpec; - - fn into_portable(self, registry: &mut Registry) -> Self::Output { - TypeSpec { - ty: registry.register_type(&self.ty), - name: self.name.into_portable(registry), - } - } -} - -impl TypeSpec { - /// Creates a new type specification with a display name. - pub fn new(name: &'static str) -> Self - where - T: TypeInfo + 'static, - { - Self { - ty: meta_type::(), - name, - } - } -}