mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
Use serde derive feature. (#2351)
* core/primitives * sr-primitives * sr-primitives * srml-treasury * substrate-executor * substrate-keystore * network-libp2p * substrate-service * srml-system * substrate-rpc * sr-version * substrate-telemetry * substrate-test-runtime * substrate-transaction-pool * node-template-runtime * node-primitives * srml-consensus * srml-contract * srml-democracy * srml-finality-tracker * srml-grandpa * srml-metadata * srml-support * Clean * Update locks
This commit is contained in:
committed by
Bastian Köcher
parent
08fda211d8
commit
e2bb429711
@@ -6,8 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
parity-codec = { version = "3.3", default-features = false, features = ["derive"] }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
@@ -23,7 +22,6 @@ runtime_io = { package = "sr-io", path = "../../core/sr-io" }
|
||||
default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"rstd/std",
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
use rstd::prelude::*;
|
||||
use parity_codec as codec;
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
@@ -5,8 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
pwasm-utils = { version = "0.6.1", default-features = false }
|
||||
parity-codec = { version = "3.3", default-features = false, features = ["derive"] }
|
||||
parity-wasm = { version = "0.31", default-features = false }
|
||||
@@ -34,7 +33,6 @@ core = [
|
||||
]
|
||||
std = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"runtime-primitives/std",
|
||||
|
||||
@@ -91,7 +91,7 @@ use crate::exec::ExecutionContext;
|
||||
use crate::account_db::{AccountDb, DirectAccountDb};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use serde::{Serialize, Deserialize};
|
||||
use substrate_primitives::crypto::UncheckedFrom;
|
||||
use rstd::prelude::*;
|
||||
use rstd::marker::PhantomData;
|
||||
|
||||
@@ -6,8 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "3.3", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
@@ -24,7 +23,6 @@ balances = { package = "srml-balances", path = "../balances" }
|
||||
default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"safe-mix/std",
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Voting thresholds.
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use serde::{Serialize, Deserialize};
|
||||
use parity_codec::{Encode, Decode};
|
||||
use primitives::traits::{Zero, IntegerSquareRoot};
|
||||
use rstd::ops::{Add, Mul, Div, Rem};
|
||||
|
||||
@@ -6,8 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", default-features = false }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
parity-codec = { version = "3.3", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
@@ -25,7 +24,6 @@ parking_lot = "0.7"
|
||||
default = ["std"]
|
||||
std = [
|
||||
"serde/std",
|
||||
"serde_derive",
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
|
||||
@@ -5,9 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
#hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
parity-codec = { version = "3.3", default-features = false, features = ["derive"] }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
substrate-finality-grandpa-primitives = { path = "../../core/finality-grandpa/primitives", default-features = false }
|
||||
@@ -26,7 +24,6 @@ runtime_io = { package = "sr-io", path = "../../core/sr-io" }
|
||||
default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"substrate-finality-grandpa-primitives/std",
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
pub use substrate_finality_grandpa_primitives as fg_primitives;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
use rstd::prelude::*;
|
||||
use parity_codec as codec;
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
@@ -6,8 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
parity-codec = { version = "3.3", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
|
||||
@@ -18,5 +17,4 @@ std = [
|
||||
"rstd/std",
|
||||
"primitives/std",
|
||||
"serde",
|
||||
"serde_derive"
|
||||
]
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "std")]
|
||||
use parity_codec::{Decode, Input};
|
||||
use parity_codec::{Encode, Output};
|
||||
|
||||
@@ -6,8 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = { version = "0.1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
parity-codec = { version = "3.5.1", default-features = false, features = ["derive"] }
|
||||
srml-metadata = { path = "../metadata", default-features = false }
|
||||
sr-std = { path = "../../core/sr-std", default-features = false }
|
||||
@@ -29,7 +28,6 @@ std = [
|
||||
"once_cell",
|
||||
"bitmask/std",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"runtime_io/std",
|
||||
"parity-codec/std",
|
||||
"sr-std/std",
|
||||
|
||||
@@ -28,8 +28,6 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn
|
||||
/// extern crate srml_support;
|
||||
/// #[macro_use]
|
||||
/// extern crate parity_codec as codec;
|
||||
/// #[macro_use]
|
||||
/// extern crate serde_derive;
|
||||
///
|
||||
/// decl_event!(
|
||||
/// pub enum Event {
|
||||
@@ -48,8 +46,6 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn
|
||||
/// extern crate parity_codec as codec;
|
||||
/// #[macro_use]
|
||||
/// extern crate parity_codec;
|
||||
/// #[macro_use]
|
||||
/// extern crate serde_derive;
|
||||
///
|
||||
/// trait Trait {
|
||||
/// type Balance;
|
||||
@@ -97,8 +93,6 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn
|
||||
/// extern crate parity_codec as codec;
|
||||
/// #[macro_use]
|
||||
/// extern crate parity_codec;
|
||||
/// #[macro_use]
|
||||
/// extern crate serde_derive;
|
||||
///
|
||||
///# struct DefaultInstance;
|
||||
///# trait Instance {}
|
||||
@@ -509,7 +503,7 @@ macro_rules! __impl_outer_event_json_metadata {
|
||||
#[allow(dead_code)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
use parity_codec::{Encode, Decode};
|
||||
|
||||
mod system {
|
||||
|
||||
@@ -159,7 +159,7 @@ pub enum Void {}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[doc(hidden)]
|
||||
pub use serde_derive::*;
|
||||
pub use serde::{Serialize, Deserialize};
|
||||
|
||||
/// Programatically create derivations for tuples of up to 19 elements. You provide a second macro
|
||||
/// which is called once per tuple size, along with a number of identifiers, one for each element
|
||||
|
||||
@@ -5,8 +5,7 @@ authors = ["thiolliere <gui.thiolliere@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dev-dependencies]
|
||||
serde = { version = "1.0", default-features = false }
|
||||
serde_derive = { version = "1.0" }
|
||||
serde = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
parity-codec = { version = "3.3", default-features = false, features = ["derive"] }
|
||||
runtime_io = { package = "sr-io", path = "../../../core/sr-io", default-features = false }
|
||||
srml-support = { path = "../", default-features = false }
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#![recursion_limit="128"]
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
use runtime_io::{with_externalities, Blake2Hasher};
|
||||
use srml_support::rstd::prelude::*;
|
||||
use srml_support::rstd as rstd;
|
||||
@@ -168,7 +168,7 @@ mod module1 {
|
||||
>;
|
||||
|
||||
/// A logs in this module.
|
||||
#[cfg_attr(feature = "std", derive(serde_derive::Serialize, Debug))]
|
||||
#[cfg_attr(feature = "std", derive(serde::Serialize, Debug))]
|
||||
#[derive(parity_codec::Encode, parity_codec::Decode, PartialEq, Eq, Clone)]
|
||||
pub enum RawLog<T, I> {
|
||||
_Phantom(rstd::marker::PhantomData<(T, I)>),
|
||||
@@ -242,7 +242,7 @@ mod module2 {
|
||||
>;
|
||||
|
||||
/// A logs in this module.
|
||||
#[cfg_attr(feature = "std", derive(serde_derive::Serialize, Debug))]
|
||||
#[cfg_attr(feature = "std", derive(serde::Serialize, Debug))]
|
||||
#[derive(parity_codec::Encode, parity_codec::Decode, PartialEq, Eq, Clone)]
|
||||
pub enum RawLog<T, I=DefaultInstance> {
|
||||
_Phantom(rstd::marker::PhantomData<(T, I)>),
|
||||
|
||||
@@ -6,8 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "3.5", default-features = false, features = ["derive"] }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
@@ -23,7 +22,6 @@ criterion = "0.2"
|
||||
default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"safe-mix/std",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
@@ -35,4 +33,4 @@ std = [
|
||||
|
||||
[[bench]]
|
||||
name = "bench"
|
||||
harness = false
|
||||
harness = false
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
use rstd::prelude::*;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use rstd::map;
|
||||
|
||||
@@ -6,8 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
parity-codec = { version = "3.3", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
@@ -23,7 +22,6 @@ substrate-primitives = { path = "../../core/primitives" }
|
||||
default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"runtime_primitives/std",
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use serde::{Serialize, Deserialize};
|
||||
use rstd::prelude::*;
|
||||
use srml_support::{StorageValue, StorageMap, decl_module, decl_storage, decl_event, ensure};
|
||||
use srml_support::traits::{Currency, ReservableCurrency, OnDilution, OnUnbalanced, Imbalance};
|
||||
|
||||
Reference in New Issue
Block a user