remove ipc codegen from updater

This commit is contained in:
debris 2017-10-16 17:28:59 +02:00
parent c83e9d0f1b
commit f1c50e5648
16 changed files with 18 additions and 188 deletions

15
Cargo.lock generated
View File

@ -1298,17 +1298,6 @@ dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ipc-common-types"
version = "1.9.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-ipc 1.9.0",
"ethcore-ipc-codegen 1.9.0",
"ethcore-util 1.9.0",
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ipnetwork"
version = "0.12.7"
@ -2344,17 +2333,15 @@ dependencies = [
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bytes 0.1.0",
"ethcore-ipc 1.9.0",
"ethcore-ipc-codegen 1.9.0",
"ethcore-util 1.9.0",
"ethsync 1.9.0",
"futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-common-types 1.9.0",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-hash-fetch 1.9.0",
"parity-reactor 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0",
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

View File

@ -1,16 +0,0 @@
[package]
description = "Types that implement IPC and are common to multiple modules."
name = "ipc-common-types"
version = "1.9.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
ethcore-ipc-codegen = { path = "../ipc/codegen" }
[dependencies]
semver = "0.6"
ethcore-ipc = { path = "../ipc/rpc" }
ethcore-util = { path = "../util" }
ethcore-bigint = { path = "../util/bigint" }

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_binary("src/types/mod.rs.in").unwrap();
}

View File

@ -1,26 +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/>.
//! Updater for Parity executables
extern crate semver;
extern crate ethcore_util as util;
extern crate ethcore_bigint as bigint;
extern crate ethcore_ipc as ipc;
mod types;
pub use types::*;

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/>.
//! Types used in the public api
#![allow(dead_code, unused_assignments, unused_variables)] // codegen issues
include!(concat!(env!("OUT_DIR"), "/mod.rs.in"));

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/>.
pub mod release_track;
pub mod version_info;
pub use release_track::{ReleaseTrack};
pub use version_info::{VersionInfo};

View File

@ -4,15 +4,12 @@ name = "parity-updater"
version = "1.9.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
ethcore-ipc-codegen = { path = "../ipc/codegen" }
[dependencies]
log = "0.3"
ethabi = "4.0"
target_info = "0.1"
semver = "0.6"
ethcore = { path = "../ethcore" }
ethsync = { path = "../sync" }
ethcore-util = { path = "../util" }
@ -21,7 +18,5 @@ ethcore-bytes = { path = "../util/bytes" }
futures = "0.1"
parking_lot = "0.4"
parity-hash-fetch = { path = "../hash-fetch" }
ipc-common-types = { path = "../ipc-common-types" }
ethcore-ipc = { path = "../ipc/rpc" }
parity-reactor = { path = "../util/reactor" }
path = { path = "../util/path" }

View File

@ -1,22 +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_binary("src/types/mod.rs.in").unwrap();
ethcore_ipc_codegen::derive_ipc_cond("src/service.rs", cfg!(feature="ipc")).unwrap();
}

View File

@ -20,27 +20,23 @@
extern crate ethcore_util as util;
extern crate ethcore_bigint as bigint;
extern crate ethcore_bytes as bytes;
extern crate ipc_common_types;
extern crate parking_lot;
extern crate parity_hash_fetch as hash_fetch;
extern crate ethcore;
extern crate ethabi;
extern crate ethsync;
extern crate ethcore_ipc as ipc;
extern crate futures;
extern crate target_info;
extern crate parity_reactor;
extern crate path;
extern crate semver;
mod updater;
mod operations;
mod types;
mod service {
#![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues
include!(concat!(env!("OUT_DIR"), "/service.rs"));
}
mod service;
pub use service::{Service};
pub use types::all::{ReleaseInfo, OperationsInfo, CapState, VersionInfo, ReleaseTrack};
pub use types::{ReleaseInfo, OperationsInfo, CapState, VersionInfo, ReleaseTrack};
pub use updater::{Updater, UpdateFilter, UpdatePolicy};

View File

@ -14,10 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use types::all::{CapState, ReleaseInfo, OperationsInfo};
use ipc_common_types::VersionInfo;
use types::{CapState, ReleaseInfo, OperationsInfo, VersionInfo};
#[ipc(client_ident="RemoteUpdater")]
pub trait Service: Send + Sync {
/// Is the currently running client capable of supporting the current chain?
/// We default to true if there's no clear information.

View File

@ -17,11 +17,10 @@
//! Types used in the public API
use bigint::hash::H256;
pub use ipc_common_types::{VersionInfo, ReleaseTrack};
use types::VersionInfo;
/// Information regarding a particular release of Parity
#[derive(Debug, Clone, PartialEq)]
#[binary]
pub struct ReleaseInfo {
/// Information on the version.
pub version: VersionInfo,
@ -35,7 +34,6 @@ pub struct ReleaseInfo {
/// Information on our operations environment.
#[derive(Debug, Clone, PartialEq)]
#[binary]
pub struct OperationsInfo {
/// Our blockchain's latest fork.
pub fork: u64,
@ -51,7 +49,6 @@ pub struct OperationsInfo {
/// Information on the current version's consensus capabililty.
#[derive(Debug, Clone, Copy, PartialEq)]
#[binary]
pub enum CapState {
/// Unknown.
Unknown,

View File

@ -16,6 +16,11 @@
//! Types used in the public api
#![allow(dead_code, unused_assignments, unused_variables)] // codegen issues
include!(concat!(env!("OUT_DIR"), "/mod.rs.in"));
mod all;
mod release_track;
mod version_info;
pub use self::all::{ReleaseInfo, OperationsInfo, CapState};
pub use self::release_track::ReleaseTrack;
pub use self::version_info::VersionInfo;

View File

@ -1,17 +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/>.
pub mod all;

View File

@ -20,7 +20,6 @@ use std::fmt;
/// A release's track.
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[binary]
pub enum ReleaseTrack {
/// Stable track.
Stable,
@ -35,7 +34,7 @@ pub enum ReleaseTrack {
}
impl fmt::Display for ReleaseTrack {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", match *self {
ReleaseTrack::Stable => "stable",
ReleaseTrack::Beta => "beta",

View File

@ -17,15 +17,13 @@
//! Types used in the public API
use std::fmt;
use std::str::FromStr;
use semver::{Version};
use bigint::hash::H160;
use util::misc::raw_package_info;
use release_track::ReleaseTrack;
use types::ReleaseTrack;
/// Version information of a particular release.
#[derive(Debug, Clone, PartialEq)]
#[binary]
pub struct VersionInfo {
/// The track on which it was released.
pub track: ReleaseTrack,
@ -48,7 +46,7 @@ impl VersionInfo {
VersionInfo {
track: raw.0.into(),
version: { let mut v = Version::parse(raw.1).expect("Environment variables are known to be valid; qed"); v.build = vec![]; v.pre = vec![]; v },
hash: H160::from_str(raw.2).unwrap_or_else(|_| H160::zero()),
hash: raw.2.parse::<H160>().unwrap_or_else(|_| H160::zero()),
}
}

View File

@ -24,13 +24,12 @@ use ethsync::{SyncProvider};
use futures::future;
use hash_fetch::{self as fetch, HashFetch};
use hash_fetch::fetch::Client as FetchService;
use ipc_common_types::{VersionInfo, ReleaseTrack};
use operations::Operations;
use parity_reactor::Remote;
use path::restrict_permissions_owner;
use service::{Service};
use target_info::Target;
use types::all::{ReleaseInfo, OperationsInfo, CapState};
use types::{ReleaseInfo, OperationsInfo, CapState, VersionInfo, ReleaseTrack};
use bigint::hash::{H160, H256};
use util::Address;
use bytes::Bytes;