mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Reduce usage of Blake2Hasher (#5132)
This reduces the usage of `Blake2Hasher` in the code base and replaces it with `BlakeTwo256`. The most important change is the removal of the custom extern function for `Blake2Hasher`. The runtime `Hash` trait is now also simplified and directly requires that the implementing type implements `Hashable`.
This commit is contained in:
committed by
GitHub
parent
406fa981bb
commit
5a33228ea9
@@ -52,7 +52,7 @@ use sp_core::{
|
||||
Bytes, OpaqueMetadata, storage::{StorageKey, StorageData, StorageChangeSet},
|
||||
};
|
||||
use sp_version::RuntimeVersion;
|
||||
use sp_runtime::{generic::BlockId, traits::{Block as BlockT, HasherFor}};
|
||||
use sp_runtime::{generic::BlockId, traits::{Block as BlockT, HashFor}};
|
||||
|
||||
use super::{StateBackend, error::{FutureResult, Error}, client_err};
|
||||
|
||||
@@ -241,7 +241,7 @@ impl<Block, F, B, E, RA> StateBackend<B, E, Block, RA> for LightState<Block, F,
|
||||
Box::new(self
|
||||
.storage(block, key)
|
||||
.and_then(|maybe_storage|
|
||||
result(Ok(maybe_storage.map(|storage| HasherFor::<Block>::hash(&storage.0))))
|
||||
result(Ok(maybe_storage.map(|storage| HashFor::<Block>::hash(&storage.0))))
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -302,7 +302,7 @@ impl<Block, F, B, E, RA> StateBackend<B, E, Block, RA> for LightState<Block, F,
|
||||
Box::new(self
|
||||
.child_storage(block, child_storage_key, child_info, child_type, key)
|
||||
.and_then(|maybe_storage|
|
||||
result(Ok(maybe_storage.map(|storage| HasherFor::<Block>::hash(&storage.0))))
|
||||
result(Ok(maybe_storage.map(|storage| HashFor::<Block>::hash(&storage.0))))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user