Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
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
remove tests for weights
  • Loading branch information
shawntabrizi committed Aug 17, 2020
commit b38129c28face729e34c3fae54206306ee14de0b
37 changes: 0 additions & 37 deletions runtime/polkadot/tests/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ fn sanity_check_weight_per_time_constants_are_as_expected() {
assert_eq!(WEIGHT_PER_NANOS, WEIGHT_PER_MICROS / 1000);
}

#[test]
fn weight_of_timestamp_set_is_correct() {
// #[weight = T::DbWeight::get().reads_writes(2, 1) + 8_000_000]
let expected_weight = (2 * DbWeight::get().read) + DbWeight::get().write + 8_000_000;
let weight = polkadot_runtime::TimestampCall::set::<Runtime>(Default::default()).get_dispatch_info().weight;

assert_eq!(weight, expected_weight);
}

#[test]
fn weight_of_staking_bond_is_correct() {
let controller: AccountId = AccountKeyring::Alice.into();
Expand Down Expand Up @@ -105,34 +96,6 @@ fn weight_of_system_set_code_is_correct() {
assert_eq!(weight, expected_weight);
}

#[test]
fn weight_of_system_set_storage_is_correct() {
let storage_items = vec![(vec![12], vec![34]), (vec![45], vec![83])];
let len = storage_items.len() as Weight;

// #[weight = FunctionOf(
// |(items,): (&Vec<KeyValue>,)| {
// T::DbWeight::get().writes(items.len() as Weight)
// .saturating_add((items.len() as Weight).saturating_mul(600_000))
// },
// DispatchClass::Operational,
// Pays::Yes,
// )]
let expected_weight = (DbWeight::get().write * len).saturating_add(len.saturating_mul(600_000));
let weight = SystemCall::set_storage::<Runtime>(storage_items).get_dispatch_info().weight;

assert_eq!(weight, expected_weight);
}

#[test]
fn weight_of_system_remark_is_correct() {
// #[weight = 700_000]
let expected_weight = 700_000;
let weight = SystemCall::remark::<Runtime>(vec![]).get_dispatch_info().weight;

assert_eq!(weight, expected_weight);
}

#[test]
fn weight_of_session_set_keys_is_correct() {
// #[weight = 200_000_000
Expand Down