Skip to content

Commit

Permalink
remove deprecated Weight::from_{ref_time, proof_size}
Browse files Browse the repository at this point in the history
  • Loading branch information
OverOrion committed May 26, 2023
1 parent d0d86e3 commit ca889b4
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 52 deletions.
10 changes: 5 additions & 5 deletions claims/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ pub trait WeightInfo {
pub struct TestWeightInfo;
impl WeightInfo for TestWeightInfo {
fn claim() -> Weight {
Weight::from_ref_time(0)
Weight::from_parts(0, 0u64)
}
fn mint_claim() -> Weight {
Weight::from_ref_time(0)
Weight::from_parts(0, 0u64)
}
fn claim_attest() -> Weight {
Weight::from_ref_time(0)
Weight::from_parts(0, 0u64)
}
fn attest() -> Weight {
Weight::from_ref_time(0)
Weight::from_parts(0, 0u64)
}
fn move_claim() -> Weight {
Weight::from_ref_time(0)
Weight::from_parts(0, 0u64)
}
}

Expand Down
2 changes: 1 addition & 1 deletion parentchain/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pub trait WeightInfo {
/// Weights for pallet_parentchain using the Integritee parachain node and recommended hardware.
impl WeightInfo for () {
fn set_block() -> Weight {
Weight::from_ref_time(10_000)
Weight::from_parts(10_000, 0u64)
}
}
4 changes: 2 additions & 2 deletions sidechain/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait WeightInfo {
pub struct IntegriteeWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
fn confirm_imported_sidechain_block() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand All @@ -39,7 +39,7 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// For tests
impl WeightInfo for () {
fn confirm_imported_sidechain_block() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
.saturating_add(RocksDbWeight::get().reads(1))
.saturating_add(RocksDbWeight::get().writes(2))
}
Expand Down
16 changes: 8 additions & 8 deletions teeracle/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@ pub trait WeightInfo {
pub struct IntegriteeWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
fn add_to_whitelist() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
fn remove_from_whitelist() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
fn update_exchange_rate() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
fn update_oracle() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
}
// For tests
impl WeightInfo for () {
fn add_to_whitelist() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
fn remove_from_whitelist() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
fn update_exchange_rate() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
fn update_oracle() -> Weight {
Weight::from_ref_time(46_200_000)
Weight::from_parts(46_200_000, 0u64)
}
}
72 changes: 36 additions & 36 deletions teerex/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `336`
// Estimated: `4481`
// Minimum execution time: 1_340_798 nanoseconds.
Weight::from_ref_time(1_465_198_000)
.saturating_add(Weight::from_proof_size(4481))
Weight::from_parts(1_465_198_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 4481))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -90,8 +90,8 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `94`
// Estimated: `597`
// Minimum execution time: 1_421_398 nanoseconds.
Weight::from_ref_time(1_605_297_000)
.saturating_add(Weight::from_proof_size(597))
Weight::from_parts(1_605_297_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 597))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -104,8 +104,8 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `94`
// Estimated: `597`
// Minimum execution time: 1_591_698 nanoseconds.
Weight::from_ref_time(1_901_097_000)
.saturating_add(Weight::from_proof_size(597))
Weight::from_parts(1_901_097_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 597))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -128,8 +128,8 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `457`
// Estimated: `9680`
// Minimum execution time: 2_856_095 nanoseconds.
Weight::from_ref_time(3_253_895_000)
.saturating_add(Weight::from_proof_size(9680))
Weight::from_parts(3_253_895_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 9680))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -144,8 +144,8 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `504`
// Estimated: `6957`
// Minimum execution time: 44_600 nanoseconds.
Weight::from_ref_time(45_600_000)
.saturating_add(Weight::from_proof_size(6957))
Weight::from_parts(45_600_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 6957))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(5))
}
Expand All @@ -154,7 +154,7 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 17_100 nanoseconds.
Weight::from_ref_time(17_300_000).saturating_add(Weight::from_proof_size(0))
Weight::from_parts(17_300_000, 0u64).saturating_add(Weight::from_parts(0u64, 0))
}
/// Storage: Teerex EnclaveIndex (r:1 w:0)
/// Proof Skipped: Teerex EnclaveIndex (max_values: None, max_size: None, mode: Measured)
Expand All @@ -163,8 +163,8 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `242`
// Estimated: `2717`
// Minimum execution time: 25_400 nanoseconds.
Weight::from_ref_time(29_300_000)
.saturating_add(Weight::from_proof_size(2717))
Weight::from_parts(29_300_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 2717))
.saturating_add(T::DbWeight::get().reads(1))
}
/// Storage: Teerex EnclaveIndex (r:1 w:0)
Expand All @@ -180,17 +180,17 @@ impl<T: frame_system::Config> WeightInfo for IntegriteeWeight<T> {
// Measured: `362`
// Estimated: `8511 + t * (2475 ±0)`
// Minimum execution time: 37_200 nanoseconds.
Weight::from_ref_time(43_344_069)
.saturating_add(Weight::from_proof_size(8511))
Weight::from_parts(43_344_069, 0u64)
.saturating_add(Weight::from_parts(0u64, 8511))
// Standard Error: 9_065
.saturating_add(Weight::from_ref_time(2_808).saturating_mul(l.into()))
.saturating_add(Weight::from_parts(2_808, 0u64).saturating_mul(l.into()))
// Standard Error: 198_651
.saturating_add(Weight::from_ref_time(2_508_713).saturating_mul(t.into()))
.saturating_add(Weight::from_parts(2_508_713, 0u64).saturating_mul(t.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into())))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into())))
.saturating_add(Weight::from_proof_size(2475).saturating_mul(t.into()))
.saturating_add(Weight::from_parts(0u64, 2475).saturating_mul(t.into()))
}
}

Expand All @@ -209,8 +209,8 @@ impl WeightInfo for () {
// Measured: `299`
// Estimated: `4370`
// Minimum execution time: 1_512_300 nanoseconds.
Weight::from_ref_time(2_591_400_000)
.saturating_add(Weight::from_proof_size(4370))
Weight::from_parts(2_591_400_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 4370))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(1))
}
Expand All @@ -223,8 +223,8 @@ impl WeightInfo for () {
// Measured: `57`
// Estimated: `560`
// Minimum execution time: 1_816_099 nanoseconds.
Weight::from_ref_time(3_147_800_000)
.saturating_add(Weight::from_proof_size(560))
Weight::from_parts(3_147_800_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 560))
.saturating_add(RocksDbWeight::get().reads(1))
.saturating_add(RocksDbWeight::get().writes(1))
}
Expand All @@ -237,8 +237,8 @@ impl WeightInfo for () {
// Measured: `57`
// Estimated: `560`
// Minimum execution time: 1_562_200 nanoseconds.
Weight::from_ref_time(1_847_900_000)
.saturating_add(Weight::from_proof_size(560))
Weight::from_parts(1_847_900_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 560))
.saturating_add(RocksDbWeight::get().reads(1))
.saturating_add(RocksDbWeight::get().writes(1))
}
Expand All @@ -261,8 +261,8 @@ impl WeightInfo for () {
// Measured: `420`
// Estimated: `9458`
// Minimum execution time: 3_071_800 nanoseconds.
Weight::from_ref_time(4_260_200_000)
.saturating_add(Weight::from_proof_size(9458))
Weight::from_parts(4_260_200_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 9458))
.saturating_add(RocksDbWeight::get().reads(6))
.saturating_add(RocksDbWeight::get().writes(3))
}
Expand All @@ -277,8 +277,8 @@ impl WeightInfo for () {
// Measured: `504`
// Estimated: `6957`
// Minimum execution time: 50_600 nanoseconds.
Weight::from_ref_time(51_200_000)
.saturating_add(Weight::from_proof_size(6957))
Weight::from_parts(51_200_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 6957))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(5))
}
Expand All @@ -287,7 +287,7 @@ impl WeightInfo for () {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 21_800 nanoseconds.
Weight::from_ref_time(26_600_000).saturating_add(Weight::from_proof_size(0))
Weight::from_parts(26_600_000, 0u64).saturating_add(Weight::from_parts(0u64, 0))
}
/// Storage: Teerex EnclaveIndex (r:1 w:0)
/// Proof Skipped: Teerex EnclaveIndex (max_values: None, max_size: None, mode: Measured)
Expand All @@ -296,8 +296,8 @@ impl WeightInfo for () {
// Measured: `242`
// Estimated: `2717`
// Minimum execution time: 27_800 nanoseconds.
Weight::from_ref_time(28_700_000)
.saturating_add(Weight::from_proof_size(2717))
Weight::from_parts(28_700_000, 0u64)
.saturating_add(Weight::from_parts(0u64, 2717))
.saturating_add(RocksDbWeight::get().reads(1))
}
/// Storage: Teerex EnclaveIndex (r:1 w:0)
Expand All @@ -313,16 +313,16 @@ impl WeightInfo for () {
// Measured: `362`
// Estimated: `8511 + t * (2475 ±0)`
// Minimum execution time: 41_400 nanoseconds.
Weight::from_ref_time(28_179_644)
.saturating_add(Weight::from_proof_size(8511))
Weight::from_parts(28_179_644, 0u64)
.saturating_add(Weight::from_parts(0u64, 8511))
// Standard Error: 21_336
.saturating_add(Weight::from_ref_time(318_271).saturating_mul(l.into()))
.saturating_add(Weight::from_parts(318_271, 0u64).saturating_mul(l.into()))
// Standard Error: 467_546
.saturating_add(Weight::from_ref_time(7_329_090).saturating_mul(t.into()))
.saturating_add(Weight::from_parts(7_329_090, 0u64).saturating_mul(t.into()))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(t.into())))
.saturating_add(RocksDbWeight::get().writes(1))
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(t.into())))
.saturating_add(Weight::from_proof_size(2475).saturating_mul(t.into()))
.saturating_add(Weight::from_parts(0u64, 2475).saturating_mul(t.into()))
}
}

0 comments on commit ca889b4

Please sign in to comment.