diff --git a/runtimes/assets/statemine/src/weights/block_weights.rs b/runtimes/assets/statemine/src/weights/block_weights.rs index 7d4a931bd1..c004307336 100644 --- a/runtimes/assets/statemine/src/weights/block_weights.rs +++ b/runtimes/assets/statemine/src/weights/block_weights.rs @@ -39,11 +39,14 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100u64 * constants::WEIGHT_PER_MICROS, + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. - assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/runtimes/assets/statemine/src/weights/extrinsic_weights.rs b/runtimes/assets/statemine/src/weights/extrinsic_weights.rs index 6c6b4a497d..3ce6b73d58 100644 --- a/runtimes/assets/statemine/src/weights/extrinsic_weights.rs +++ b/runtimes/assets/statemine/src/weights/extrinsic_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/runtimes/assets/statemine/src/weights/paritydb_weights.rs b/runtimes/assets/statemine/src/weights/paritydb_weights.rs index 8083ccb400..dca7d34831 100644 --- a/runtimes/assets/statemine/src/weights/paritydb_weights.rs +++ b/runtimes/assets/statemine/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/assets/statemine/src/weights/rocksdb_weights.rs b/runtimes/assets/statemine/src/weights/rocksdb_weights.rs index 1db87f143f..87867ebfe1 100644 --- a/runtimes/assets/statemine/src/weights/rocksdb_weights.rs +++ b/runtimes/assets/statemine/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/assets/statemint/src/weights/block_weights.rs b/runtimes/assets/statemint/src/weights/block_weights.rs index 7d4a931bd1..c004307336 100644 --- a/runtimes/assets/statemint/src/weights/block_weights.rs +++ b/runtimes/assets/statemint/src/weights/block_weights.rs @@ -39,11 +39,14 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100u64 * constants::WEIGHT_PER_MICROS, + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. - assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/runtimes/assets/statemint/src/weights/extrinsic_weights.rs b/runtimes/assets/statemint/src/weights/extrinsic_weights.rs index 6c6b4a497d..3ce6b73d58 100644 --- a/runtimes/assets/statemint/src/weights/extrinsic_weights.rs +++ b/runtimes/assets/statemint/src/weights/extrinsic_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/runtimes/assets/statemint/src/weights/paritydb_weights.rs b/runtimes/assets/statemint/src/weights/paritydb_weights.rs index 8083ccb400..dca7d34831 100644 --- a/runtimes/assets/statemint/src/weights/paritydb_weights.rs +++ b/runtimes/assets/statemint/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/assets/statemint/src/weights/rocksdb_weights.rs b/runtimes/assets/statemint/src/weights/rocksdb_weights.rs index 1db87f143f..87867ebfe1 100644 --- a/runtimes/assets/statemint/src/weights/rocksdb_weights.rs +++ b/runtimes/assets/statemint/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/assets/westmint/src/weights/block_weights.rs b/runtimes/assets/westmint/src/weights/block_weights.rs index 7d4a931bd1..c004307336 100644 --- a/runtimes/assets/westmint/src/weights/block_weights.rs +++ b/runtimes/assets/westmint/src/weights/block_weights.rs @@ -39,11 +39,14 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100u64 * constants::WEIGHT_PER_MICROS, + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. - assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/runtimes/assets/westmint/src/weights/extrinsic_weights.rs b/runtimes/assets/westmint/src/weights/extrinsic_weights.rs index 6c6b4a497d..3ce6b73d58 100644 --- a/runtimes/assets/westmint/src/weights/extrinsic_weights.rs +++ b/runtimes/assets/westmint/src/weights/extrinsic_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/runtimes/assets/westmint/src/weights/paritydb_weights.rs b/runtimes/assets/westmint/src/weights/paritydb_weights.rs index 8083ccb400..dca7d34831 100644 --- a/runtimes/assets/westmint/src/weights/paritydb_weights.rs +++ b/runtimes/assets/westmint/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/assets/westmint/src/weights/rocksdb_weights.rs b/runtimes/assets/westmint/src/weights/rocksdb_weights.rs index 1db87f143f..87867ebfe1 100644 --- a/runtimes/assets/westmint/src/weights/rocksdb_weights.rs +++ b/runtimes/assets/westmint/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs b/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs index 7d4a931bd1..c004307336 100644 --- a/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs +++ b/runtimes/collectives/collectives-polkadot/src/weights/block_weights.rs @@ -39,11 +39,14 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100u64 * constants::WEIGHT_PER_MICROS, + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. - assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs b/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs index 6c6b4a497d..3ce6b73d58 100644 --- a/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs +++ b/runtimes/collectives/collectives-polkadot/src/weights/extrinsic_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs b/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs index 8083ccb400..dca7d34831 100644 --- a/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs +++ b/runtimes/collectives/collectives-polkadot/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs b/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs index 1db87f143f..87867ebfe1 100644 --- a/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs +++ b/runtimes/collectives/collectives-polkadot/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs b/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs index 7d4a931bd1..c004307336 100644 --- a/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs +++ b/runtimes/contracts/contracts-rococo/src/weights/block_weights.rs @@ -39,11 +39,14 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100u64 * constants::WEIGHT_PER_MICROS, + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. - assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs b/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs index 6c6b4a497d..3ce6b73d58 100644 --- a/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs +++ b/runtimes/contracts/contracts-rococo/src/weights/extrinsic_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs b/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs index 8083ccb400..dca7d34831 100644 --- a/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs +++ b/runtimes/contracts/contracts-rococo/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs b/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs index 1db87f143f..87867ebfe1 100644 --- a/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs +++ b/runtimes/contracts/contracts-rococo/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/testing/penpal/src/weights/block_weights.rs b/runtimes/testing/penpal/src/weights/block_weights.rs index 7d4a931bd1..c004307336 100644 --- a/runtimes/testing/penpal/src/weights/block_weights.rs +++ b/runtimes/testing/penpal/src/weights/block_weights.rs @@ -39,11 +39,14 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100u64 * constants::WEIGHT_PER_MICROS, + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. - assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/runtimes/testing/penpal/src/weights/extrinsic_weights.rs b/runtimes/testing/penpal/src/weights/extrinsic_weights.rs index 6c6b4a497d..3ce6b73d58 100644 --- a/runtimes/testing/penpal/src/weights/extrinsic_weights.rs +++ b/runtimes/testing/penpal/src/weights/extrinsic_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/runtimes/testing/penpal/src/weights/paritydb_weights.rs b/runtimes/testing/penpal/src/weights/paritydb_weights.rs index 8083ccb400..dca7d34831 100644 --- a/runtimes/testing/penpal/src/weights/paritydb_weights.rs +++ b/runtimes/testing/penpal/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/runtimes/testing/penpal/src/weights/rocksdb_weights.rs b/runtimes/testing/penpal/src/weights/rocksdb_weights.rs index 1db87f143f..87867ebfe1 100644 --- a/runtimes/testing/penpal/src/weights/rocksdb_weights.rs +++ b/runtimes/testing/penpal/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); }