mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Format templates and fix --steps default value (#12286)
* Cleaup imports Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Format template Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Set steps min value to two Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
d5c57ffcc1
commit
cb82064cb8
@@ -39,7 +39,6 @@ parameter_types! {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_weights {
|
||||
use super::*;
|
||||
use sp_weights::constants;
|
||||
|
||||
/// Checks that the weight exists and is sane.
|
||||
@@ -51,14 +50,26 @@ mod test_weights {
|
||||
|
||||
{{#if (eq short_name "block")}}
|
||||
// At least 100 µs.
|
||||
assert!(w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs.");
|
||||
assert!(
|
||||
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
|
||||
"Weight should be at least 100 µs."
|
||||
);
|
||||
// At most 50 ms.
|
||||
assert!(w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), "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."
|
||||
);
|
||||
{{else}}
|
||||
// At least 10 µs.
|
||||
assert!(w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), "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.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Weight should be at most 1 ms.");
|
||||
assert!(
|
||||
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
|
||||
"Weight should be at most 1 ms."
|
||||
);
|
||||
{{/if}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user