From 6f914d1851e3c9c8869f8ecc44bba26b7049fef2 Mon Sep 17 00:00:00 2001 From: debris Date: Mon, 16 Oct 2017 17:32:15 +0200 Subject: [PATCH] remove ipc codegen from stratum --- Cargo.lock | 3 --- stratum/Cargo.toml | 6 ------ stratum/build.rs | 21 --------------------- stratum/src/lib.rs | 8 +------- stratum/src/traits.rs | 8 -------- 5 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 stratum/build.rs diff --git a/Cargo.lock b/Cargo.lock index fd5c97925..c64bb06cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -812,9 +812,6 @@ dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.1.3", "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-util 1.9.0", "hash 0.1.0", diff --git a/stratum/Cargo.toml b/stratum/Cargo.toml index 8e60854e2..911e2ad0e 100644 --- a/stratum/Cargo.toml +++ b/stratum/Cargo.toml @@ -4,10 +4,6 @@ name = "ethcore-stratum" version = "1.9.0" license = "GPL-3.0" authors = ["Parity Technologies "] -build = "build.rs" - -[build-dependencies] -ethcore-ipc-codegen = { path = "../ipc/codegen" } [dependencies] log = "0.3" @@ -18,8 +14,6 @@ ethcore-util = { path = "../util" } ethcore-bigint = { path = "../util/bigint" } ethcore-devtools = { path = "../devtools" } env_logger = "0.4" -ethcore-ipc = { path = "../ipc/rpc" } -ethcore-ipc-nano = { path = "../ipc/nano" } tokio-core = "0.1" tokio-io = "0.1" parking_lot = "0.4" diff --git a/stratum/build.rs b/stratum/build.rs deleted file mode 100644 index bad927dc1..000000000 --- a/stratum/build.rs +++ /dev/null @@ -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 . - -extern crate ethcore_ipc_codegen; - -fn main() { - ethcore_ipc_codegen::derive_ipc("src/traits.rs").unwrap(); -} diff --git a/stratum/src/lib.rs b/stratum/src/lib.rs index 527c43f20..229f36acc 100644 --- a/stratum/src/lib.rs +++ b/stratum/src/lib.rs @@ -22,7 +22,6 @@ extern crate jsonrpc_macros; #[macro_use] extern crate log; extern crate ethcore_util as util; extern crate ethcore_bigint as bigint; -extern crate ethcore_ipc as ipc; extern crate hash; extern crate parking_lot; @@ -31,15 +30,10 @@ extern crate parking_lot; #[cfg(test)] extern crate ethcore_logger; #[cfg(test)] extern crate env_logger; -mod traits { - //! Stratum ipc interfaces specification - #![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues - include!(concat!(env!("OUT_DIR"), "/traits.rs")); -} +mod traits; pub use traits::{ JobDispatcher, PushWorkHandler, Error, ServiceConfiguration, - RemoteWorkHandler, RemoteJobDispatcher, }; use jsonrpc_tcp_server::{ diff --git a/stratum/src/traits.rs b/stratum/src/traits.rs index d37000076..8bb497091 100644 --- a/stratum/src/traits.rs +++ b/stratum/src/traits.rs @@ -17,11 +17,9 @@ use std; use std::error::Error as StdError; use bigint::hash::H256; -use ipc::IpcConfig; use jsonrpc_tcp_server::PushMessageError; #[derive(Debug, Clone)] -#[binary] pub enum Error { NoWork, NoWorkers, @@ -43,7 +41,6 @@ impl From for Error { } /// Interface that can provide pow/blockchain-specific responses for the clients -#[ipc(client_ident="RemoteJobDispatcher")] pub trait JobDispatcher: Send + Sync { // json for initial client handshake fn initial(&self) -> Option { None } @@ -56,7 +53,6 @@ pub trait JobDispatcher: Send + Sync { } /// Interface that can handle requests to push job for workers -#[ipc(client_ident="RemoteWorkHandler")] pub trait PushWorkHandler: Send + Sync { /// 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>; @@ -65,13 +61,9 @@ pub trait PushWorkHandler: Send + Sync { fn push_work(&self, payloads: Vec) -> Result<(), Error>; } -#[binary] pub struct ServiceConfiguration { pub io_path: String, pub listen_addr: String, pub port: u16, pub secret: Option, } - -impl IpcConfig for PushWorkHandler { } -impl IpcConfig for JobDispatcher { }