topsoil_core/weights/
rocksdb_weights.rs1pub mod constants {
8 use subsoil::core::parameter_types;
9 use subsoil::weights::RuntimeDbWeight;
10 use topsoil_core::weights::constants;
11
12 parameter_types! {
13 pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
16 read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS,
17 write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS,
18 };
19 }
20
21 #[cfg(test)]
22 mod test_db_weights {
23 use super::constants::RocksDbWeight as W;
24 use subsoil::weights::constants;
25
26 #[test]
30 fn sane() {
31 assert!(
33 W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
34 "Read weight should be at least 1 µs."
35 );
36 assert!(
37 W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
38 "Write weight should be at least 1 µs."
39 );
40 assert!(
42 W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
43 "Read weight should be at most 1 ms."
44 );
45 assert!(
46 W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
47 "Write weight should be at most 1 ms."
48 );
49 }
50 }
51}