Parachain loop metrics (#1484)

* parachain loop metrics

* some fixes

* mini refactoring

* add tests
This commit is contained in:
Svyatoslav Nikolsky
2022-06-29 15:58:19 +03:00
committed by Bastian Köcher
parent f8ff3c9142
commit d11d9fd0b7
7 changed files with 228 additions and 22 deletions
+24
View File
@@ -405,6 +405,7 @@ mod tests {
use frame_support::{
assert_noop, assert_ok,
dispatch::DispatchResultWithPostInfo,
storage::generator::{StorageDoubleMap, StorageMap},
traits::{Get, OnInitialize},
weights::Weight,
};
@@ -810,4 +811,27 @@ mod tests {
);
});
}
#[test]
fn storage_keys_computed_properly() {
assert_eq!(
BestParaHeads::<TestRuntime>::storage_map_final_key(ParaId(42)).to_vec(),
bp_parachains::best_parachain_head_hash_storage_key_at_target("Parachains", ParaId(42))
.0,
);
assert_eq!(
ImportedParaHeads::<TestRuntime>::storage_double_map_final_key(
ParaId(42),
ParaHash::from([21u8; 32])
)
.to_vec(),
bp_parachains::imported_parachain_head_storage_key_at_target(
"Parachains",
ParaId(42),
ParaHash::from([21u8; 32])
)
.0,
);
}
}