Introduce function into frame System (#14149)

This commit is contained in:
Gavin Wood
2023-05-15 18:11:33 +01:00
committed by GitHub
parent 0a105eed6f
commit f30e6df370
3 changed files with 38 additions and 0 deletions
+21
View File
@@ -34,6 +34,27 @@ fn origin_works() {
assert_eq!(x.unwrap(), RawOrigin::<u64>::Signed(1u64));
}
#[test]
fn unique_datum_works() {
new_test_ext().execute_with(|| {
System::initialize(&1, &[0u8; 32].into(), &Default::default());
assert!(sp_io::storage::exists(well_known_keys::INTRABLOCK_ENTROPY));
let h1 = unique(b"");
let h2 = unique(b"");
assert_ne!(h1, h2);
let h3 = unique(b"Hello");
assert_ne!(h2, h3);
let h4 = unique(b"Hello");
assert_ne!(h3, h4);
System::finalize();
assert!(!sp_io::storage::exists(well_known_keys::INTRABLOCK_ENTROPY));
});
}
#[test]
fn stored_map_works() {
new_test_ext().execute_with(|| {