frame-system: uniques remove one encode call (#14154)

* frame-system: `uniques` remove one `encode` call

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
This commit is contained in:
Bastian Köcher
2023-05-16 21:56:42 +02:00
committed by GitHub
parent 2c684e4ddf
commit 9b90434237
2 changed files with 27 additions and 11 deletions
+16
View File
@@ -41,13 +41,29 @@ fn unique_datum_works() {
assert!(sp_io::storage::exists(well_known_keys::INTRABLOCK_ENTROPY));
let h1 = unique(b"");
assert_eq!(
32,
sp_io::storage::read(well_known_keys::INTRABLOCK_ENTROPY, &mut [], 0).unwrap()
);
let h2 = unique(b"");
assert_eq!(
32,
sp_io::storage::read(well_known_keys::INTRABLOCK_ENTROPY, &mut [], 0).unwrap()
);
assert_ne!(h1, h2);
let h3 = unique(b"Hello");
assert_eq!(
32,
sp_io::storage::read(well_known_keys::INTRABLOCK_ENTROPY, &mut [], 0).unwrap()
);
assert_ne!(h2, h3);
let h4 = unique(b"Hello");
assert_eq!(
32,
sp_io::storage::read(well_known_keys::INTRABLOCK_ENTROPY, &mut [], 0).unwrap()
);
assert_ne!(h3, h4);
System::finalize();