mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-10 07:37:30 +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
@@ -331,8 +331,8 @@ pub fn decode_cht_value(value: &[u8]) -> Option<H256> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use sp_core::Blake2Hasher;
|
||||
use substrate_test_runtime_client::runtime::Header;
|
||||
use sp_runtime::traits::BlakeTwo256;
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
@@ -398,7 +398,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn compute_root_works() {
|
||||
assert!(compute_root::<Header, Blake2Hasher, _>(
|
||||
assert!(compute_root::<Header, BlakeTwo256, _>(
|
||||
SIZE as _,
|
||||
42,
|
||||
::std::iter::repeat_with(|| Ok(Some(H256::from_low_u64_be(1))))
|
||||
@@ -409,7 +409,7 @@ mod tests {
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn build_proof_panics_when_querying_wrong_block() {
|
||||
assert!(build_proof::<Header, Blake2Hasher, _, _>(
|
||||
assert!(build_proof::<Header, BlakeTwo256, _, _>(
|
||||
SIZE as _,
|
||||
0,
|
||||
vec![(SIZE * 1000) as u64],
|
||||
@@ -420,7 +420,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn build_proof_works() {
|
||||
assert!(build_proof::<Header, Blake2Hasher, _, _>(
|
||||
assert!(build_proof::<Header, BlakeTwo256, _, _>(
|
||||
SIZE as _,
|
||||
0,
|
||||
vec![(SIZE / 2) as u64],
|
||||
|
||||
Reference in New Issue
Block a user