mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 18:11:10 +00:00
Refactored Slicable (#324)
* Refactored Slicable * Docs * Wasm build * Wasm build * Renamed traits * Review nits * Renamed Slicable as well
This commit is contained in:
committed by
Gav Wood
parent
b45020175a
commit
1aeb2825af
@@ -46,14 +46,14 @@ use safe_mix::TripletMix;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use rstd::marker::PhantomData;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use codec::Slicable;
|
||||
use codec::Encode;
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use runtime_io::{twox_128, TestExternalities};
|
||||
|
||||
/// Compute the extrinsics root of a list of extrinsics.
|
||||
pub fn extrinsics_root<H: Hash, E: codec::Slicable>(extrinsics: &[E]) -> H::Output {
|
||||
extrinsics_data_root::<H>(extrinsics.iter().map(codec::Slicable::encode).collect())
|
||||
pub fn extrinsics_root<H: Hash, E: codec::Encode>(extrinsics: &[E]) -> H::Output {
|
||||
extrinsics_data_root::<H>(extrinsics.iter().map(codec::Encode::encode).collect())
|
||||
}
|
||||
|
||||
/// Compute the extrinsics root of a list of extrinsics.
|
||||
@@ -209,7 +209,7 @@ impl<T: Trait> primitives::BuildStorage for GenesisConfig<T>
|
||||
{
|
||||
fn build_storage(self) -> Result<runtime_io::TestExternalities, String> {
|
||||
use runtime_io::twox_128;
|
||||
use codec::Slicable;
|
||||
use codec::Encode;
|
||||
|
||||
Ok(map![
|
||||
twox_128(&<BlockHash<T>>::key_for(T::BlockNumber::zero())).to_vec() => [69u8; 32].encode(),
|
||||
|
||||
Reference in New Issue
Block a user