Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Serde 0.9 #4508

Merged
merged 12 commits into from
Feb 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 60 additions & 152 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ name = "parity"
version = "1.6.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"

[build-dependencies]
rustc_version = "0.1"
ethcore-ipc-codegen = { path = "ipc/codegen" }
ethcore-ipc-tests = { path = "ipc/tests" }

[dependencies]
log = "0.3"
Expand All @@ -26,8 +20,8 @@ lazy_static = "0.2"
regex = "0.1"
isatty = "0.1"
toml = "0.2"
serde = "0.8"
serde_json = "0.8"
serde = "0.9"
serde_json = "0.9"
app_dirs = "1.1.1"
fdlimit = "0.1"
hyper = { version = "0.9", default-features = false }
Expand Down Expand Up @@ -55,6 +49,9 @@ parity-reactor = { path = "util/reactor" }
ethcore-dapps = { path = "dapps", optional = true }
clippy = { version = "0.0.103", optional = true}

[dev-dependencies]
ethcore-ipc-tests = { path = "ipc/tests" }

[target.'cfg(windows)'.dependencies]
winapi = "0.2"

Expand Down
25 changes: 0 additions & 25 deletions build.rs

This file was deleted.

12 changes: 3 additions & 9 deletions dapps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ name = "ethcore-dapps"
version = "1.6.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"

[lib]

Expand All @@ -19,15 +18,15 @@ hyper = { default-features = false, git = "https://github.com/ethcore/hyper" }
unicase = "1.3"
url = "1.0"
rustc-serialize = "0.3"
serde = "0.8"
serde_json = "0.8"
serde = "0.9"
serde_json = "0.9"
serde_derive = "0.9"
linked-hash-map = "0.3"
parity-dapps-glue = "1.4"
base32 = "0.3"
mime = "0.2"
mime_guess = "1.6.1"
time = "0.1.35"
serde_macros = { version = "0.8", optional = true }
zip = { version = "0.1", default-features = false }
ethcore-devtools = { path = "../devtools" }
ethcore-rpc = { path = "../rpc" }
Expand All @@ -39,12 +38,7 @@ parity-reactor = { path = "../util/reactor" }

clippy = { version = "0.0.103", optional = true}

[build-dependencies]
serde_codegen = { version = "0.8", optional = true }

[features]
default = ["serde_codegen"]
nightly = ["serde_macros"]
dev = ["clippy", "ethcore-rpc/dev", "ethcore-util/dev"]

ui = ["parity-ui/no-precompiled-js"]
Expand Down
41 changes: 0 additions & 41 deletions dapps/build.rs

This file was deleted.

3 changes: 0 additions & 3 deletions dapps/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

//! REST API

#![cfg_attr(feature="nightly", feature(custom_derive, custom_attribute, plugin))]
#![cfg_attr(feature="nightly", plugin(serde_macros, clippy))]

mod api;
mod response;
mod types;
Expand Down
51 changes: 47 additions & 4 deletions dapps/src/api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,51 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

#[cfg(feature = "serde_macros")]
include!("types.rs.in");
use endpoint::EndpointInfo;

#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct App {
pub id: String,
pub name: String,
pub description: String,
pub version: String,
pub author: String,
#[serde(rename="iconUrl")]
pub icon_url: String,
}

impl App {
/// Creates `App` instance from `EndpointInfo` and `id`.
pub fn from_info(id: &str, info: &EndpointInfo) -> Self {
App {
id: id.to_owned(),
name: info.name.to_owned(),
description: info.description.to_owned(),
version: info.version.to_owned(),
author: info.author.to_owned(),
icon_url: info.icon_url.to_owned(),
}
}
}

impl Into<EndpointInfo> for App {
fn into(self) -> EndpointInfo {
EndpointInfo {
name: self.name,
description: self.description,
version: self.version,
author: self.author,
icon_url: self.icon_url,
}
}
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ApiError {
pub code: String,
pub title: String,
pub detail: String,
}

#[cfg(not(feature = "serde_macros"))]
include!(concat!(env!("OUT_DIR"), "/types.rs"));
64 changes: 0 additions & 64 deletions dapps/src/api/types.rs.in

This file was deleted.

4 changes: 3 additions & 1 deletion dapps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

//! Ethcore Webapplications for Parity
//!
#![warn(missing_docs)]
#![cfg_attr(feature="nightly", feature(plugin))]
#![cfg_attr(feature="nightly", plugin(clippy))]

extern crate base32;
Expand Down Expand Up @@ -45,6 +45,8 @@ extern crate parity_reactor;
extern crate log;
#[macro_use]
extern crate mime;
#[macro_use]
extern crate serde_derive;

#[cfg(test)]
extern crate ethcore_devtools as devtools;
Expand Down
5 changes: 2 additions & 3 deletions ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ build = "build.rs"
log = "0.3"
env_logger = "0.3"
rustc-serialize = "0.3"
heapsize = "0.3"
rust-crypto = "0.2.34"
num_cpus = "0.2"
crossbeam = "0.2.9"
Expand All @@ -27,6 +26,8 @@ rand = "0.3"
byteorder = "1.0"
transient-hashmap = "0.1"
linked-hash-map = "0.3.0"
lru-cache = "0.1.0"
ethabi = "1.0.0"
evmjit = { path = "../evmjit", optional = true }
clippy = { version = "0.0.103", optional = true}
ethash = { path = "../ethash" }
Expand All @@ -40,10 +41,8 @@ ethkey = { path = "../ethkey" }
ethcore-ipc-nano = { path = "../ipc/nano" }
rlp = { path = "../util/rlp" }
ethcore-stratum = { path = "../stratum" }
lru-cache = "0.1.0"
ethcore-bloom-journal = { path = "../util/bloom" }
hardware-wallet = { path = "../hw" }
ethabi = "0.2.2"

[dependencies.hyper]
git = "https://github.com/ethcore/hyper"
Expand Down
13 changes: 7 additions & 6 deletions ethcore/src/blockchain/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,7 @@ mod tests {
use transaction::{Transaction, Action};
use log_entry::{LogEntry, LocalizedLogEntry};
use ethkey::Secret;
use header::BlockNumber;

fn new_db(path: &str) -> Arc<Database> {
Arc::new(Database::open(&DatabaseConfig::with_columns(::db::NUM_COLUMNS), path).unwrap())
Expand Down Expand Up @@ -2020,14 +2021,14 @@ mod tests {

let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5);
let blocks_b2 = bc.blocks_with_bloom(&bloom_b2, 0, 5);
assert_eq!(blocks_b1, vec![]);
assert_eq!(blocks_b2, vec![]);
assert_eq!(blocks_b1, Vec::<BlockNumber>::new());
assert_eq!(blocks_b2, Vec::<BlockNumber>::new());

insert_block(&db, &bc, &b1, vec![]);
let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5);
let blocks_b2 = bc.blocks_with_bloom(&bloom_b2, 0, 5);
assert_eq!(blocks_b1, vec![1]);
assert_eq!(blocks_b2, vec![]);
assert_eq!(blocks_b2, Vec::<BlockNumber>::new());

insert_block(&db, &bc, &b2, vec![]);
let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5);
Expand All @@ -2042,15 +2043,15 @@ mod tests {
let blocks_ba = bc.blocks_with_bloom(&bloom_ba, 0, 5);
assert_eq!(blocks_b1, vec![1]);
assert_eq!(blocks_b2, vec![2]);
assert_eq!(blocks_ba, vec![]);
assert_eq!(blocks_ba, Vec::<BlockNumber>::new());

// fork has happend
insert_block(&db, &bc, &b2a, vec![]);
let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5);
let blocks_b2 = bc.blocks_with_bloom(&bloom_b2, 0, 5);
let blocks_ba = bc.blocks_with_bloom(&bloom_ba, 0, 5);
assert_eq!(blocks_b1, vec![]);
assert_eq!(blocks_b2, vec![]);
assert_eq!(blocks_b1, Vec::<BlockNumber>::new());
assert_eq!(blocks_b2, Vec::<BlockNumber>::new());
assert_eq!(blocks_ba, vec![1, 2]);

// fork back
Expand Down
2 changes: 0 additions & 2 deletions ethcore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ extern crate ethcore_util as util;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate heapsize;
#[macro_use]
extern crate ethcore_ipc as ipc;

#[cfg(feature = "jit" )]
Expand Down
Loading