mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 14:47:55 +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
@@ -20,7 +20,7 @@
|
||||
use std::fmt;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
|
||||
use rstd::prelude::*;
|
||||
use crate::codec::{Codec, Encode, Decode};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Generic implementation of a digest.
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
|
||||
use rstd::prelude::*;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Generic implementation of an unchecked (pre-verification) extrinsic.
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::codec::{Decode, Encode, Input, Output};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Generic implementation of a block header.
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
use crate::codec::{Decode, Encode, Codec, Input, Output, HasCompact, EncodeAsRef};
|
||||
use crate::traits::{self, Member, SimpleArithmetic, SimpleBitOps, MaybeDisplay,
|
||||
Hash as HashT, DigestItem as DigestItemT, MaybeSerializeDebug, MaybeSerializeDebugButNotDeserialize};
|
||||
|
||||
@@ -191,7 +191,7 @@ mod tests {
|
||||
use super::*;
|
||||
use runtime_io::blake2_256;
|
||||
use crate::codec::{Encode, Decode};
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
struct TestContext;
|
||||
impl Lookup for TestContext {
|
||||
|
||||
@@ -190,7 +190,7 @@ mod tests {
|
||||
use super::*;
|
||||
use runtime_io::blake2_256;
|
||||
use crate::codec::{Encode, Decode};
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
struct TestContext;
|
||||
impl Lookup for TestContext {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
pub use parity_codec as codec;
|
||||
#[cfg(feature = "std")]
|
||||
#[doc(hidden)]
|
||||
pub use serde_derive;
|
||||
pub use serde;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use runtime_io::{StorageOverlay, ChildrenStorageOverlay};
|
||||
@@ -83,9 +83,7 @@ macro_rules! create_runtime_str {
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use serde::{Serialize, de::DeserializeOwned};
|
||||
#[cfg(feature = "std")]
|
||||
pub use serde_derive::{Serialize, Deserialize};
|
||||
pub use serde::{Serialize, Deserialize, de::DeserializeOwned};
|
||||
|
||||
/// Complex storage builder stuff.
|
||||
#[cfg(feature = "std")]
|
||||
@@ -528,7 +526,7 @@ macro_rules! impl_outer_config {
|
||||
) => {
|
||||
$crate::__impl_outer_config_types! { $concrete $( $config $snake $( < $generic $(, $instance)? > )* )* }
|
||||
#[cfg(any(feature = "std", test))]
|
||||
#[derive($crate::serde_derive::Serialize, $crate::serde_derive::Deserialize)]
|
||||
#[derive($crate::serde::Serialize, $crate::serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct $main {
|
||||
@@ -576,7 +574,7 @@ macro_rules! impl_outer_log {
|
||||
/// Wrapper for all possible log entries for the `$trait` runtime. Provides binary-compatible
|
||||
/// `Encode`/`Decode` implementations with the corresponding `generic::DigestItem`.
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "std", derive(Debug, $crate::serde_derive::Serialize))]
|
||||
#[cfg_attr(feature = "std", derive(Debug, $crate::serde::Serialize))]
|
||||
$(#[$attr])*
|
||||
#[allow(non_camel_case_types)]
|
||||
pub struct $name($internal);
|
||||
@@ -584,7 +582,7 @@ macro_rules! impl_outer_log {
|
||||
/// All possible log entries for the `$trait` runtime. `Encode`/`Decode` implementations
|
||||
/// are auto-generated => it is not binary-compatible with `generic::DigestItem`.
|
||||
#[derive(Clone, PartialEq, Eq, $crate::codec::Encode, $crate::codec::Decode)]
|
||||
#[cfg_attr(feature = "std", derive(Debug, $crate::serde_derive::Serialize))]
|
||||
#[cfg_attr(feature = "std", derive(Debug, $crate::serde::Serialize))]
|
||||
$(#[$attr])*
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum InternalLog {
|
||||
@@ -728,7 +726,7 @@ mod tests {
|
||||
mod a {
|
||||
use super::RuntimeT;
|
||||
use crate::codec::{Encode, Decode};
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
pub type Log<R> = RawLog<<R as RuntimeT>::AuthorityId>;
|
||||
|
||||
#[derive(Serialize, Debug, Encode, Decode, PartialEq, Eq, Clone)]
|
||||
@@ -738,7 +736,7 @@ mod tests {
|
||||
mod b {
|
||||
use super::RuntimeT;
|
||||
use crate::codec::{Encode, Decode};
|
||||
use serde_derive::Serialize;
|
||||
use serde::Serialize;
|
||||
pub type Log<R> = RawLog<<R as RuntimeT>::AuthorityId>;
|
||||
|
||||
#[derive(Serialize, Debug, Encode, Decode, PartialEq, Eq, Clone)]
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
//! Testing utilities.
|
||||
|
||||
use serde::{Serialize, Serializer, Deserialize, de::Error as DeError, Deserializer};
|
||||
use serde_derive::Serialize;
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::Deserialize;
|
||||
use std::{fmt::Debug, ops::Deref, fmt};
|
||||
use crate::codec::{Codec, Encode, Decode};
|
||||
use crate::traits::{self, Checkable, Applyable, BlakeTwo256, Convert};
|
||||
|
||||
@@ -20,9 +20,7 @@ use rstd::prelude::*;
|
||||
use rstd::{self, result, marker::PhantomData};
|
||||
use runtime_io;
|
||||
#[cfg(feature = "std")] use std::fmt::{Debug, Display};
|
||||
#[cfg(feature = "std")] use serde::{Serialize, de::DeserializeOwned};
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
#[cfg(feature = "std")] use serde::{Serialize, Deserialize, de::DeserializeOwned};
|
||||
use substrate_primitives::{self, Hasher, Blake2Hasher};
|
||||
use crate::codec::{Codec, Encode, HasCompact};
|
||||
pub use integer_sqrt::IntegerSquareRoot;
|
||||
|
||||
Reference in New Issue
Block a user