remove ipc codegen from stratum

This commit is contained in:
debris 2017-10-16 17:32:15 +02:00
parent f1c50e5648
commit 6f914d1851
5 changed files with 1 additions and 45 deletions

3
Cargo.lock generated
View File

@ -812,9 +812,6 @@ dependencies = [
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.1.3",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-ipc 1.9.0",
"ethcore-ipc-codegen 1.9.0",
"ethcore-ipc-nano 1.9.0",
"ethcore-logger 1.9.0", "ethcore-logger 1.9.0",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
"hash 0.1.0", "hash 0.1.0",

View File

@ -4,10 +4,6 @@ name = "ethcore-stratum"
version = "1.9.0" version = "1.9.0"
license = "GPL-3.0" license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
ethcore-ipc-codegen = { path = "../ipc/codegen" }
[dependencies] [dependencies]
log = "0.3" log = "0.3"
@ -18,8 +14,6 @@ ethcore-util = { path = "../util" }
ethcore-bigint = { path = "../util/bigint" } ethcore-bigint = { path = "../util/bigint" }
ethcore-devtools = { path = "../devtools" } ethcore-devtools = { path = "../devtools" }
env_logger = "0.4" env_logger = "0.4"
ethcore-ipc = { path = "../ipc/rpc" }
ethcore-ipc-nano = { path = "../ipc/nano" }
tokio-core = "0.1" tokio-core = "0.1"
tokio-io = "0.1" tokio-io = "0.1"
parking_lot = "0.4" parking_lot = "0.4"

View File

@ -1,21 +0,0 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
extern crate ethcore_ipc_codegen;
fn main() {
ethcore_ipc_codegen::derive_ipc("src/traits.rs").unwrap();
}

View File

@ -22,7 +22,6 @@ extern crate jsonrpc_macros;
#[macro_use] extern crate log; #[macro_use] extern crate log;
extern crate ethcore_util as util; extern crate ethcore_util as util;
extern crate ethcore_bigint as bigint; extern crate ethcore_bigint as bigint;
extern crate ethcore_ipc as ipc;
extern crate hash; extern crate hash;
extern crate parking_lot; extern crate parking_lot;
@ -31,15 +30,10 @@ extern crate parking_lot;
#[cfg(test)] extern crate ethcore_logger; #[cfg(test)] extern crate ethcore_logger;
#[cfg(test)] extern crate env_logger; #[cfg(test)] extern crate env_logger;
mod traits { mod traits;
//! Stratum ipc interfaces specification
#![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues
include!(concat!(env!("OUT_DIR"), "/traits.rs"));
}
pub use traits::{ pub use traits::{
JobDispatcher, PushWorkHandler, Error, ServiceConfiguration, JobDispatcher, PushWorkHandler, Error, ServiceConfiguration,
RemoteWorkHandler, RemoteJobDispatcher,
}; };
use jsonrpc_tcp_server::{ use jsonrpc_tcp_server::{

View File

@ -17,11 +17,9 @@
use std; use std;
use std::error::Error as StdError; use std::error::Error as StdError;
use bigint::hash::H256; use bigint::hash::H256;
use ipc::IpcConfig;
use jsonrpc_tcp_server::PushMessageError; use jsonrpc_tcp_server::PushMessageError;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
#[binary]
pub enum Error { pub enum Error {
NoWork, NoWork,
NoWorkers, NoWorkers,
@ -43,7 +41,6 @@ impl From<PushMessageError> for Error {
} }
/// Interface that can provide pow/blockchain-specific responses for the clients /// Interface that can provide pow/blockchain-specific responses for the clients
#[ipc(client_ident="RemoteJobDispatcher")]
pub trait JobDispatcher: Send + Sync { pub trait JobDispatcher: Send + Sync {
// json for initial client handshake // json for initial client handshake
fn initial(&self) -> Option<String> { None } fn initial(&self) -> Option<String> { None }
@ -56,7 +53,6 @@ pub trait JobDispatcher: Send + Sync {
} }
/// Interface that can handle requests to push job for workers /// Interface that can handle requests to push job for workers
#[ipc(client_ident="RemoteWorkHandler")]
pub trait PushWorkHandler: Send + Sync { pub trait PushWorkHandler: Send + Sync {
/// push the same work package for all workers (`payload`: json of pow-specific set of work specification) /// push the same work package for all workers (`payload`: json of pow-specific set of work specification)
fn push_work_all(&self, payload: String) -> Result<(), Error>; fn push_work_all(&self, payload: String) -> Result<(), Error>;
@ -65,13 +61,9 @@ pub trait PushWorkHandler: Send + Sync {
fn push_work(&self, payloads: Vec<String>) -> Result<(), Error>; fn push_work(&self, payloads: Vec<String>) -> Result<(), Error>;
} }
#[binary]
pub struct ServiceConfiguration { pub struct ServiceConfiguration {
pub io_path: String, pub io_path: String,
pub listen_addr: String, pub listen_addr: String,
pub port: u16, pub port: u16,
pub secret: Option<H256>, pub secret: Option<H256>,
} }
impl IpcConfig for PushWorkHandler { }
impl IpcConfig for JobDispatcher { }