Migrate rpc-servers, serializer, service and sr-io to the 2018 edition (#1732)

This commit is contained in:
Stanislav Tkach
2019-02-08 14:10:05 +02:00
committed by Bastian Köcher
parent 91114c6c11
commit 31188dc013
30 changed files with 62 additions and 133 deletions
+7 -6
View File
@@ -3,32 +3,33 @@ name = "sr-io"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
edition = "2018"
[build-dependencies]
rustc_version = "0.2"
[dependencies]
sr-std = { path = "../sr-std", default-features = false }
substrate-primitives = { path = "../primitives", default-features = false }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
primitives = { package = "substrate-primitives", path = "../primitives", default-features = false }
parity-codec = { version = "3.0", default-features = false }
hash-db = { version = "0.11", default-features = false }
libsecp256k1 = { version = "0.2.1", optional = true }
tiny-keccak = { version = "1.4.2", optional = true }
environmental = { version = "~1.0", optional = true }
substrate-state-machine = { path = "../state-machine", optional = true }
substrate-trie = { path = "../trie", optional = true }
trie = { package = "substrate-trie", path = "../trie", optional = true }
[features]
default = ["std"]
std = [
"substrate-primitives/std",
"primitives/std",
"parity-codec/std",
"sr-std/std",
"rstd/std",
"hash-db/std",
"environmental",
"substrate-state-machine",
"substrate-trie",
"trie",
"libsecp256k1",
"tiny-keccak"
]
-1
View File
@@ -1,6 +1,5 @@
//! Set a nightly feature
extern crate rustc_version;
use rustc_version::{version, version_meta, Channel};
fn main() {
+5 -18
View File
@@ -14,34 +14,20 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
#[macro_use]
extern crate environmental;
#[cfg_attr(test, macro_use)]
extern crate substrate_primitives as primitives;
extern crate substrate_state_machine;
extern crate substrate_trie as trie;
extern crate hash_db;
extern crate tiny_keccak;
extern crate secp256k1;
#[doc(hidden)]
pub extern crate parity_codec as codec;
pub use parity_codec as codec;
// re-export hashing functions.
pub use primitives::{blake2_256, twox_128, twox_256, ed25519};
pub use primitives::{blake2_256, twox_128, twox_256, ed25519, Blake2Hasher};
pub use tiny_keccak::keccak256 as keccak_256;
pub use primitives::{Blake2Hasher};
// Switch to this after PoC-3
// pub use primitives::BlakeHasher;
pub use substrate_state_machine::{Externalities, TestExternalities};
use environmental::{environmental, thread_local_impl};
use primitives::hexdisplay::HexDisplay;
use primitives::H256;
use hash_db::Hasher;
environmental!(ext: trait Externalities<Blake2Hasher>);
/// Get `key` from storage and return a `Vec`, empty if there's a problem.
@@ -253,6 +239,7 @@ pub fn print<T: Printable + Sized>(value: T) {
#[cfg(test)]
mod std_tests {
use super::*;
use primitives::map;
#[test]
fn storage_works() {
+3 -8
View File
@@ -14,21 +14,16 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
extern crate substrate_primitives as primitives;
extern crate hash_db;
#[doc(hidden)]
pub extern crate sr_std as rstd;
pub use parity_codec as codec;
#[doc(hidden)]
pub extern crate parity_codec as codec;
pub use rstd;
pub use rstd::{mem, slice};
use core::intrinsics;
use rstd::vec::Vec;
use hash_db::Hasher;
use primitives::Blake2Hasher;
pub use rstd::{mem, slice};
#[panic_handler]
#[no_mangle]