mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
Migrate srml crates to the 2018 edition (#1755)
This commit is contained in:
committed by
Gav Wood
parent
b28f7328ac
commit
c860787db7
@@ -19,32 +19,21 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
extern crate substrate_primitives;
|
||||
|
||||
#[cfg_attr(any(feature = "std", test), macro_use)]
|
||||
extern crate sr_std as rstd;
|
||||
|
||||
#[macro_use]
|
||||
extern crate srml_support as runtime_support;
|
||||
|
||||
#[macro_use]
|
||||
extern crate parity_codec_derive;
|
||||
|
||||
extern crate parity_codec as codec;
|
||||
extern crate sr_io as runtime_io;
|
||||
extern crate sr_primitives as primitives;
|
||||
extern crate safe_mix;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use rstd::prelude::*;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use rstd::map;
|
||||
use primitives::traits::{self, CheckEqual, SimpleArithmetic, SimpleBitOps, Zero, One, Bounded, Lookup,
|
||||
Hash, Member, MaybeDisplay, EnsureOrigin, Digest as DigestT, As, CurrentHeight, BlockNumberToHash,
|
||||
MaybeSerializeDebugButNotDeserialize, MaybeSerializeDebug, StaticLookup};
|
||||
use substrate_primitives::storage::well_known_keys;
|
||||
use runtime_support::{storage, StorageValue, StorageMap, Parameter};
|
||||
use srml_support::{storage, StorageValue, StorageMap, Parameter, decl_module, decl_event, decl_storage};
|
||||
use safe_mix::TripletMix;
|
||||
use parity_codec_derive::{Encode, Decode};
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use codec::Encode;
|
||||
use parity_codec::Encode;
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use runtime_io::{twox_128, TestExternalities, Blake2Hasher};
|
||||
@@ -75,8 +64,8 @@ impl<AccountId> IsDeadAccount<AccountId> for () {
|
||||
}
|
||||
|
||||
/// Compute the extrinsics root of a list of extrinsics.
|
||||
pub fn extrinsics_root<H: Hash, E: codec::Encode>(extrinsics: &[E]) -> H::Output {
|
||||
extrinsics_data_root::<H>(extrinsics.iter().map(codec::Encode::encode).collect())
|
||||
pub fn extrinsics_root<H: Hash, E: parity_codec::Encode>(extrinsics: &[E]) -> H::Output {
|
||||
extrinsics_data_root::<H>(extrinsics.iter().map(parity_codec::Encode::encode).collect())
|
||||
}
|
||||
|
||||
/// Compute the extrinsics root of a list of extrinsics.
|
||||
@@ -226,7 +215,7 @@ decl_storage! {
|
||||
config(changes_trie_config): Option<ChangesTrieConfiguration>;
|
||||
|
||||
build(|storage: &mut primitives::StorageMap, _: &mut primitives::ChildrenStorageMap, config: &GenesisConfig<T>| {
|
||||
use codec::Encode;
|
||||
use parity_codec::Encode;
|
||||
|
||||
storage.insert(well_known_keys::EXTRINSIC_INDEX.to_vec(), 0u32.encode());
|
||||
|
||||
@@ -466,6 +455,7 @@ mod tests {
|
||||
use primitives::BuildStorage;
|
||||
use primitives::traits::{BlakeTwo256, IdentityLookup};
|
||||
use primitives::testing::{Digest, DigestItem, Header};
|
||||
use srml_support::impl_outer_origin;
|
||||
|
||||
impl_outer_origin!{
|
||||
pub enum Origin for Test where system = super {}
|
||||
|
||||
Reference in New Issue
Block a user