Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Optional serde for phragmen support #3994

Merged
merged 10 commits into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/chain-spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
substrate-chain-spec-derive = { path = "./derive" }
impl-trait-for-tuples = "0.1.2"
impl-trait-for-tuples = "0.1.3"
network = { package = "substrate-network", path = "../../core/network" }
primitives = { package = "substrate-primitives", path = "../primitives" }
serde = { version = "1.0.101", features = ["derive"] }
Expand Down
4 changes: 3 additions & 1 deletion core/phragmen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

[dependencies]
sr-primitives = { path = "../sr-primitives", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
sr-primitives = { path = "../sr-primitives", default-features = false }

[dev-dependencies]
runtime-io ={ package = "sr-io", path = "../sr-io" }
Expand All @@ -16,6 +17,7 @@ rand = "0.7.2"
[features]
default = ["std"]
std = [
"serde",
"rstd/std",
"sr-primitives/std",
]
3 changes: 3 additions & 0 deletions core/phragmen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
use serde::{Serialize, Deserialize};
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
use rstd::{prelude::*, collections::btree_map::BTreeMap};
use sr_primitives::RuntimeDebug;
use sr_primitives::{helpers_128bit::multiply_by_rational, Perbill, Rational128};
Expand Down Expand Up @@ -116,6 +118,7 @@ pub struct PhragmenResult<AccountId> {
/// This, at the current version, resembles the `Exposure` defined in the staking SRML module, yet
/// they do not necessarily have to be the same.
#[derive(Default, RuntimeDebug)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
pub struct Support<AccountId> {
/// The amount of support as the effect of self-vote.
pub own: ExtendedBalance,
Expand Down
2 changes: 1 addition & 1 deletion core/sr-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runtime_io = { package = "sr-io", path = "../sr-io", default-features = false }
log = { version = "0.4.8", optional = true }
paste = "0.1.6"
rand = { version = "0.7.2", optional = true }
impl-trait-for-tuples = "0.1.2"
impl-trait-for-tuples = "0.1.3"

[dev-dependencies]
serde_json = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion srml/authorship/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sr-primitives = { path = "../../core/sr-primitives", default-features = false }
support = { package = "srml-support", path = "../support", default-features = false }
system = { package = "srml-system", path = "../system", default-features = false }
runtime-io ={ package = "sr-io", path = "../../core/sr-io", default-features = false }
impl-trait-for-tuples = "0.1.2"
impl-trait-for-tuples = "0.1.3"

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion srml/finality-tracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rstd = { package = "sr-std", path = "../../core/sr-std", default-features = fals
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
support = { package = "srml-support", path = "../support", default-features = false }
srml-system = { path = "../system", default-features = false }
impl-trait-for-tuples = "0.1.2"
impl-trait-for-tuples = "0.1.3"

[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion srml/support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ srml-support-procedural = { package = "srml-support-procedural", path = "./proce
paste = "0.1.6"
once_cell = { version = "0.2.4", default-features = false, optional = true }
bitmask = { version = "0.5.0", default-features = false }
impl-trait-for-tuples = "0.1.2"
impl-trait-for-tuples = "0.1.3"

[dev-dependencies]
pretty_assertions = "0.6.1"
Expand Down
2 changes: 1 addition & 1 deletion srml/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runtime-io ={ package = "sr-io", path = "../../core/sr-io", default-features = f
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
sr-version = { path = "../../core/sr-version", default-features = false }
support = { package = "srml-support", path = "../support", default-features = false }
impl-trait-for-tuples = "0.1.2"
impl-trait-for-tuples = "0.1.3"

[dev-dependencies]
criterion = "0.2.11"
Expand Down
2 changes: 1 addition & 1 deletion srml/timestamp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sr-primitives = { path = "../../core/sr-primitives", default-features = false }
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
support = { package = "srml-support", path = "../support", default-features = false }
system = { package = "srml-system", path = "../system", default-features = false }
impl-trait-for-tuples = "0.1.2"
impl-trait-for-tuples = "0.1.3"

[dev-dependencies]
runtime-io ={ package = "sr-io", path = "../../core/sr-io" }
Expand Down