Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d6ec5db
Anchor polkadot-v0.9.36
Jan 17, 2023
6079a59
Companion for paritytech/cumulus#1860
Jan 17, 2023
4e1012c
Companion for paritytech/cumulus#1876
Jan 17, 2023
33dffeb
Companion for paritytech/cumulus#1904
Jan 17, 2023
2260b86
Companion for paritytech/substrate#12310
Jan 17, 2023
69b8b60
Companion for paritytech/substrate#12740
Jan 17, 2023
578ecf9
Bump array-bytes to 6.0.0
Jan 17, 2023
89d724f
Companion for paritytech/substrate#12868
Jan 17, 2023
19e0213
Companion for paritytech/cumulus#1930
Jan 17, 2023
71a09ea
Companion for paritytech/cumulus#1905
Jan 17, 2023
8a7b991
Companion for paritytech/cumulus#1880
Jan 17, 2023
f830826
Companion for paritytech/cumulus#1997
Jan 17, 2023
c120ab2
Companion for paritytech/cumulus#1559
Jan 17, 2023
45d5dd5
Prepare messages-substrate
Jan 28, 2023
e0e43c7
Companion for paritytech/substrate#12684
Jan 28, 2023
2bc644a
Companion for paritytech/substrate#12740
Jan 28, 2023
7458b49
Fix compile paritytech/substrate#12740
Jan 28, 2023
7bd3983
Compile done
Jan 28, 2023
ee6b187
Format
Jan 28, 2023
0fc11d3
Add call index
Jan 29, 2023
6ae68f3
Merge branch 'main' into prepare-polkadot-v0.9.36
Jan 29, 2023
309683a
Compile done
Feb 2, 2023
7107bc0
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 2, 2023
7b57d0f
Fix CI
Feb 2, 2023
e94375b
Bump moonbeam
Feb 2, 2023
b877161
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 2, 2023
e24be36
Fix CI
Feb 2, 2023
2cdd2a5
Try fix tests
Feb 3, 2023
65e66ce
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 3, 2023
d3b7ece
Use into instead of `Compact`
Feb 3, 2023
89593c4
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 3, 2023
7a5710e
Patch substrate & Fix compile
Feb 3, 2023
e76813d
Merge branch 'prepare-polkadot-v0.9.36' of https://github.com/darwini…
Feb 3, 2023
abd93a0
Fix try-runtime
Feb 3, 2023
1c94d4b
Remove parity-util-mem
Feb 3, 2023
fcc10c5
Format
aurexav Feb 7, 2023
e565968
Merge remote-tracking branch 'origin/main' into prepare-polkadot-v0.9.36
aurexav Feb 7, 2023
b3ceb42
Format
aurexav Feb 7, 2023
d33ed9d
Opt
aurexav Feb 7, 2023
91feff4
Format
aurexav Feb 7, 2023
7cfa7bd
Use `codec::Compact<AssetId>`
aurexav Feb 7, 2023
7497f31
Format
aurexav Feb 7, 2023
d9a903d
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 7, 2023
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
Prev Previous commit
Next Next commit
  • Loading branch information
Guantong committed Jan 17, 2023
commit 89d724f2eb07b330a3a06bd5e3f9a4458a580aaf
7 changes: 4 additions & 3 deletions runtime/crab/src/pallets/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5);
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);

/// We allow for 0.5 of a second of compute with a 12 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = frame_support::weights::constants::WEIGHT_PER_SECOND
.saturating_div(2)
.set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64);
pub const MAXIMUM_BLOCK_WEIGHT: Weight = weight::from_parts(
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64),
);

frame_support::parameter_types! {
pub const Version: sp_version::RuntimeVersion = VERSION;
Expand Down
4 changes: 2 additions & 2 deletions runtime/crab/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ pub mod constants {

// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
);
}
Expand Down
6 changes: 3 additions & 3 deletions runtime/crab/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod constants {

parameter_types! {
/// Executing a NO-OP `System::remarks` Extrinsic.
pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000);
pub const ExtrinsicBaseWeight: Weight = Weight::from_ref_time(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000);
}

#[cfg(test)]
Expand All @@ -39,12 +39,12 @@ pub mod constants {

// At least 10 µs.
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 1 ms."
);
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/crab/src/weights/paritydb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub mod constants {
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
/// are available for brave runtime engineers who may want to try this out as default.
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(),
write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(),
read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
};
}

Expand All @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/crab/src/weights/rocksdb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub mod constants {
/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
/// the runtime.
pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(),
write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(),
read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
};
}

Expand All @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
Expand Down
7 changes: 4 additions & 3 deletions runtime/darwinia/src/pallets/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5);
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);

/// We allow for 0.5 of a second of compute with a 12 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = frame_support::weights::constants::WEIGHT_PER_SECOND
.saturating_div(2)
.set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64);
pub const MAXIMUM_BLOCK_WEIGHT: Weight = weight::from_parts(
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64),
);

frame_support::parameter_types! {
pub const Version: sp_version::RuntimeVersion = VERSION;
Expand Down
6 changes: 3 additions & 3 deletions runtime/darwinia/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod constants {

parameter_types! {
/// Importing a block with 0 Extrinsics.
pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000);
pub const BlockExecutionWeight: Weight = Weight::from_ref_time(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(5_000_000);
}

#[cfg(test)]
Expand All @@ -39,12 +39,12 @@ pub mod constants {

// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
);
}
Expand Down
6 changes: 3 additions & 3 deletions runtime/darwinia/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod constants {

parameter_types! {
/// Executing a NO-OP `System::remarks` Extrinsic.
pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000);
pub const ExtrinsicBaseWeight: Weight = Weight::from_ref_time(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000);
}

#[cfg(test)]
Expand All @@ -39,12 +39,12 @@ pub mod constants {

// At least 10 µs.
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 1 ms."
);
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/darwinia/src/weights/paritydb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub mod constants {
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
/// are available for brave runtime engineers who may want to try this out as default.
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(),
write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(),
read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
};
}

Expand All @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/darwinia/src/weights/rocksdb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub mod constants {
/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
/// the runtime.
pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(),
write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(),
read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
};
}

Expand All @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
Expand Down
7 changes: 4 additions & 3 deletions runtime/pangolin/src/pallets/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5);
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);

/// We allow for 0.5 of a second of compute with a 12 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = frame_support::weights::constants::WEIGHT_PER_SECOND
.saturating_div(2)
.set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64);
pub const MAXIMUM_BLOCK_WEIGHT: Weight = weight::from_parts(
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64),
);

frame_support::parameter_types! {
pub const Version: sp_version::RuntimeVersion = VERSION;
Expand Down
6 changes: 3 additions & 3 deletions runtime/pangolin/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod constants {

parameter_types! {
/// Importing a block with 0 Extrinsics.
pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000);
pub const BlockExecutionWeight: Weight = Weight::from_ref_time(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(5_000_000);
}

#[cfg(test)]
Expand All @@ -39,12 +39,12 @@ pub mod constants {

// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
);
}
Expand Down
6 changes: 3 additions & 3 deletions runtime/pangolin/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod constants {

parameter_types! {
/// Executing a NO-OP `System::remarks` Extrinsic.
pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000);
pub const ExtrinsicBaseWeight: Weight = Weight::from_ref_time(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000);
}

#[cfg(test)]
Expand All @@ -39,12 +39,12 @@ pub mod constants {

// At least 10 µs.
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 1 ms."
);
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/pangolin/src/weights/paritydb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub mod constants {
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
/// are available for brave runtime engineers who may want to try this out as default.
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(),
write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(),
read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
};
}

Expand All @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/pangolin/src/weights/rocksdb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub mod constants {
/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
/// the runtime.
pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(),
write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(),
read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS(),
};
}

Expand All @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
Expand Down