chore: reduce copy times for bytes in core-hashing (#13519)

* chore: reduce copy bytes for core-hashing

* improve by suggestions and remove unused `xx_into`

* chore: replace sha2 crate by `sp_core::hashing` for pallet-alliance

* fix features

* use sp-core-hashing directly

* add to dev-dep
This commit is contained in:
yjh
2023-03-06 22:09:07 +08:00
committed by GitHub
parent f85d6dc6dd
commit 9b9964394e
5 changed files with 16 additions and 53 deletions
+2 -5
View File
@@ -368,11 +368,8 @@ pub fn new_bench_ext() -> sp_io::TestExternalities {
}
pub fn test_cid() -> Cid {
use sha2::{Digest, Sha256};
let mut hasher = Sha256::new();
hasher.update(b"hello world");
let result = hasher.finalize();
Cid::new_v0(&*result)
let result = sp_core_hashing::sha2_256(b"hello world");
Cid::new_v0(result)
}
pub fn make_remark_proposal(value: u64) -> (RuntimeCall, u32, H256) {