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:
Benjamin Kampmann
2020-03-05 08:51:03 +01:00
committed by GitHub
parent 406fa981bb
commit 5a33228ea9
64 changed files with 372 additions and 451 deletions
+1 -2
View File
@@ -27,7 +27,6 @@ use sc_client_api::{
light::{Fetcher, RemoteCallRequest, RemoteBodyRequest},
BlockBody,
};
use sp_core::Hasher;
use sp_runtime::{
generic::BlockId, traits::{self, Block as BlockT, BlockIdTo, Header as HeaderT, Hash as HashT},
transaction_validity::TransactionValidity,
@@ -120,7 +119,7 @@ impl<Client, Block> sc_transaction_graph::ChainApi for FullChainApi<Client, Bloc
fn hash_and_length(&self, ex: &sc_transaction_graph::ExtrinsicFor<Self>) -> (Self::Hash, usize) {
ex.using_encoded(|x| {
(traits::HasherFor::<Block>::hash(x), x.len())
(<traits::HashFor::<Block> as traits::Hash>::hash(x), x.len())
})
}
}