mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 09:51:02 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user