mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +00:00
Migrate rpc-servers, serializer, service and sr-io to the 2018 edition (#1732)
This commit is contained in:
committed by
Bastian Köcher
parent
91114c6c11
commit
31188dc013
Generated
-2
@@ -3581,7 +3581,6 @@ dependencies = [
|
|||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"sr-primitives 0.1.0",
|
"sr-primitives 0.1.0",
|
||||||
"structopt 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"structopt 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"substrate-client 0.1.0",
|
"substrate-client 0.1.0",
|
||||||
@@ -3611,7 +3610,6 @@ dependencies = [
|
|||||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"sr-api-macros 0.1.0",
|
"sr-api-macros 0.1.0",
|
||||||
"sr-primitives 0.1.0",
|
"sr-primitives 0.1.0",
|
||||||
"sr-std 0.1.0",
|
"sr-std 0.1.0",
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ log = "0.4"
|
|||||||
atty = "0.2"
|
atty = "0.2"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
time = "0.1"
|
time = "0.1"
|
||||||
slog = "^2"
|
|
||||||
ansi_term = "0.11"
|
ansi_term = "0.11"
|
||||||
lazy_static = "1.0"
|
lazy_static = "1.0"
|
||||||
app_dirs = "1.2"
|
app_dirs = "1.2"
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ use network::{SyncState, SyncProvider};
|
|||||||
use client::{backend::Backend, BlockchainEvents};
|
use client::{backend::Backend, BlockchainEvents};
|
||||||
use substrate_telemetry::telemetry;
|
use substrate_telemetry::telemetry;
|
||||||
use log::{debug, info, warn};
|
use log::{debug, info, warn};
|
||||||
use slog::slog_info;
|
|
||||||
|
|
||||||
use runtime_primitives::generic::BlockId;
|
use runtime_primitives::generic::BlockId;
|
||||||
use runtime_primitives::traits::{Header, As};
|
use runtime_primitives::traits::{Header, As};
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ log = { version = "0.4", optional = true }
|
|||||||
parking_lot = { version = "0.7.1", optional = true }
|
parking_lot = { version = "0.7.1", optional = true }
|
||||||
hex = { package = "hex-literal", version = "0.1", optional = true }
|
hex = { package = "hex-literal", version = "0.1", optional = true }
|
||||||
futures = { version = "0.1.17", optional = true }
|
futures = { version = "0.1.17", optional = true }
|
||||||
slog = { version = "^2", optional = true }
|
|
||||||
heapsize = { version = "0.4", optional = true }
|
heapsize = { version = "0.4", optional = true }
|
||||||
consensus = { package = "substrate-consensus-common", path = "../consensus/common", optional = true }
|
consensus = { package = "substrate-consensus-common", path = "../consensus/common", optional = true }
|
||||||
executor = { package = "substrate-executor", path = "../executor", optional = true }
|
executor = { package = "substrate-executor", path = "../executor", optional = true }
|
||||||
@@ -49,7 +48,6 @@ std = [
|
|||||||
"log",
|
"log",
|
||||||
"hex",
|
"hex",
|
||||||
"futures",
|
"futures",
|
||||||
"slog",
|
|
||||||
"heapsize",
|
"heapsize",
|
||||||
"executor",
|
"executor",
|
||||||
"runtime-primitives/std",
|
"runtime-primitives/std",
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ use crate::genesis;
|
|||||||
use consensus;
|
use consensus;
|
||||||
use substrate_telemetry::telemetry;
|
use substrate_telemetry::telemetry;
|
||||||
|
|
||||||
use slog::slog_info;
|
|
||||||
use log::{info, trace, warn};
|
use log::{info, trace, warn};
|
||||||
use error_chain::bail;
|
use error_chain::bail;
|
||||||
|
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
fn light_aux_store_is_updated_via_non_importing_op() {
|
fn light_aux_store_is_updated_via_non_importing_op() {
|
||||||
let backend = Backend::new(Arc::new(DummyBlockchain::new(DummyStorage::new())));
|
let backend = Backend::new(Arc::new(DummyBlockchain::new(DummyStorage::new())));
|
||||||
let mut op = ClientBackend::<Block, Blake2Hasher>::begin_operation(&backend).unwrap();
|
let mut op = ClientBackend::<Block, Blake2Hasher>::begin_operation(&backend).unwrap();
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
#![cfg_attr(not(feature = "std"), feature(alloc))]
|
#![cfg_attr(not(feature = "std"), feature(alloc))]
|
||||||
|
|
||||||
|
/// Creates a vector of given pairs and calls `collect` on the iterator from it.
|
||||||
|
/// Can be used to create a `HashMap`.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! map {
|
macro_rules! map {
|
||||||
($( $name:expr => $value:expr ),*) => (
|
($( $name:expr => $value:expr ),*) => (
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
name = "substrate-rpc-servers"
|
name = "substrate-rpc-servers"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
jsonrpc-http-server = "10.0.1"
|
http = { package = "jsonrpc-http-server", version = "10.0.1" }
|
||||||
jsonrpc-pubsub = "10.0.1"
|
pubsub = { package = "jsonrpc-pubsub", version = "10.0.1" }
|
||||||
jsonrpc-ws-server = "10.0.1"
|
ws = { package = "jsonrpc-ws-server", version = "10.0.1" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
substrate-rpc = { path = "../rpc", version = "0.1" }
|
substrate-rpc = { path = "../rpc", version = "0.1" }
|
||||||
|
|||||||
@@ -18,18 +18,10 @@
|
|||||||
|
|
||||||
#[warn(missing_docs)]
|
#[warn(missing_docs)]
|
||||||
|
|
||||||
pub extern crate substrate_rpc as apis;
|
pub use substrate_rpc as apis;
|
||||||
|
|
||||||
extern crate jsonrpc_http_server as http;
|
|
||||||
extern crate jsonrpc_pubsub as pubsub;
|
|
||||||
extern crate jsonrpc_ws_server as ws;
|
|
||||||
extern crate serde;
|
|
||||||
extern crate sr_primitives;
|
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate log;
|
|
||||||
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
use log::error;
|
||||||
use sr_primitives::{traits::{Block as BlockT, NumberFor}, generic::SignedBlock};
|
use sr_primitives::{traits::{Block as BlockT, NumberFor}, generic::SignedBlock};
|
||||||
|
|
||||||
/// Maximal payload accepted by RPC servers
|
/// Maximal payload accepted by RPC servers
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
name = "substrate-serializer"
|
name = "substrate-serializer"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0", default-features = false }
|
serde = { version = "1.0", default-features = false }
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
extern crate serde;
|
|
||||||
extern crate serde_json;
|
|
||||||
|
|
||||||
pub use serde_json::{from_str, from_slice, from_reader, Result, Error};
|
pub use serde_json::{from_str, from_slice, from_reader, Result, Error};
|
||||||
|
|
||||||
const PROOF: &str = "Serializers are infallible; qed";
|
const PROOF: &str = "Serializers are infallible; qed";
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
name = "substrate-service"
|
name = "substrate-service"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "0.1.17"
|
futures = "0.1.17"
|
||||||
@@ -16,19 +17,19 @@ serde = "1.0"
|
|||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
target_info = "0.1"
|
target_info = "0.1"
|
||||||
substrate-keystore = { path = "../../core/keystore" }
|
keystore = { package = "substrate-keystore", path = "../../core/keystore" }
|
||||||
sr-io = { path = "../../core/sr-io" }
|
sr-io = { path = "../../core/sr-io" }
|
||||||
sr-primitives = { path = "../../core/sr-primitives" }
|
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives" }
|
||||||
substrate-primitives = { path = "../../core/primitives" }
|
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||||
substrate-consensus-common = { path = "../../core/consensus/common" }
|
consensus_common = { package = "substrate-consensus-common", path = "../../core/consensus/common" }
|
||||||
substrate-network = { path = "../../core/network" }
|
network = { package = "substrate-network", path = "../../core/network" }
|
||||||
substrate-client = { path = "../../core/client" }
|
client = { package = "substrate-client", path = "../../core/client" }
|
||||||
substrate-client-db = { path = "../../core/client/db" }
|
client_db = { package = "substrate-client-db", path = "../../core/client/db" }
|
||||||
parity-codec = "3.0"
|
parity-codec = "3.0"
|
||||||
substrate-executor = { path = "../../core/executor" }
|
substrate-executor = { path = "../../core/executor" }
|
||||||
substrate-transaction-pool = { path = "../../core/transaction-pool" }
|
transaction_pool = { package = "substrate-transaction-pool", path = "../../core/transaction-pool" }
|
||||||
substrate-rpc-servers = { path = "../../core/rpc-servers" }
|
rpc = { package = "substrate-rpc-servers", path = "../../core/rpc-servers" }
|
||||||
substrate-telemetry = { path = "../../core/telemetry" }
|
tel = { package = "substrate-telemetry", path = "../../core/telemetry" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
substrate-test-client = { path = "../test-client" }
|
substrate-test-client = { path = "../test-client" }
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
use std::{self, io::{Read, Write}};
|
use std::{self, io::{Read, Write}};
|
||||||
use futures::Future;
|
use futures::Future;
|
||||||
|
use log::{info, warn};
|
||||||
|
|
||||||
use runtime_primitives::generic::{SignedBlock, BlockId};
|
use runtime_primitives::generic::{SignedBlock, BlockId};
|
||||||
use runtime_primitives::traits::{As, Block, Header};
|
use runtime_primitives::traits::{As, Block, Header};
|
||||||
@@ -25,11 +26,11 @@ use consensus_common::import_queue::{ImportQueue, IncomingBlock, Link};
|
|||||||
use network::message;
|
use network::message;
|
||||||
|
|
||||||
use consensus_common::BlockOrigin;
|
use consensus_common::BlockOrigin;
|
||||||
use components::{self, Components, ServiceFactory, FactoryFullConfiguration, FactoryBlockNumber, RuntimeGenesis};
|
use crate::components::{self, Components, ServiceFactory, FactoryFullConfiguration, FactoryBlockNumber, RuntimeGenesis};
|
||||||
use new_client;
|
use crate::new_client;
|
||||||
use codec::{Decode, Encode};
|
use parity_codec::{Decode, Encode};
|
||||||
use error;
|
use crate::error;
|
||||||
use chain_spec::ChainSpec;
|
use crate::chain_spec::ChainSpec;
|
||||||
|
|
||||||
/// Export a range of blocks to a binary stream.
|
/// Export a range of blocks to a binary stream.
|
||||||
pub fn export_blocks<F, E, W>(
|
pub fn export_blocks<F, E, W>(
|
||||||
|
|||||||
@@ -19,10 +19,11 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
use serde_derive::{Serialize, Deserialize};
|
||||||
use primitives::storage::{StorageKey, StorageData};
|
use primitives::storage::{StorageKey, StorageData};
|
||||||
use runtime_primitives::{BuildStorage, StorageMap, ChildrenStorageMap};
|
use runtime_primitives::{BuildStorage, StorageMap, ChildrenStorageMap};
|
||||||
use serde_json as json;
|
use serde_json as json;
|
||||||
use components::RuntimeGenesis;
|
use crate::components::RuntimeGenesis;
|
||||||
use network::Multiaddr;
|
use network::Multiaddr;
|
||||||
|
|
||||||
enum GenesisSource<G> {
|
enum GenesisSource<G> {
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
use std::{sync::Arc, net::SocketAddr, marker::PhantomData, ops::Deref, ops::DerefMut};
|
use std::{sync::Arc, net::SocketAddr, marker::PhantomData, ops::Deref, ops::DerefMut};
|
||||||
use serde::{Serialize, de::DeserializeOwned};
|
use serde::{Serialize, de::DeserializeOwned};
|
||||||
use tokio::runtime::TaskExecutor;
|
use tokio::runtime::TaskExecutor;
|
||||||
use chain_spec::ChainSpec;
|
use crate::chain_spec::ChainSpec;
|
||||||
use client_db;
|
use client_db;
|
||||||
use client::{self, Client, runtime_api::{Metadata, TaggedTransactionQueue}};
|
use client::{self, Client, runtime_api::{Metadata, TaggedTransactionQueue}};
|
||||||
use {error, Service, maybe_start_server};
|
use crate::{error, Service, maybe_start_server};
|
||||||
use consensus_common::import_queue::ImportQueue;
|
use consensus_common::import_queue::ImportQueue;
|
||||||
use network::{self, OnDemand};
|
use network::{self, OnDemand};
|
||||||
use substrate_executor::{NativeExecutor, NativeExecutionDispatch};
|
use substrate_executor::{NativeExecutor, NativeExecutionDispatch};
|
||||||
@@ -30,7 +30,7 @@ use transaction_pool::txpool::{self, Options as TransactionPoolOptions, Pool as
|
|||||||
use runtime_primitives::{
|
use runtime_primitives::{
|
||||||
BuildStorage, traits::{Block as BlockT, Header as HeaderT, ProvideRuntimeApi}, generic::BlockId
|
BuildStorage, traits::{Block as BlockT, Header as HeaderT, ProvideRuntimeApi}, generic::BlockId
|
||||||
};
|
};
|
||||||
use config::Configuration;
|
use crate::config::Configuration;
|
||||||
use primitives::{Blake2Hasher, H256};
|
use primitives::{Blake2Hasher, H256};
|
||||||
use rpc::{self, apis::system::SystemInfo};
|
use rpc::{self, apis::system::SystemInfo};
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
@@ -535,7 +535,7 @@ impl<Factory: ServiceFactory> Components for LightComponents<Factory> {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use codec::Encode;
|
use parity_codec::Encode;
|
||||||
use consensus_common::BlockOrigin;
|
use consensus_common::BlockOrigin;
|
||||||
use substrate_test_client::{
|
use substrate_test_client::{
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use transaction_pool;
|
use transaction_pool;
|
||||||
use chain_spec::ChainSpec;
|
use crate::chain_spec::ChainSpec;
|
||||||
pub use client::ExecutionStrategy;
|
pub use client::ExecutionStrategy;
|
||||||
pub use client_db::PruningMode;
|
pub use client_db::PruningMode;
|
||||||
pub use network::config::{NetworkConfiguration, Roles};
|
pub use network::config::{NetworkConfiguration, Roles};
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ use client;
|
|||||||
use network;
|
use network;
|
||||||
use keystore;
|
use keystore;
|
||||||
use consensus_common;
|
use consensus_common;
|
||||||
|
use error_chain::*;
|
||||||
|
|
||||||
error_chain! {
|
error_chain! {
|
||||||
foreign_links {
|
foreign_links {
|
||||||
|
|||||||
@@ -19,39 +19,6 @@
|
|||||||
|
|
||||||
#![warn(unused_extern_crates)]
|
#![warn(unused_extern_crates)]
|
||||||
|
|
||||||
extern crate futures;
|
|
||||||
extern crate exit_future;
|
|
||||||
extern crate serde;
|
|
||||||
extern crate serde_json;
|
|
||||||
extern crate parking_lot;
|
|
||||||
extern crate substrate_keystore as keystore;
|
|
||||||
extern crate substrate_primitives as primitives;
|
|
||||||
extern crate sr_primitives as runtime_primitives;
|
|
||||||
extern crate substrate_consensus_common as consensus_common;
|
|
||||||
extern crate substrate_network as network;
|
|
||||||
extern crate substrate_executor;
|
|
||||||
extern crate substrate_client as client;
|
|
||||||
extern crate substrate_client_db as client_db;
|
|
||||||
extern crate parity_codec as codec;
|
|
||||||
extern crate substrate_transaction_pool as transaction_pool;
|
|
||||||
extern crate substrate_rpc_servers as rpc;
|
|
||||||
extern crate target_info;
|
|
||||||
extern crate tokio;
|
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate substrate_telemetry as tel;
|
|
||||||
#[macro_use]
|
|
||||||
extern crate error_chain;
|
|
||||||
#[macro_use]
|
|
||||||
extern crate slog; // needed until we can reexport `slog_info` from `substrate_telemetry`
|
|
||||||
#[macro_use]
|
|
||||||
extern crate log;
|
|
||||||
#[macro_use]
|
|
||||||
extern crate serde_derive;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
extern crate substrate_test_client;
|
|
||||||
|
|
||||||
mod components;
|
mod components;
|
||||||
mod error;
|
mod error;
|
||||||
mod chain_spec;
|
mod chain_spec;
|
||||||
@@ -63,6 +30,7 @@ use std::net::SocketAddr;
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub use std::{ops::Deref, result::Result, sync::Arc};
|
pub use std::{ops::Deref, result::Result, sync::Arc};
|
||||||
|
use log::{info, warn, debug};
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use keystore::Store as Keystore;
|
use keystore::Store as Keystore;
|
||||||
use client::BlockchainEvents;
|
use client::BlockchainEvents;
|
||||||
@@ -72,7 +40,8 @@ use exit_future::Signal;
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub use tokio::runtime::TaskExecutor;
|
pub use tokio::runtime::TaskExecutor;
|
||||||
use substrate_executor::NativeExecutor;
|
use substrate_executor::NativeExecutor;
|
||||||
use codec::{Encode, Decode};
|
use parity_codec::{Encode, Decode};
|
||||||
|
use tel::telemetry;
|
||||||
|
|
||||||
pub use self::error::{ErrorKind, Error};
|
pub use self::error::{ErrorKind, Error};
|
||||||
pub use config::{Configuration, Roles, PruningMode};
|
pub use config::{Configuration, Roles, PruningMode};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
name = "substrate-service-test"
|
name = "substrate-service-test"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
@@ -10,9 +11,9 @@ futures = "0.1"
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
env_logger = "0.6"
|
env_logger = "0.6"
|
||||||
fdlimit = "0.1"
|
fdlimit = "0.1"
|
||||||
substrate-service = { path = "../../../core/service" }
|
service = { package = "substrate-service", path = "../../../core/service" }
|
||||||
substrate-network = { path = "../../../core/network" }
|
network = { package = "substrate-network", path = "../../../core/network" }
|
||||||
substrate-consensus-common = { path = "../../../core/consensus/common" }
|
consensus = { package = "substrate-consensus-common", path = "../../../core/consensus/common" }
|
||||||
substrate-primitives = { path = "../../../core/primitives" }
|
primitives = { package = "substrate-primitives", path = "../../../core/primitives" }
|
||||||
substrate-client = { path = "../../../core/client" }
|
client = { package = "substrate-client", path = "../../../core/client" }
|
||||||
sr-primitives = { path = "../../../core/sr-primitives" }
|
sr-primitives = { path = "../../../core/sr-primitives" }
|
||||||
|
|||||||
@@ -16,23 +16,11 @@
|
|||||||
|
|
||||||
//! Service integration test utils.
|
//! Service integration test utils.
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate log;
|
|
||||||
extern crate tempdir;
|
|
||||||
extern crate tokio;
|
|
||||||
extern crate futures;
|
|
||||||
extern crate env_logger;
|
|
||||||
extern crate fdlimit;
|
|
||||||
extern crate substrate_service as service;
|
|
||||||
extern crate substrate_network as network;
|
|
||||||
extern crate substrate_primitives as primitives;
|
|
||||||
extern crate substrate_client as client;
|
|
||||||
extern crate substrate_consensus_common as consensus;
|
|
||||||
extern crate sr_primitives;
|
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::net::Ipv4Addr;
|
use std::net::Ipv4Addr;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use log::info;
|
||||||
use futures::{Future, Stream};
|
use futures::{Future, Stream};
|
||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::Runtime;
|
||||||
|
|||||||
@@ -3,32 +3,33 @@ name = "sr-io"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
rustc_version = "0.2"
|
rustc_version = "0.2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sr-std = { path = "../sr-std", default-features = false }
|
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
|
||||||
substrate-primitives = { path = "../primitives", default-features = false }
|
primitives = { package = "substrate-primitives", path = "../primitives", default-features = false }
|
||||||
parity-codec = { version = "3.0", default-features = false }
|
parity-codec = { version = "3.0", default-features = false }
|
||||||
hash-db = { version = "0.11", default-features = false }
|
hash-db = { version = "0.11", default-features = false }
|
||||||
libsecp256k1 = { version = "0.2.1", optional = true }
|
libsecp256k1 = { version = "0.2.1", optional = true }
|
||||||
tiny-keccak = { version = "1.4.2", optional = true }
|
tiny-keccak = { version = "1.4.2", optional = true }
|
||||||
environmental = { version = "~1.0", optional = true }
|
environmental = { version = "~1.0", optional = true }
|
||||||
substrate-state-machine = { path = "../state-machine", 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]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
std = [
|
std = [
|
||||||
"substrate-primitives/std",
|
"primitives/std",
|
||||||
"parity-codec/std",
|
"parity-codec/std",
|
||||||
"sr-std/std",
|
"rstd/std",
|
||||||
|
|
||||||
"hash-db/std",
|
"hash-db/std",
|
||||||
"environmental",
|
"environmental",
|
||||||
"substrate-state-machine",
|
"substrate-state-machine",
|
||||||
"substrate-trie",
|
"trie",
|
||||||
"libsecp256k1",
|
"libsecp256k1",
|
||||||
"tiny-keccak"
|
"tiny-keccak"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
//! Set a nightly feature
|
//! Set a nightly feature
|
||||||
|
|
||||||
extern crate rustc_version;
|
|
||||||
use rustc_version::{version, version_meta, Channel};
|
use rustc_version::{version, version_meta, Channel};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|||||||
@@ -14,34 +14,20 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
// 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)]
|
#[doc(hidden)]
|
||||||
pub extern crate parity_codec as codec;
|
pub use parity_codec as codec;
|
||||||
// re-export hashing functions.
|
// 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 tiny_keccak::keccak256 as keccak_256;
|
||||||
|
|
||||||
pub use primitives::{Blake2Hasher};
|
|
||||||
// Switch to this after PoC-3
|
// Switch to this after PoC-3
|
||||||
// pub use primitives::BlakeHasher;
|
// pub use primitives::BlakeHasher;
|
||||||
pub use substrate_state_machine::{Externalities, TestExternalities};
|
pub use substrate_state_machine::{Externalities, TestExternalities};
|
||||||
|
|
||||||
|
use environmental::{environmental, thread_local_impl};
|
||||||
use primitives::hexdisplay::HexDisplay;
|
use primitives::hexdisplay::HexDisplay;
|
||||||
use primitives::H256;
|
use primitives::H256;
|
||||||
use hash_db::Hasher;
|
use hash_db::Hasher;
|
||||||
|
|
||||||
|
|
||||||
environmental!(ext: trait Externalities<Blake2Hasher>);
|
environmental!(ext: trait Externalities<Blake2Hasher>);
|
||||||
|
|
||||||
/// Get `key` from storage and return a `Vec`, empty if there's a problem.
|
/// 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)]
|
#[cfg(test)]
|
||||||
mod std_tests {
|
mod std_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use primitives::map;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn storage_works() {
|
fn storage_works() {
|
||||||
|
|||||||
@@ -14,21 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
extern crate substrate_primitives as primitives;
|
|
||||||
extern crate hash_db;
|
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub extern crate sr_std as rstd;
|
pub use parity_codec as codec;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub extern crate parity_codec as codec;
|
pub use rstd;
|
||||||
|
pub use rstd::{mem, slice};
|
||||||
|
|
||||||
use core::intrinsics;
|
use core::intrinsics;
|
||||||
use rstd::vec::Vec;
|
use rstd::vec::Vec;
|
||||||
use hash_db::Hasher;
|
use hash_db::Hasher;
|
||||||
use primitives::Blake2Hasher;
|
use primitives::Blake2Hasher;
|
||||||
pub use rstd::{mem, slice};
|
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ use parking_lot::Mutex;
|
|||||||
use slog::{Drain, o};
|
use slog::{Drain, o};
|
||||||
use log::trace;
|
use log::trace;
|
||||||
pub use slog_scope::with_logger;
|
pub use slog_scope::with_logger;
|
||||||
|
pub use slog;
|
||||||
|
|
||||||
/// Configuration for telemetry.
|
/// Configuration for telemetry.
|
||||||
pub struct TelemetryConfig {
|
pub struct TelemetryConfig {
|
||||||
@@ -70,7 +71,7 @@ pub fn init_telemetry(config: TelemetryConfig) -> slog_scope::GlobalLoggerGuard
|
|||||||
/// Exactly equivalent to `slog_scope::info`, provided as a convenience.
|
/// Exactly equivalent to `slog_scope::info`, provided as a convenience.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! telemetry {
|
macro_rules! telemetry {
|
||||||
( $($t:tt)* ) => { $crate::with_logger(|l| slog_info!(l, $($t)* )) }
|
( $($t:tt)* ) => { $crate::with_logger(|l| $crate::slog::slog_info!(l, $($t)* )) }
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Connection<'a> {
|
struct Connection<'a> {
|
||||||
|
|||||||
-1
@@ -1136,7 +1136,6 @@ dependencies = [
|
|||||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"sr-api-macros 0.1.0",
|
"sr-api-macros 0.1.0",
|
||||||
"sr-primitives 0.1.0",
|
"sr-primitives 0.1.0",
|
||||||
"sr-std 0.1.0",
|
"sr-std 0.1.0",
|
||||||
|
|||||||
BIN
Binary file not shown.
-1
@@ -1382,7 +1382,6 @@ dependencies = [
|
|||||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"sr-api-macros 0.1.0",
|
"sr-api-macros 0.1.0",
|
||||||
"sr-primitives 0.1.0",
|
"sr-primitives 0.1.0",
|
||||||
"sr-std 0.1.0",
|
"sr-std 0.1.0",
|
||||||
|
|||||||
Generated
-1
@@ -1507,7 +1507,6 @@ dependencies = [
|
|||||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"sr-api-macros 0.1.0",
|
"sr-api-macros 0.1.0",
|
||||||
"sr-primitives 0.1.0",
|
"sr-primitives 0.1.0",
|
||||||
"sr-std 0.1.0",
|
"sr-std 0.1.0",
|
||||||
|
|||||||
BIN
Binary file not shown.
Reference in New Issue
Block a user