derive -> ipc

This commit is contained in:
Nikolay Volf 2016-10-04 19:20:16 +03:00
parent 6e477951ba
commit 2b147616fd
15 changed files with 14 additions and 43 deletions

16
Cargo.lock generated
View File

@ -276,7 +276,6 @@ dependencies = [
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.4.0",
@ -290,7 +289,6 @@ dependencies = [
"ethjson 0.1.0",
"ethkey 0.2.0",
"ethstore 0.1.0",
"evmjit 1.4.0",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.4 (git+https://github.com/ethcore/hyper)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -324,7 +322,6 @@ version = "0.1.0"
name = "ethcore-dapps"
version = "1.4.0"
dependencies = [
"clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-devtools 1.4.0",
"ethcore-rpc 1.4.0",
@ -466,7 +463,6 @@ dependencies = [
name = "ethcore-rpc"
version = "1.4.0"
dependencies = [
"clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.4.0",
"ethcore 1.4.0",
"ethcore-devtools 1.4.0",
@ -496,7 +492,6 @@ dependencies = [
name = "ethcore-signer"
version = "1.4.0"
dependencies = [
"clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-devtools 1.4.0",
"ethcore-io 1.4.0",
@ -534,7 +529,6 @@ version = "1.4.0"
dependencies = [
"ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"elastic-array 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"eth-secp256k1 0.5.4 (git+https://github.com/ethcore/rust-secp256k1)",
@ -588,7 +582,6 @@ dependencies = [
name = "ethkey"
version = "0.2.0"
dependencies = [
"docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)",
"eth-secp256k1 0.5.4 (git+https://github.com/ethcore/rust-secp256k1)",
"ethcore-bigint 0.1.0",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -601,7 +594,6 @@ dependencies = [
name = "ethstore"
version = "0.1.0"
dependencies = [
"docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcrypto 0.1.0",
"ethkey 0.2.0",
"itertools 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
@ -621,7 +613,6 @@ dependencies = [
name = "ethsync"
version = "1.4.0"
dependencies = [
"clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.4.0",
"ethcore-io 1.4.0",
@ -639,13 +630,6 @@ dependencies = [
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "evmjit"
version = "1.4.0"
dependencies = [
"tiny-keccak 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fdlimit"
version = "0.1.0"

View File

@ -62,14 +62,7 @@ default = ["ui", "use-precompiled-js", "ipc"]
ui = ["dapps", "ethcore-signer/ui"]
use-precompiled-js = ["ethcore-dapps/use-precompiled-js", "ethcore-signer/use-precompiled-js"]
dapps = ["ethcore-dapps"]
ipc = ["ethcore/ipc"]
jit = ["ethcore/jit"]
dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev", "ethcore-dapps/dev", "ethcore-signer/dev"]
json-tests = ["ethcore/json-tests"]
stratum = ["ipc"]
ethkey-cli = ["ethcore/ethkey-cli"]
ethstore-cli = ["ethcore/ethstore-cli"]
evm-debug = ["ethcore/evm-debug"]
ipc = ["ethcore/ipc", "ethsync/ipc"]
evm-debug-tests = ["ethcore/evm-debug-tests"]
slow-blocks = ["ethcore/slow-blocks"]

View File

@ -157,7 +157,7 @@ impl Drop for Database {
}
}
#[derive(Ipc)]
#[ipc]
impl DatabaseService for Database {
fn open(&self, config: DatabaseConfig, path: String) -> Result<(), Error> {
let mut db = self.db.write();

View File

@ -18,7 +18,7 @@ use ipc::IpcConfig;
use util::H256;
/// Represents what has to be handled by actor listening to chain events
#[derive(Ipc)]
#[ipc]
pub trait ChainNotify : Send + Sync {
/// fires when chain has new blocks.
fn new_blocks(&self,

View File

@ -38,7 +38,6 @@ use ipc::IpcConfig;
use types::blockchain_info::BlockChainInfo;
use types::block_status::BlockStatus;
#[derive(Ipc)]
#[ipc(client_ident="RemoteClient")]
/// Blockchain database client. Owns and manages a blockchain and a block queue.
pub trait BlockChainClient : Sync + Send {

View File

@ -22,7 +22,6 @@ use ipc::IpcConfig;
/// This handles:
/// - restoration of snapshots to temporary databases.
/// - responding to queries for snapshot manifests and chunks
#[derive(Ipc)]
#[ipc(client_ident="RemoteSnapshotService")]
pub trait SnapshotService : Sync + Send {
/// Query the most recent manifest data.

View File

@ -49,7 +49,7 @@ pub fn expand_ipc_implementation(
let item = match *annotatable {
Annotatable::Item(ref item) => item,
_ => {
cx.span_err(meta_item.span, "`#[derive(Ipc)]` may only be applied to struct implementations");
cx.span_err(meta_item.span, "`#[ipc]` may only be applied to struct implementations");
return;
},
};
@ -832,7 +832,7 @@ fn implement_interface(
_ => {
cx.span_err(
item.span,
"`#[derive(Ipc)]` may only be applied to implementations and traits");
"`#[ipc]` may only be applied to implementations and traits");
return Err(Error);
},
};

View File

@ -83,7 +83,7 @@ pub fn register(reg: &mut syntex::Registry) {
reg.add_attr("feature(custom_derive)");
reg.add_attr("feature(custom_attribute)");
reg.add_decorator("derive_Ipc", codegen::expand_ipc_implementation);
reg.add_decorator("ipc", codegen::expand_ipc_implementation);
reg.add_decorator("derive_Binary", serialization::expand_serialization_implementation);
reg.add_post_expansion_pass(strip_attributes);
@ -92,7 +92,7 @@ pub fn register(reg: &mut syntex::Registry) {
#[cfg(not(feature = "with-syntex"))]
pub fn register(reg: &mut rustc_plugin::Registry) {
reg.register_syntax_extension(
syntax::parse::token::intern("derive_Ipc"),
syntax::parse::token::intern("ipc"),
syntax::ext::base::MultiDecorator(
Box::new(codegen::expand_ipc_implementation)));
reg.register_syntax_extension(

View File

@ -40,12 +40,12 @@ pub struct ModuleState {
}
#[derive(Ipc)]
#[ipc]
pub trait ControlService {
fn shutdown(&self) -> bool;
}
#[derive(Ipc)]
#[ipc]
impl HypervisorService {
// return type for making method synchronous
fn module_ready(&self, module_id: u64, control_url: String) -> bool {

View File

@ -33,7 +33,7 @@ impl IpcConfig for DBWriter {}
#[derive(Binary)]
pub enum DBError { Write, Read }
#[derive(Ipc)]
#[ipc]
impl<L: Sized> DBWriter for DB<L> {
fn write(&self, data: Vec<u8>) -> Result<(), DBError> {
let mut writes = self.writes.write().unwrap();
@ -48,7 +48,7 @@ impl<L: Sized> DBWriter for DB<L> {
}
}
#[derive(Ipc)]
#[ipc]
trait DBNotify {
fn notify(&self, a: u64, b: u64) -> bool;
}

View File

@ -28,7 +28,7 @@ pub struct CustomData {
pub b: u64,
}
#[derive(Ipc)]
#[ipc]
impl Service {
fn commit(&self, f: u32) -> u32 {
let mut lock = self.commits.write().unwrap();

View File

@ -18,7 +18,6 @@ use ipc::IpcConfig;
pub struct BadlyNamedService;
#[derive(Ipc)]
#[ipc(client_ident="PrettyNamedClient")]
impl BadlyNamedService {
fn is_zero(&self, x: u64) -> bool {

View File

@ -32,7 +32,6 @@ impl From<std::io::Error> for Error {
}
}
#[derive(Ipc)]
#[ipc(client_ident="RemoteJobDispatcher")]
/// Interface that can provide pow/blockchain-specific responses for the clients
pub trait JobDispatcher: Send + Sync {
@ -44,7 +43,6 @@ pub trait JobDispatcher: Send + Sync {
fn job(&self, _worker_id: String) -> Option<String> { None }
}
#[derive(Ipc)]
#[ipc(client_ident="RemoteWorkHandler")]
/// Interface that can handle requests to push job for workers
pub trait PushWorkHandler: Send + Sync {

View File

@ -29,5 +29,6 @@ ethcore-ipc-nano = { path = "../ipc/nano" }
parking_lot = "0.2.6"
[features]
default = []
default = ["ipc"]
dev = ["clippy", "ethcore/dev", "ethcore-util/dev"]
ipc = []

View File

@ -88,7 +88,6 @@ impl EthSync {
}
}
#[derive(Ipc)]
#[ipc(client_ident="SyncClient")]
impl SyncProvider for EthSync {
/// Get sync status
@ -184,7 +183,6 @@ pub trait ManageNetwork : Send + Sync {
}
#[derive(Ipc)]
#[ipc(client_ident="NetworkManagerClient")]
impl ManageNetwork for EthSync {
fn accept_unreserved_peers(&self) {