Skip to content

Remove 256bit primitives and deprecated calls #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ pub struct UntrackedSymbol<T> {
marker: PhantomData<fn() -> T>,
}

impl<T> UntrackedSymbol<T> {
/// Returns the index to the symbol in the interner table.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn id(&self) -> u32 {
self.id
}
}

impl<T> From<u32> for UntrackedSymbol<T> {
fn from(id: u32) -> Self {
Self {
Expand Down
27 changes: 0 additions & 27 deletions src/portable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ impl PortableRegistry {
self.types.get(id as usize).map(|ty| &ty.ty)
}

/// Returns all types with their associated identifiers.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn types(&self) -> &[PortableType] {
&self.types
}

/// Retains only the portable types needed to express the provided ids.
///
/// The type IDs retained are returned as key to the [`BTreeMap`].
Expand Down Expand Up @@ -249,24 +240,6 @@ impl PortableType {
pub fn new(id: u32, ty: Type<PortableForm>) -> Self {
Self { id, ty }
}

/// Returns the index of the [`PortableType`].
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn id(&self) -> u32 {
self.id
}

/// Returns the type of the [`PortableType`].
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn ty(&self) -> &Type<PortableForm> {
&self.ty
}
}

/// Construct a [`PortableRegistry`].
Expand Down
14 changes: 0 additions & 14 deletions src/ty/composite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,3 @@ where
}
}
}

impl<T> TypeDefComposite<T>
where
T: Form,
{
/// Returns the fields of the composite type.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn fields(&self) -> &[Field<T>] {
&self.fields
}
}
45 changes: 0 additions & 45 deletions src/ty/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,48 +136,3 @@ where
}
}
}

impl<T> Field<T>
where
T: Form,
{
/// Returns the name of the field. None for unnamed fields.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn name(&self) -> Option<&T::String> {
self.name.as_ref()
}

/// Returns the type of the field.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn ty(&self) -> &T::Type {
&self.ty
}

/// Returns a string which is the name of the type of the field as it
/// appears in the source code. The exact contents and format of the type
/// name are not specified, but in practice will be the name of any valid
/// type for a field. This is intended for informational and diagnostic
/// purposes only.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn type_name(&self) -> Option<&T::String> {
self.type_name.as_ref()
}

/// Returns the documentation of the field.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn docs(&self) -> &[T::String] {
&self.docs
}
}
145 changes: 0 additions & 145 deletions src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,47 +157,6 @@ where
}
}

impl<T> Type<T>
where
T: Form,
{
/// Returns the path of the type
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn path(&self) -> &Path<T> {
&self.path
}

/// Returns the generic type parameters of the type
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn type_params(&self) -> &[TypeParameter<T>] {
&self.type_params
}

/// Returns the definition of the type
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn type_def(&self) -> &TypeDef<T> {
&self.type_def
}

/// Returns the documentation of the type
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn docs(&self) -> &[T::String] {
&self.docs
}
}

/// A generic type parameter.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(
Expand Down Expand Up @@ -251,31 +210,6 @@ impl TypeParameter<PortableForm> {
}
}

impl<T> TypeParameter<T>
where
T: Form,
{
/// Get the type of the parameter.
///
/// `None` if the parameter is skipped.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn ty(&self) -> Option<&T::Type> {
self.ty.as_ref()
}

/// Get the name of the parameter.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn name(&self) -> &T::String {
&self.name
}
}

/// The possible types a SCALE encodable Rust value could have.
///
/// # Note
Expand Down Expand Up @@ -399,9 +333,6 @@ pub enum TypeDefPrimitive {
/// `u128`
#[codec(index = 7)]
U128,
/// 256 bits unsigned int (no rust equivalent)
#[codec(index = 8)]
U256,
/// `i8`
#[codec(index = 9)]
I8,
Expand All @@ -417,9 +348,6 @@ pub enum TypeDefPrimitive {
/// `i128`
#[codec(index = 13)]
I128,
/// 256 bits signed int (no rust equivalent)
#[codec(index = 14)]
I256,
}

/// An array type.
Expand Down Expand Up @@ -455,24 +383,6 @@ where
pub fn new(len: u32, type_param: <T as Form>::Type) -> Self {
Self { len, type_param }
}

/// Returns the length of the array type.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn len(&self) -> u32 {
self.len
}

/// Returns the element type of the array type.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn type_param(&self) -> &T::Type {
&self.type_param
}
}

/// A type to refer to tuple types.
Expand Down Expand Up @@ -535,20 +445,6 @@ impl TypeDefTuple<PortableForm> {
}
}

impl<T> TypeDefTuple<T>
where
T: Form,
{
/// Returns the types of the tuple fields.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn fields(&self) -> &[T::Type] {
&self.fields
}
}

/// A type to refer to a sequence of elements of the same type.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(any(feature = "std", feature = "decode"), derive(scale::Decode))]
Expand Down Expand Up @@ -593,15 +489,6 @@ where
pub fn new(type_param: <T as Form>::Type) -> Self {
Self { type_param }
}

/// Returns the element type of the sequence type.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn type_param(&self) -> &T::Type {
&self.type_param
}
}

/// A type wrapped in [`Compact`].
Expand Down Expand Up @@ -633,15 +520,6 @@ where
pub fn new(type_param: <T as Form>::Type) -> Self {
Self { type_param }
}

/// Returns the [`Compact`] wrapped type, i.e. the `T` in `Compact<T>`.
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn type_param(&self) -> &T::Type {
&self.type_param
}
}

/// Type describing a [`bitvec::vec::BitVec`].
Expand Down Expand Up @@ -672,29 +550,6 @@ impl IntoPortable for TypeDefBitSequence {
}
}

impl<T> TypeDefBitSequence<T>
where
T: Form,
{
/// Returns the type of the bit ordering of the [`::bitvec::vec::BitVec`].
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn bit_order_type(&self) -> &T::Type {
&self.bit_order_type
}

/// Returns underlying type used to store the [`::bitvec::vec::BitVec`].
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn bit_store_type(&self) -> &T::Type {
&self.bit_store_type
}
}

impl TypeDefBitSequence {
/// Creates a new [`TypeDefBitSequence`] for the supplied bit order and bit store types.
///
Expand Down
9 changes: 0 additions & 9 deletions src/ty/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,6 @@ where
}
}

/// Returns the segments of the Path
#[deprecated(
since = "2.5.0",
note = "Prefer to access the fields directly; this getter will be removed in the next major version"
)]
pub fn segments(&self) -> &[T::String] {
&self.segments
}

/// Returns `true` if the path is empty
pub fn is_empty(&self) -> bool {
self.segments.is_empty()
Expand Down
Loading