Migrate sr-primitives, sr-sandbox, sr-std and sr-version to the 2018 edition (#1694)

This commit is contained in:
Stanislav Tkach
2019-02-06 20:04:14 +02:00
committed by Gav Wood
parent 4e3eace15f
commit 3a4dda7beb
24 changed files with 113 additions and 122 deletions
+5 -4
View File
@@ -2,6 +2,7 @@
name = "sr-version"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
impl-serde = { version = "0.1", optional = true }
@@ -9,8 +10,8 @@ serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "3.0", default-features = false }
parity-codec-derive = { version = "3.0", default-features = false }
sr-std = { path = "../sr-std", default-features = false }
sr-primitives = { path = "../sr-primitives", default-features = false }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
runtime_primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false }
[features]
default = ["std"]
@@ -19,6 +20,6 @@ std = [
"serde/std",
"serde_derive",
"parity-codec/std",
"sr-std/std",
"sr-primitives/std",
"rstd/std",
"runtime_primitives/std",
]
+3 -14
View File
@@ -19,18 +19,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")]
#[macro_use]
extern crate serde_derive;
#[allow(unused_imports)]
#[macro_use]
extern crate sr_std as rstd;
#[macro_use]
extern crate parity_codec_derive;
extern crate sr_primitives as runtime_primitives;
use serde_derive::Serialize;
#[cfg(feature = "std")]
use std::fmt;
#[cfg(feature = "std")]
@@ -70,8 +59,8 @@ macro_rules! create_apis_vec {
/// This triplet have different semantics and mis-interpretation could cause problems.
/// In particular: bug fixes should result in an increment of `spec_version` and possibly `authoring_version`,
/// absolutely not `impl_version` since they change the semantics of the runtime.
#[derive(Clone, PartialEq, Eq, Encode)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Decode))]
#[derive(Clone, PartialEq, Eq, parity_codec_derive::Encode)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, parity_codec_derive::Decode))]
#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))]
pub struct RuntimeVersion {
/// Identifies the different Substrate runtimes. There'll be at least polkadot and node.