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
@@ -23,7 +23,7 @@ use sp_runtime_interface::*;
use sp_runtime_interface_test_wasm::{WASM_BINARY, test_api::HostFunctions};
use sp_wasm_interface::HostFunctions as HostFunctionsT;
type TestExternalities = sp_state_machine::TestExternalities<sp_core::Blake2Hasher, u64>;
type TestExternalities = sp_state_machine::TestExternalities<sp_runtime::traits::BlakeTwo256, u64>;
fn call_wasm_method<HF: HostFunctionsT>(method: &str) -> TestExternalities {
let mut ext = TestExternalities::default();
@@ -127,8 +127,3 @@ fn test_encoded_return_value_memory_is_freed() {
fn test_array_return_value_memory_is_freed() {
call_wasm_method::<HostFunctions>("test_array_return_value_memory_is_freed");
}
#[test]
fn test_ext_blake2_256() {
call_wasm_method::<HostFunctions>("test_ext_blake2_256");
}