[Deprecation] Remove sp_weights::OldWeight (#3491)

# Description

*Removes `sp_weights::OldWeight` and its usage*

Fixes #144

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
This commit is contained in:
philoniare
2024-02-29 13:17:24 +08:00
committed by GitHub
parent 833bafdbf7
commit a22319cdd5
4 changed files with 47 additions and 84 deletions
+1 -26
View File
@@ -18,9 +18,6 @@
//! # Primitives for transaction weighting.
#![cfg_attr(not(feature = "std"), no_std)]
// TODO remove once `OldWeight` is gone. I dont know why this is needed, maybe by one of the macros
// of `OldWeight`.
#![allow(deprecated)]
extern crate self as sp_weights;
@@ -28,7 +25,7 @@ mod weight_meter;
mod weight_v2;
use bounded_collections::Get;
use codec::{CompactAs, Decode, Encode, MaxEncodedLen};
use codec::{Decode, Encode};
use scale_info::TypeInfo;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
@@ -52,28 +49,6 @@ pub mod constants {
pub const WEIGHT_PROOF_SIZE_PER_KB: u64 = 1024;
}
/// The old weight type.
///
/// NOTE: This type exists purely for compatibility purposes! Use [`weight_v2::Weight`] in all other
/// cases.
#[derive(
Decode,
Encode,
CompactAs,
PartialEq,
Eq,
Clone,
Copy,
RuntimeDebug,
Default,
MaxEncodedLen,
TypeInfo,
)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[deprecated(note = "Will be removed soon; use `Weight` instead.")]
pub struct OldWeight(pub u64);
/// The weight of database operations that the runtime can invoke.
///
/// NOTE: This is currently only measured in computational time, and will probably