ethcore-stratum crate moved to ethcore directory (#8338)
This commit is contained in:
parent
0d75d01c84
commit
8e7a08f865
@ -44,7 +44,7 @@ ethcore-miner = { path = "miner" }
|
|||||||
ethcore-network = { path = "util/network" }
|
ethcore-network = { path = "util/network" }
|
||||||
ethcore-private-tx = { path = "ethcore/private-tx" }
|
ethcore-private-tx = { path = "ethcore/private-tx" }
|
||||||
ethcore-service = { path = "ethcore/service" }
|
ethcore-service = { path = "ethcore/service" }
|
||||||
ethcore-stratum = { path = "stratum" }
|
ethcore-stratum = { path = "ethcore/stratum" }
|
||||||
ethcore-transaction = { path = "ethcore/transaction" }
|
ethcore-transaction = { path = "ethcore/transaction" }
|
||||||
ethereum-types = "0.3"
|
ethereum-types = "0.3"
|
||||||
node-filter = { path = "ethcore/node_filter" }
|
node-filter = { path = "ethcore/node_filter" }
|
||||||
|
@ -23,7 +23,7 @@ patricia-trie = { path = "../util/patricia_trie" }
|
|||||||
ethcore-io = { path = "../util/io" }
|
ethcore-io = { path = "../util/io" }
|
||||||
ethcore-logger = { path = "../logger" }
|
ethcore-logger = { path = "../logger" }
|
||||||
ethcore-miner = { path = "../miner" }
|
ethcore-miner = { path = "../miner" }
|
||||||
ethcore-stratum = { path = "../stratum" }
|
ethcore-stratum = { path = "./stratum" }
|
||||||
ethcore-transaction = { path = "./transaction" }
|
ethcore-transaction = { path = "./transaction" }
|
||||||
ethereum-types = "0.3"
|
ethereum-types = "0.3"
|
||||||
memory-cache = { path = "../util/memory_cache" }
|
memory-cache = { path = "../util/memory_cache" }
|
||||||
|
@ -6,9 +6,8 @@ license = "GPL-3.0"
|
|||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethcore-logger = { path = "../logger" }
|
|
||||||
ethereum-types = "0.3"
|
ethereum-types = "0.3"
|
||||||
keccak-hash = { path = "../util/hash" }
|
keccak-hash = { path = "../../util/hash" }
|
||||||
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
|
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
|
||||||
jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
|
jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
|
||||||
jsonrpc-tcp-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
|
jsonrpc-tcp-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
|
||||||
@ -19,4 +18,4 @@ parking_lot = "0.5"
|
|||||||
env_logger = "0.4"
|
env_logger = "0.4"
|
||||||
tokio-core = "0.1"
|
tokio-core = "0.1"
|
||||||
tokio-io = "0.1"
|
tokio-io = "0.1"
|
||||||
ethcore-logger = { path = "../logger" }
|
ethcore-logger = { path = "../../logger" }
|
@ -77,10 +77,10 @@ impl Stratum {
|
|||||||
) -> Result<Arc<Stratum>, Error> {
|
) -> Result<Arc<Stratum>, Error> {
|
||||||
|
|
||||||
let implementation = Arc::new(StratumImpl {
|
let implementation = Arc::new(StratumImpl {
|
||||||
subscribers: RwLock::new(Vec::new()),
|
subscribers: RwLock::default(),
|
||||||
job_que: RwLock::new(HashSet::new()),
|
job_que: RwLock::default(),
|
||||||
dispatcher,
|
dispatcher,
|
||||||
workers: Arc::new(RwLock::new(HashMap::new())),
|
workers: Arc::new(RwLock::default()),
|
||||||
secret,
|
secret,
|
||||||
notify_counter: RwLock::new(NOTIFY_COUNTER_INITIAL),
|
notify_counter: RwLock::new(NOTIFY_COUNTER_INITIAL),
|
||||||
});
|
});
|
||||||
@ -323,7 +323,6 @@ impl MetaExtractor<SocketMetadata> for PeerMetaExtractor {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::str::FromStr;
|
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
@ -366,7 +365,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_be_started() {
|
fn can_be_started() {
|
||||||
let stratum = Stratum::start(&SocketAddr::from_str("127.0.0.1:19980").unwrap(), Arc::new(VoidManager), None);
|
let stratum = Stratum::start(&"127.0.0.1:19980".parse().unwrap(), Arc::new(VoidManager), None);
|
||||||
assert!(stratum.is_ok());
|
assert!(stratum.is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,7 +373,7 @@ mod tests {
|
|||||||
fn records_subscriber() {
|
fn records_subscriber() {
|
||||||
init_log();
|
init_log();
|
||||||
|
|
||||||
let addr = SocketAddr::from_str("127.0.0.1:19985").unwrap();
|
let addr = "127.0.0.1:19985".parse().unwrap();
|
||||||
let stratum = Stratum::start(&addr, Arc::new(VoidManager), None).unwrap();
|
let stratum = Stratum::start(&addr, Arc::new(VoidManager), None).unwrap();
|
||||||
let request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 1}"#;
|
let request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 1}"#;
|
||||||
dummy_request(&addr, request);
|
dummy_request(&addr, request);
|
||||||
@ -419,7 +418,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn receives_initial_paylaod() {
|
fn receives_initial_paylaod() {
|
||||||
let addr = SocketAddr::from_str("127.0.0.1:19975").unwrap();
|
let addr = "127.0.0.1:19975".parse().unwrap();
|
||||||
let _stratum = Stratum::start(&addr, DummyManager::new(), None).expect("There should be no error starting stratum");
|
let _stratum = Stratum::start(&addr, DummyManager::new(), None).expect("There should be no error starting stratum");
|
||||||
let request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 2}"#;
|
let request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 2}"#;
|
||||||
|
|
||||||
@ -430,7 +429,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_authorize() {
|
fn can_authorize() {
|
||||||
let addr = SocketAddr::from_str("127.0.0.1:19970").unwrap();
|
let addr = "127.0.0.1:19970".parse().unwrap();
|
||||||
let stratum = Stratum::start(
|
let stratum = Stratum::start(
|
||||||
&addr,
|
&addr,
|
||||||
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),
|
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),
|
||||||
@ -448,7 +447,7 @@ mod tests {
|
|||||||
fn can_push_work() {
|
fn can_push_work() {
|
||||||
init_log();
|
init_log();
|
||||||
|
|
||||||
let addr = SocketAddr::from_str("127.0.0.1:19995").unwrap();
|
let addr = "127.0.0.1:19995".parse().unwrap();
|
||||||
let stratum = Stratum::start(
|
let stratum = Stratum::start(
|
||||||
&addr,
|
&addr,
|
||||||
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),
|
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),
|
Loading…
Reference in New Issue
Block a user