Remove unneeded Serde requirements (#1076)

* Remove superfluous serde requirements.

* Try to ensure hash is serde

* Fixups

* Building again

* Attempt to reenable Block (doesn't build)

* Fixes compilation for node cli

* Fixes test compilation

* Fix wasm

* Fix tests

* Remove unneeded changes

* Fix up comments

* Reenable some code

* Compile error when origin misused.

* Remove unnecessary includes of `serde_derive`

* Cleanups
This commit is contained in:
Gav Wood
2018-11-12 18:40:18 +01:00
committed by GitHub
parent b76ba06472
commit 57b2896332
62 changed files with 253 additions and 343 deletions
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
substrate-primitives = { path = "../../core/primitives", default-features = false }
@@ -20,7 +19,6 @@ srml-system = { path = "../system", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"parity-codec/std",
"parity-codec-derive/std",
"substrate-primitives/std",
-7
View File
@@ -30,13 +30,6 @@ extern crate sr_io as runtime_io;
#[cfg(test)]
extern crate substrate_primitives;
// Needed for deriving `Serialize` and `Deserialize` for various types.
// We only implement the serde traits for std builds - they're unneeded
// in the wasm runtime.
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
// Needed for deriving `Encode` and `Decode` for `RawEvent`.
#[macro_use]
extern crate parity_codec_derive;
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
@@ -22,7 +21,6 @@ srml-system = { path = "../system", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"safe-mix/std",
"substrate-keyring",
"parity-codec/std",
+1 -3
View File
@@ -22,16 +22,14 @@ use super::{Member, Decode, Encode, As, Input, Output};
/// A vetted and verified extrinsic from the external world.
#[derive(PartialEq, Eq, Clone)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug, Hash))]
#[cfg_attr(feature = "std", derive(Debug, Hash))]
pub enum Address<AccountId, AccountIndex> where
AccountId: Member,
AccountIndex: Member,
{
/// It's an account ID (pubkey).
#[cfg_attr(feature = "std", serde(deserialize_with="AccountId::deserialize"))]
Id(AccountId),
/// It's an account index.
#[cfg_attr(feature = "std", serde(deserialize_with="AccountIndex::deserialize"))]
Index(AccountIndex),
}
-4
View File
@@ -18,10 +18,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate srml_support as runtime_support;
+1
View File
@@ -72,6 +72,7 @@ impl ExtBuilder {
self.existential_deposit = existential_deposit;
self
}
#[allow(dead_code)]
pub fn transfer_fee(mut self, transfer_fee: u64) -> Self {
self.transfer_fee = transfer_fee;
self
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
substrate-primitives = { path = "../../core/primitives", default-features = false }
@@ -20,7 +19,6 @@ srml-system = { path = "../system", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"parity-codec/std",
"substrate-primitives/std",
"sr-std/std",
-4
View File
@@ -25,10 +25,6 @@ extern crate sr_std as rstd;
#[macro_use]
extern crate srml_support as runtime_support;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
extern crate parity_codec;
#[macro_use]
extern crate parity_codec_derive;
-2
View File
@@ -5,7 +5,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
pwasm-utils = { version = "0.3", default-features = false }
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
@@ -26,7 +25,6 @@ assert_matches = "1.1"
[features]
default = ["std"]
std = [
"serde_derive",
"serde/std",
"parity-codec/std",
"parity-codec-derive/std",
-4
View File
@@ -52,10 +52,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate parity_codec_derive;
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
@@ -23,7 +22,6 @@ srml-system = { path = "../system", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"safe-mix/std",
"parity-codec/std",
"parity-codec-derive/std",
-4
View File
@@ -21,10 +21,6 @@
#[cfg(feature = "std")]
extern crate serde;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[cfg(test)]
#[macro_use]
extern crate hex_literal;
+3 -4
View File
@@ -20,7 +20,7 @@ use rstd::prelude::*;
use rstd::result;
use codec::Compact;
use substrate_primitives::u32_trait::Value as U32;
use primitives::traits::{Hash, EnsureOrigin, MaybeSerializeDebug};
use primitives::traits::{Hash, EnsureOrigin};
use srml_support::dispatch::{Result, Dispatchable, Parameter};
use srml_support::{StorageValue, StorageMap};
use super::{Trait as CouncilTrait, Module as Council};
@@ -29,12 +29,12 @@ use system::{self, ensure_signed};
/// Simple index type for proposal counting.
pub type ProposalIndex = u32;
pub trait Trait: CouncilTrait + MaybeSerializeDebug {
pub trait Trait: CouncilTrait {
/// The outer origin type.
type Origin: From<Origin>;
/// The outer call dispatch type.
type Proposal: Parameter + Dispatchable<Origin=<Self as Trait>::Origin> + MaybeSerializeDebug;
type Proposal: Parameter + Dispatchable<Origin=<Self as Trait>::Origin>;
/// The outer event type.
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
@@ -66,7 +66,6 @@ decl_event!(
);
decl_module! {
#[cfg_attr(feature = "std", serde(bound(deserialize = "<T as Trait>::Proposal: ::serde::de::DeserializeOwned")))]
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin {
fn deposit_event() = default;
fn propose(origin, threshold: Compact<u32>, proposal: Box<<T as Trait>::Proposal>) -> Result {
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
@@ -22,7 +21,6 @@ srml-system = { path = "../system", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"safe-mix/std",
"parity-codec/std",
"substrate-primitives/std",
+2 -6
View File
@@ -21,10 +21,6 @@
#[cfg(test)]
extern crate substrate_primitives;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate parity_codec_derive;
#[cfg_attr(not(feature = "std"), macro_use)]
@@ -41,7 +37,7 @@ extern crate srml_system as system;
use rstd::prelude::*;
use rstd::result;
use codec::{HasCompact, Compact};
use primitives::traits::{Zero, As, MaybeSerializeDebug};
use primitives::traits::{Zero, As};
use srml_support::{StorageValue, StorageMap, Parameter, Dispatchable, IsSubType};
use srml_support::dispatch::Result;
use system::ensure_signed;
@@ -55,7 +51,7 @@ pub type PropIndex = u32;
pub type ReferendumIndex = u32;
pub trait Trait: balances::Trait + Sized {
type Proposal: Parameter + Dispatchable<Origin=Self::Origin> + IsSubType<Module<Self>> + MaybeSerializeDebug;
type Proposal: Parameter + Dispatchable<Origin=Self::Origin> + IsSubType<Module<Self>>;
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
}
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
substrate-primitives = { path = "../../core/primitives", default-features = false }
@@ -21,7 +20,6 @@ srml-balances = { path = "../balances", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"parity-codec/std",
"parity-codec-derive/std",
"sr-std/std",
-7
View File
@@ -34,13 +34,6 @@ extern crate substrate_primitives;
// Needed for various traits. In our case, `OnFinalise`.
extern crate sr_primitives;
// Needed for deriving `Serialize` and `Deserialize` for various types.
// We only implement the serde traits for std builds - they're unneeded
// in the wasm runtime.
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
// Needed for deriving `Encode` and `Decode` for `RawEvent`.
#[macro_use]
extern crate parity_codec_derive;
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
sr-std = { path = "../../core/sr-std", default-features = false }
@@ -25,7 +24,6 @@ std = [
"sr-std/std",
"srml-support/std",
"serde/std",
"serde_derive",
"parity-codec/std",
"parity-codec-derive/std",
"sr-primitives/std",
+1 -5
View File
@@ -18,10 +18,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(test)]
#[macro_use]
extern crate serde_derive;
#[cfg(test)]
#[macro_use]
extern crate parity_codec_derive;
@@ -295,7 +291,7 @@ mod tests {
}
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq)]
pub struct Runtime;
impl system::Trait for Runtime {
type Origin = Origin;
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}
substrate-primitives = { path = "../../core/primitives", default-features = false }
parity-codec = { version = "2.1", default-features = false }
@@ -23,7 +22,6 @@ srml-timestamp = { path = "../timestamp", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"safe-mix/std",
"parity-codec/std",
"parity-codec-derive/std",
-4
View File
@@ -19,10 +19,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
extern crate sr_std as rstd;
#[macro_use]
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
@@ -26,7 +25,6 @@ srml-timestamp = { path = "../timestamp", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"safe-mix/std",
"substrate-keyring",
"parity-codec/std",
+1 -6
View File
@@ -23,10 +23,6 @@
#[cfg(feature = "std")]
extern crate serde;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate srml_support as runtime_support;
@@ -75,7 +71,7 @@ pub enum LockStatus<BlockNumber: Parameter> {
/// Preference of what happens on a slash event.
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct ValidatorPrefs<Balance: HasCompact + Copy> { // TODO: @bkchr shouldn't need this Copy but derive(Encode) breaks otherwise
/// Validator should ensure this many more slashes than is necessary before being unstaked.
#[codec(compact)]
@@ -103,7 +99,6 @@ pub trait Trait: balances::Trait + session::Trait {
}
decl_module! {
#[cfg_attr(feature = "std", serde(bound(deserialize = "T::Balance: ::serde::de::DeserializeOwned")))]
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
fn deposit_event() = default;
+41 -14
View File
@@ -20,8 +20,6 @@ pub use rstd::prelude::{Vec, Clone, Eq, PartialEq};
#[cfg(feature = "std")]
pub use std::fmt;
pub use rstd::result;
#[cfg(feature = "std")]
use serde;
pub use codec::{Codec, Decode, Encode, Input, Output};
pub use substrate_metadata::{
ModuleMetadata, FunctionMetadata, DecodeDifferent,
@@ -36,11 +34,6 @@ pub trait Dispatchable {
fn dispatch(self, origin: Self::Origin) -> Result;
}
#[cfg(feature = "std")]
pub trait Callable {
type Call: Dispatchable + Codec + ::serde::Serialize + Clone + PartialEq + Eq;
}
#[cfg(not(feature = "std"))]
pub trait Callable {
type Call: Dispatchable + Codec + Clone + PartialEq + Eq;
}
@@ -50,10 +43,10 @@ pub trait Callable {
pub type CallableCallFor<A> = <A as Callable>::Call;
#[cfg(feature = "std")]
pub trait Parameter: Codec + serde::Serialize + Clone + Eq + fmt::Debug {}
pub trait Parameter: Codec + Clone + Eq + fmt::Debug {}
#[cfg(feature = "std")]
impl<T> Parameter for T where T: Codec + serde::Serialize + Clone + Eq + fmt::Debug {}
impl<T> Parameter for T where T: Codec + Clone + Eq + fmt::Debug {}
#[cfg(not(feature = "std"))]
pub trait Parameter: Codec + Clone + Eq {}
@@ -188,6 +181,42 @@ macro_rules! decl_module {
$($rest)*
);
};
(@normalize
$(#[$attr:meta])*
pub struct $mod_type:ident<$trait_instance:ident: $trait_name:ident>
for enum $call_type:ident where origin: $origin_type:ty, system = $system:ident
{ $( $deposit_event:tt )* }
{ $( $on_finalise:tt )* }
[ $($t:tt)* ]
$(#[doc = $doc_attr:tt])*
$fn_vis:vis fn $fn_name:ident($origin:ident : T::Origin $(, $param_name:ident : $param:ty)* ) -> $result:ty { $( $impl:tt )* }
$($rest:tt)*
) => {
compile_error!("\
First parameter of dispatch should be marked `origin` only, with no\n\
type specified (a bit like `self`).\n\
(For root-matching dispatches, ensure the first parameter does not use\n\
the `T::Origin` type.)\
")
};
(@normalize
$(#[$attr:meta])*
pub struct $mod_type:ident<$trait_instance:ident: $trait_name:ident>
for enum $call_type:ident where origin: $origin_type:ty, system = $system:ident
{ $( $deposit_event:tt )* }
{ $( $on_finalise:tt )* }
[ $($t:tt)* ]
$(#[doc = $doc_attr:tt])*
$fn_vis:vis fn $fn_name:ident(origin : $origin:ty $(, $param_name:ident : $param:ty)* ) -> $result:ty { $( $impl:tt )* }
$($rest:tt)*
) => {
compile_error!("\
First parameter of dispatch should be marked `origin` only, with no\n\
type specified (a bit like `self`).\n\
(For root-matching dispatches, ensure the first parameter is not named\n\
`origin`.)\
")
};
(@normalize
$(#[$attr:meta])*
pub struct $mod_type:ident<$trait_instance:ident: $trait_name:ident>
@@ -351,7 +380,7 @@ macro_rules! decl_module {
) => {
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", derive(Debug))]
// TODO: switching based on std feature is because of an issue in
// serde-derive for when we attempt to derive `Deserialize` on these types,
// in a situation where we've imported `srml_support` as another name.
@@ -360,7 +389,7 @@ macro_rules! decl_module {
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", derive(Debug))]
#[cfg(not(feature = "std"))]
pub struct $mod_type<$trait_instance: $trait_name>(::core::marker::PhantomData<$trait_instance>);
@@ -389,7 +418,6 @@ macro_rules! decl_module {
#[cfg(feature = "std")]
$(#[$attr])*
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum $call_type<$trait_instance: $trait_name> {
__PhantomItem(::std::marker::PhantomData<$trait_instance>),
__OtherPhantomItem(::std::marker::PhantomData<$trait_instance>),
@@ -401,7 +429,6 @@ macro_rules! decl_module {
#[cfg(not(feature = "std"))]
$(#[$attr])*
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum $call_type<$trait_instance: $trait_name> {
__PhantomItem(::core::marker::PhantomData<$trait_instance>),
__OtherPhantomItem(::core::marker::PhantomData<$trait_instance>),
@@ -610,7 +637,7 @@ macro_rules! impl_outer_dispatch {
) => {
$(#[$attr])*
#[derive(Clone, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", derive(Debug))]
pub enum $call_type {
$(
$camelcase ( $crate::dispatch::CallableCallFor<$camelcase> )
+5 -5
View File
@@ -115,7 +115,7 @@ macro_rules! decl_event {
) => {
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, PartialEq, Eq, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", derive(Debug))]
$(#[$attr])*
pub enum Event {
$(
@@ -216,7 +216,7 @@ macro_rules! __decl_generic_event {
pub type Event<$event_generic_param> = RawEvent<$( <$generic as $trait>::$trait_type ),*>;
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, PartialEq, Eq, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", derive(Debug))]
$(#[$attr])*
pub enum RawEvent<$( $generic_param ),*> {
$(
@@ -364,7 +364,7 @@ macro_rules! impl_outer_event {
) => {
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, PartialEq, Eq, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", derive(Debug))]
$(#[$attr])*
#[allow(non_camel_case_types)]
pub enum $name {
@@ -518,7 +518,7 @@ mod tests {
);
}
#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Serialize)]
pub struct TestRuntime;
impl_outer_event! {
@@ -529,7 +529,7 @@ mod tests {
}
}
#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Serialize)]
pub struct TestRuntime2;
impl_outer_event! {
+4 -1
View File
@@ -36,7 +36,7 @@ extern crate mashup;
#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;
#[cfg(test)]
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[cfg(test)]
@@ -122,3 +122,6 @@ pub enum Void {}
#[doc(hidden)]
pub use mashup::*;
#[cfg(feature = "std")]
pub use serde_derive::*;
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
@@ -20,7 +19,6 @@ srml-support = { path = "../support", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"safe-mix/std",
"parity-codec/std",
"parity-codec-derive/std",
+7 -10
View File
@@ -27,10 +27,6 @@ extern crate sr_std as rstd;
#[macro_use]
extern crate srml_support as runtime_support;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate parity_codec_derive;
@@ -41,7 +37,8 @@ extern crate safe_mix;
use rstd::prelude::*;
use primitives::traits::{self, CheckEqual, SimpleArithmetic, SimpleBitOps, Zero, One, Bounded, Lookup,
Hash, Member, MaybeDisplay, EnsureOrigin, Digest as DigestT, As, CurrentHeight, BlockNumberToHash};
Hash, Member, MaybeDisplay, EnsureOrigin, Digest as DigestT, As, CurrentHeight, BlockNumberToHash,
MaybeSerializeDebugButNotDeserialize, MaybeSerializeDebug};
use substrate_primitives::storage::well_known_keys;
use runtime_support::{storage, StorageValue, StorageMap, Parameter};
use safe_mix::TripletMix;
@@ -68,12 +65,12 @@ pub fn extrinsics_data_root<H: Hash>(xts: Vec<Vec<u8>>) -> H::Output {
pub trait Trait: Eq + Clone {
type Origin: Into<Option<RawOrigin<Self::AccountId>>> + From<RawOrigin<Self::AccountId>>;
type Index: Parameter + Member + Default + MaybeDisplay + SimpleArithmetic + Copy;
type BlockNumber: Parameter + Member + MaybeDisplay + SimpleArithmetic + Default + Bounded + Copy + rstd::hash::Hash;
type Hash: Parameter + Member + MaybeDisplay + SimpleBitOps + Default + Copy + CheckEqual + rstd::hash::Hash + AsRef<[u8]> + AsMut<[u8]>;
type Index: Parameter + Member + MaybeSerializeDebugButNotDeserialize + Default + MaybeDisplay + SimpleArithmetic + Copy;
type BlockNumber: Parameter + Member + MaybeSerializeDebug + MaybeDisplay + SimpleArithmetic + Default + Bounded + Copy + rstd::hash::Hash;
type Hash: Parameter + Member + MaybeSerializeDebug + MaybeDisplay + SimpleBitOps + Default + Copy + CheckEqual + rstd::hash::Hash + AsRef<[u8]> + AsMut<[u8]>;
type Hashing: Hash<Output = Self::Hash>;
type Digest: Parameter + Member + Default + traits::Digest<Hash = Self::Hash>;
type AccountId: Parameter + Member + MaybeDisplay + Ord + Default;
type Digest: Parameter + Member + MaybeSerializeDebugButNotDeserialize + Default + traits::Digest<Hash = Self::Hash>;
type AccountId: Parameter + Member + MaybeSerializeDebug + MaybeDisplay + Ord + Default;
type Header: Parameter + traits::Header<
Number = Self::BlockNumber,
Hash = Self::Hash,
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec-derive = { version = "2.1", default-features = false }
parity-codec = { version = "2.1", default-features = false }
substrate-primitives = { path = "../../core/primitives", default-features = false }
@@ -29,7 +28,6 @@ std = [
"sr-primitives/std",
"srml-consensus/std",
"serde/std",
"serde_derive",
"parity-codec-derive/std",
"parity-codec/std",
"substrate-primitives/std",
-4
View File
@@ -39,10 +39,6 @@ extern crate sr_std as rstd;
#[macro_use]
extern crate srml_support as runtime_support;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[cfg(test)]
extern crate substrate_primitives;
#[cfg(test)]
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
substrate-primitives = { path = "../../core/primitives", default-features = false }
@@ -21,7 +20,6 @@ srml-balances = { path = "../balances", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"parity-codec/std",
"parity-codec-derive/std",
"substrate-primitives/std",
-4
View File
@@ -25,10 +25,6 @@ extern crate srml_support as runtime_support;
#[cfg(test)]
extern crate sr_io as runtime_io;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[cfg(feature = "std")]
extern crate serde;
-2
View File
@@ -6,7 +6,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "2.1", default-features = false }
parity-codec-derive = { version = "2.1", default-features = false }
substrate-primitives = { path = "../../core/primitives", default-features = false }
@@ -21,7 +20,6 @@ srml-consensus = { path = "../consensus", default-features = false }
default = ["std"]
std = [
"serde/std",
"serde_derive",
"parity-codec/std",
"parity-codec-derive/std",
"sr-std/std",
-3
View File
@@ -25,9 +25,6 @@ extern crate sr_io;
#[cfg(test)]
extern crate substrate_primitives;
extern crate sr_primitives;
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate parity_codec_derive;
extern crate parity_codec as codec;