Skip to content

Commit

Permalink
Companion for paritytech/substrate#12183 (#1601)
Browse files Browse the repository at this point in the history
* Companion for paritytech/substrate#12183

* Fixes

* Update pallets/xcmp-queue/src/lib.rs

* Update pallets/xcmp-queue/src/lib.rs

* update lockfile for {"substrate", "polkadot"}

Co-authored-by: parity-processbot <>
  • Loading branch information
KiChjang authored Sep 8, 2022
1 parent 9b2e5c8 commit 2638152
Show file tree
Hide file tree
Showing 15 changed files with 323 additions and 290 deletions.
496 changes: 248 additions & 248 deletions Cargo.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
Expand Down

0 comments on commit 2638152

Please sign in to comment.