git.delta.rocks / unique-network / refs/commits / 4a53d88957b6

difftreelog

fix serde no_std usage

Yaroslav Bolyukin2021-06-02parent: #5e83d89.patch.diff
in: master

6 files changed

modifiedpallets/inflation/Cargo.tomldiffbeforeafterboth
--- a/pallets/inflation/Cargo.toml
+++ b/pallets/inflation/Cargo.toml
@@ -19,7 +19,7 @@
 version = '2.0.0'
 
 [dependencies]
-serde = { version = "1.0.119" }
+serde = { default-features = false, version = "1.0.119", features = ["derive"] }
 frame-support = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
 frame-system = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
 pallet-balances = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
modifiedpallets/inflation/src/lib.rsdiffbeforeafterboth
--- a/pallets/inflation/src/lib.rs
+++ b/pallets/inflation/src/lib.rs
@@ -10,8 +10,7 @@
 #[cfg(feature = "std")]
 pub use std::*;
 
-#[cfg(feature = "std")]
-pub use serde::*;
+pub use serde::{Serialize, Deserialize};
 
 #[cfg(feature = "runtime-benchmarks")]
 mod benchmarking;
modifiedpallets/nft/Cargo.tomldiffbeforeafterboth
before · pallets/nft/Cargo.toml
1[package]2authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']3description = 'FRAME pallet nft'4edition = '2018'5homepage = 'https://substrate.io'6license = 'Unlicense'7name = 'pallet-nft'8repository = 'https://github.com/substrate-developer-hub/nft/'9version = '3.0.0'1011[package.metadata.docs.rs]12targets = ['x86_64-unknown-linux-gnu']1314# alias "parity-scale-code" to "codec"15[dependencies.codec]16default-features = false17features = ['derive']18package = 'parity-scale-codec'19version = '2.0.0'2021[dependencies]22serde = { version = "1.0.119" }23frame-support = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }24frame-system = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }25pallet-balances = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }26pallet-evm = { default-features = false, version = "3.0.1-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions" }27pallet-ethereum = { default-features = false, version = "1.0.1-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions" }28pallet-timestamp = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }29pallet-randomness-collective-flip = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }30sp-std = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }31frame-benchmarking = { default-features = false, version = '3.0.0', optional = true, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }32fp-evm = { default-features = false, version = '1.0.1-dev', git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions" }33sp-core = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }34sp-io = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }35sp-api = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }36sp-runtime = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }37pallet-contracts = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }38pallet-transaction-payment = { default-features = false, version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }3940ethereum-tx-sign = { version = "3.0.4", optional = true }41ethereum = { default-features = false, version = "0.7.1" }42rlp = { default-features = false, version = "0.5.0" }4344hex-literal = "0.3.1"4546[features]47default = ['std']48std = [49    'codec/std',50    'serde/std',51    'frame-support/std',52    'frame-system/std',53    'pallet-balances/std',54    'pallet-evm/std',55    'pallet-timestamp/std',56    'pallet-contracts/std',57    'pallet-randomness-collective-flip/std',58    'pallet-transaction-payment/std',59    'fp-evm/std',60    'sp-std/std',61    'sp-runtime/std',62    'frame-benchmarking/std',63    'ethereum/std',64    'rlp/std',6566    'ethereum-tx-sign',67]68runtime-benchmarks = ["frame-benchmarking"]
modifiedpallets/nft/src/eth/account.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/account.rs
+++ b/pallets/nft/src/eth/account.rs
@@ -2,7 +2,6 @@
 use codec::{Encode, EncodeLike, Decode};
 use sp_core::{H160, H256, crypto::AccountId32};
 use core::cmp::Ordering;
-#[cfg(feature = "std")]
 use serde::{Serialize, Deserialize};
 use pallet_evm::AddressMapping;
 use sp_std::vec::Vec;
@@ -21,7 +20,7 @@
 }
 
 #[derive(Eq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Serialize, Deserialize)]
 pub struct BasicCrossAccountId<T: Config> {
     /// If true - then ethereum is canonical encoding
     from_ethereum: bool,
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -7,9 +7,9 @@
 
 #![cfg_attr(not(feature = "std"), no_std)]
 
-#[cfg(feature = "std")]
-pub use serde::*;
 
+pub use serde::{Serialize, Deserialize};
+
 use core::ops::{Deref, DerefMut};
 use codec::{Decode, Encode};
 pub use frame_support::{
@@ -71,7 +71,7 @@
 pub type DecimalPoints = u8;
 
 #[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Serialize, Deserialize)]
 pub enum CollectionMode {
     Invalid,
     NFT,
modifiedpallets/nft/src/types.rsdiffbeforeafterboth
--- a/pallets/nft/src/types.rs
+++ b/pallets/nft/src/types.rs
@@ -1,8 +1,7 @@
 #[cfg(feature = "std")]
 pub use std::*;
 
-#[cfg(feature = "std")]
-pub use serde::*;
+pub use serde::{Serealize, Deserialize};
 
 use codec::{Decode, Encode};