ethcore-stratum crate moved to ethcore directory (#8338)

This commit is contained in:
Marek Kotewicz 2018-04-10 10:13:42 +02:00 committed by GitHub
parent 0d75d01c84
commit 8e7a08f865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 14 deletions

View File

@ -44,7 +44,7 @@ ethcore-miner = { path = "miner" }
ethcore-network = { path = "util/network" }
ethcore-private-tx = { path = "ethcore/private-tx" }
ethcore-service = { path = "ethcore/service" }
ethcore-stratum = { path = "stratum" }
ethcore-stratum = { path = "ethcore/stratum" }
ethcore-transaction = { path = "ethcore/transaction" }
ethereum-types = "0.3"
node-filter = { path = "ethcore/node_filter" }

View File

@ -23,7 +23,7 @@ patricia-trie = { path = "../util/patricia_trie" }
ethcore-io = { path = "../util/io" }
ethcore-logger = { path = "../logger" }
ethcore-miner = { path = "../miner" }
ethcore-stratum = { path = "../stratum" }
ethcore-stratum = { path = "./stratum" }
ethcore-transaction = { path = "./transaction" }
ethereum-types = "0.3"
memory-cache = { path = "../util/memory_cache" }

View File

@ -6,9 +6,8 @@ license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
ethcore-logger = { path = "../logger" }
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-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" }
@ -19,4 +18,4 @@ parking_lot = "0.5"
env_logger = "0.4"
tokio-core = "0.1"
tokio-io = "0.1"
ethcore-logger = { path = "../logger" }
ethcore-logger = { path = "../../logger" }

View File

@ -77,10 +77,10 @@ impl Stratum {
) -> Result<Arc<Stratum>, Error> {
let implementation = Arc::new(StratumImpl {
subscribers: RwLock::new(Vec::new()),
job_que: RwLock::new(HashSet::new()),
subscribers: RwLock::default(),
job_que: RwLock::default(),
dispatcher,
workers: Arc::new(RwLock::new(HashMap::new())),
workers: Arc::new(RwLock::default()),
secret,
notify_counter: RwLock::new(NOTIFY_COUNTER_INITIAL),
});
@ -323,7 +323,6 @@ impl MetaExtractor<SocketMetadata> for PeerMetaExtractor {
#[cfg(test)]
mod tests {
use super::*;
use std::str::FromStr;
use std::net::SocketAddr;
use std::sync::Arc;
@ -366,7 +365,7 @@ mod tests {
#[test]
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());
}
@ -374,7 +373,7 @@ mod tests {
fn records_subscriber() {
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 request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 1}"#;
dummy_request(&addr, request);
@ -419,7 +418,7 @@ mod tests {
#[test]
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 request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 2}"#;
@ -430,7 +429,7 @@ mod tests {
#[test]
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(
&addr,
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),
@ -448,7 +447,7 @@ mod tests {
fn can_push_work() {
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(
&addr,
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),