Merge branch 'master' of github.com:paritytech/parity into upload-crates

This commit is contained in:
Robert Habermeier 2017-11-10 18:42:18 +01:00
commit 2288bcd1b4
26 changed files with 397 additions and 1186 deletions

118
Cargo.lock generated
View File

@ -1,17 +1,3 @@
[root]
name = "wasm"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-logger 1.9.0",
"ethcore-util 1.9.0",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-wasm 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
"vm 0.1.0",
"wasm-utils 0.1.0 (git+https://github.com/paritytech/wasm-utils)",
]
[[package]]
name = "adler32"
version = "1.0.2"
@ -181,7 +167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "bloomable"
version = "0.1.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"hash 0.1.0",
]
@ -294,7 +280,7 @@ name = "common-types"
version = "0.1.0"
dependencies = [
"bloomable 0.1.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-util 1.9.0",
"ethjson 0.1.0",
@ -493,7 +479,7 @@ dependencies = [
"common-types 0.1.0",
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bloom-journal 0.1.0",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
@ -553,7 +539,7 @@ dependencies = [
[[package]]
name = "ethcore-bigint"
version = "0.1.3"
version = "0.2.1"
dependencies = [
"bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -598,7 +584,7 @@ version = "1.9.0"
dependencies = [
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
"ethcore-io 1.9.0",
@ -651,7 +637,7 @@ dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
"ethcore-io 1.9.0",
@ -685,7 +671,7 @@ version = "1.0.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
"ethcore-logger 1.9.0",
@ -719,7 +705,7 @@ name = "ethcore-stratum"
version = "1.9.0"
dependencies = [
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-devtools 1.9.0",
"ethcore-logger 1.9.0",
"ethcore-util 1.9.0",
@ -741,7 +727,7 @@ dependencies = [
"elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-logger 1.9.0",
"hash 0.1.0",
@ -771,7 +757,7 @@ name = "ethcrypto"
version = "0.1.0"
dependencies = [
"eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethkey 0.2.0",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
"subtle 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -783,7 +769,7 @@ name = "ethjson"
version = "0.1.0"
dependencies = [
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
@ -796,7 +782,7 @@ version = "0.2.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
@ -820,7 +806,7 @@ dependencies = [
name = "ethstore"
version = "0.1.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcrypto 0.1.0",
"ethkey 0.2.0",
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -859,7 +845,7 @@ dependencies = [
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
"ethcore-io 1.9.0",
@ -888,7 +874,7 @@ name = "evm"
version = "0.1.0"
dependencies = [
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-util 1.9.0",
"evmjit 1.9.0",
"hash 0.1.0",
@ -907,7 +893,7 @@ version = "0.1.0"
dependencies = [
"docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-util 1.9.0",
"ethjson 0.1.0",
@ -1028,7 +1014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "hardware-wallet"
version = "1.9.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethkey 0.2.0",
"hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)",
"libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)",
@ -1044,7 +1030,7 @@ name = "hash"
version = "0.1.0"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1054,7 +1040,7 @@ name = "hashdb"
version = "0.1.0"
dependencies = [
"elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
]
[[package]]
@ -1233,7 +1219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "journaldb"
version = "0.1.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-logger 1.9.0",
"hash 0.1.0",
@ -1375,7 +1361,7 @@ name = "kvdb-rocksdb"
version = "0.1.0"
dependencies = [
"elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"kvdb 0.1.0",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1525,7 +1511,7 @@ version = "0.1.0"
dependencies = [
"bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"hash 0.1.0",
"hashdb 0.1.0",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1671,7 +1657,7 @@ version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"native-contract-generator 0.1.0",
]
@ -1705,7 +1691,7 @@ name = "node-filter"
version = "1.9.0"
dependencies = [
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-io 1.9.0",
"ethcore-network 1.9.0",
@ -1919,7 +1905,7 @@ dependencies = [
"docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
"ethcore-io 1.9.0",
@ -1983,7 +1969,7 @@ dependencies = [
"base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.103 (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.2.1",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
"ethcore-util 1.9.0",
@ -1998,7 +1984,7 @@ dependencies = [
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"mime_guess 2.0.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)",
"node-health 0.1.0",
"parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-hash-fetch 1.9.0",
"parity-reactor 0.1.0",
"parity-ui 1.9.0",
@ -2014,7 +2000,7 @@ dependencies = [
[[package]]
name = "parity-dapps-glue"
version = "1.9.0"
version = "1.9.1"
dependencies = [
"aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2029,7 +2015,7 @@ dependencies = [
[[package]]
name = "parity-dapps-glue"
version = "1.9.0"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2046,7 +2032,7 @@ name = "parity-hash-fetch"
version = "1.9.0"
dependencies = [
"ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-util 1.9.0",
"fetch 0.1.0",
@ -2068,7 +2054,7 @@ version = "1.9.0"
dependencies = [
"cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-util 1.9.0",
"jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.8)",
@ -2099,7 +2085,7 @@ dependencies = [
name = "parity-machine"
version = "0.1.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-util 1.9.0",
]
@ -2120,7 +2106,7 @@ dependencies = [
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.9.0",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0",
"ethcore-io 1.9.0",
@ -2219,14 +2205,14 @@ dependencies = [
name = "parity-ui-dev"
version = "1.9.0"
dependencies = [
"parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parity-ui-old-dev"
version = "1.9.0"
dependencies = [
"parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2234,7 +2220,7 @@ name = "parity-ui-old-precompiled"
version = "1.8.0"
source = "git+https://github.com/paritytech/js-precompiled.git?branch=v1#94b0a89aac7eb5ddfdb53cd9bb039da6fdbf7583"
dependencies = [
"parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2242,7 +2228,7 @@ name = "parity-ui-precompiled"
version = "1.9.0"
source = "git+https://github.com/paritytech/js-precompiled.git#1626d64235241e75c531eece004a4923d9d4fcc6"
dependencies = [
"parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2251,7 +2237,7 @@ version = "1.9.0"
dependencies = [
"ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-util 1.9.0",
"ethsync 1.9.0",
@ -2281,7 +2267,7 @@ version = "0.1.0"
dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-network 1.9.0",
"ethcrypto 0.1.0",
"ethkey 0.2.0",
@ -2344,7 +2330,7 @@ name = "patricia-trie"
version = "0.1.0"
dependencies = [
"elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-logger 1.9.0",
"hash 0.1.0",
@ -2634,7 +2620,7 @@ version = "0.2.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -3259,7 +3245,7 @@ dependencies = [
name = "triehash"
version = "0.1.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"hash 0.1.0",
"rlp 0.2.0",
]
@ -3362,7 +3348,7 @@ name = "util-error"
version = "0.1.0"
dependencies = [
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"kvdb 0.1.0",
"rlp 0.2.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3407,7 +3393,7 @@ version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"common-types 0.1.0",
"ethcore-bigint 0.1.3",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-util 1.9.0",
"ethjson 0.1.0",
@ -3422,6 +3408,20 @@ name = "void"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "wasm"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-bigint 0.2.1",
"ethcore-logger 1.9.0",
"ethcore-util 1.9.0",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-wasm 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
"vm 0.1.0",
"wasm-utils 0.1.0 (git+https://github.com/paritytech/wasm-utils)",
]
[[package]]
name = "wasm-utils"
version = "0.1.0"
@ -3643,7 +3643,7 @@ dependencies = [
"checksum order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efa535d5117d3661134dbf1719b6f0ffe06f2375843b13935db186cd094105eb"
"checksum ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58d25b6c0e47b20d05226d288ff434940296e7e2f8b877975da32f862152241f"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9df5504a83dbbbd25ddb0645372bd09dff5a7716e18690a21211873b81606fe9"
"checksum parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "261c025c67ba416e9fe63aa9b3236520ce3c74cfbe43590c9cdcec4ccc8180e4"
"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "<none>"
"checksum parity-ui-old-precompiled 1.8.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)" = "<none>"
"checksum parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)" = "<none>"

View File

@ -1,7 +1,7 @@
[package]
description = "Base Package for all Parity built-in dapps"
name = "parity-dapps-glue"
version = "1.9.0"
version = "1.9.1"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"

View File

@ -25,7 +25,7 @@ mod platform {
use std::process::Command;
pub static NPM_CMD: &'static str = "npm";
pub fn handle_fd(cmd: &mut Command) -> &mut Command {
pub fn handle_cmd(cmd: &mut Command) -> &mut Command {
cmd
}
}
@ -34,14 +34,14 @@ mod platform {
mod platform {
use std::process::{Command, Stdio};
pub static NPM_CMD: &'static str = "npm.cmd";
pub static NPM_CMD: &'static str = "cmd.exe";
// NOTE [ToDr] For some reason on windows
// We cannot have any file descriptors open when running a child process
// during build phase.
pub fn handle_fd(cmd: &mut Command) -> &mut Command {
// The command doesn't have %~dp0 set properly
// and it cannot load globally installed node.exe
pub fn handle_cmd(cmd: &mut Command) -> &mut Command {
cmd.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.arg("/c")
.arg("npm.cmd")
}
}
@ -58,7 +58,7 @@ pub fn build(_path: &str, _dest: &str) {
#[cfg(not(feature = "use-precompiled-js"))]
pub fn build(path: &str, dest: &str) {
let child = platform::handle_fd(&mut Command::new(platform::NPM_CMD))
let child = platform::handle_cmd(&mut Command::new(platform::NPM_CMD))
.arg("install")
.arg("--no-progress")
.current_dir(path)
@ -66,7 +66,7 @@ pub fn build(path: &str, dest: &str) {
.unwrap_or_else(|e| die("Installing node.js dependencies with npm", e));
assert!(child.success(), "There was an error installing dependencies.");
let child = platform::handle_fd(&mut Command::new(platform::NPM_CMD))
let child = platform::handle_cmd(&mut Command::new(platform::NPM_CMD))
.arg("run")
.arg("build")
.env("NODE_ENV", "production")

View File

@ -1,3 +1,18 @@
### Parity [v1.7.8](https://github.com/paritytech/parity/releases/tag/v1.7.8) (2017-10-27)
- [stable] Refactor static context check in CREATE ([#6889](https://github.com/paritytech/parity/pull/6889))
- Fix #6228: do not display eth price in cli for etc ([#6877](https://github.com/paritytech/parity/pull/6877))
- Fix mining help ([#6885](https://github.com/paritytech/parity/pull/6885))
- [stable] v1.7.8 ([#6890](https://github.com/paritytech/parity/pull/6890))
- Refactor static context check in CREATE. ([#6886](https://github.com/paritytech/parity/pull/6886))
- Cleanup some configuration options ([#6878](https://github.com/paritytech/parity/pull/6878))
- Fix serialization of non-localized transactions ([#6868](https://github.com/paritytech/parity/pull/6868))
- Updated NTP to version 0.3 ([#6854](https://github.com/paritytech/parity/pull/6854))
- Align README with 1.8 and prepare CHANGELOG with 1.8.1 ([#6833](https://github.com/paritytech/parity/pull/6833))
- Return error on timed unlock ([#6777](https://github.com/paritytech/parity/pull/6777))
- Fix dapps tests in master ([#6866](https://github.com/paritytech/parity/pull/6866))
- [Beta] Add ECIP1017 to Morden config (#6810) ([#6845](https://github.com/paritytech/parity/pull/6845))
## Parity [v1.7.7](https://github.com/paritytech/parity/releases/tag/v1.7.7) (2017-10-15)
Parity 1.7.7 Fixes an issue with auto-update system. Updating is recommended, but not required for Byzantium.

View File

@ -321,6 +321,11 @@ impl TransactionQueue {
self.by_hash.remove(&hash);
}
}
/// Get a transaction by hash.
pub fn get(&self, hash: &H256) -> Option<&PendingTransaction> {
self.by_hash.get(&hash)
}
}
#[cfg(test)]

@ -1 +1 @@
Subproject commit c8129ce2f36c26ed634eda786960978a28e28d0e
Subproject commit 94b7877b5826a53627b8732ea0feb45869dd04ab

View File

@ -178,6 +178,13 @@ impl AccountProvider {
}
}
if let Ok(accounts) = sstore.accounts() {
for account in accounts.into_iter().filter(|a| settings.blacklisted_accounts.contains(&a.address)) {
warn!("Local Account {} has a blacklisted (known to be weak) address and will be ignored",
account.address);
}
}
// Remove blacklisted accounts from address book.
let mut address_book = AddressBook::new(&sstore.local_path());
for addr in &settings.blacklisted_accounts {

View File

@ -147,6 +147,11 @@ pub const SIGNATURES: &'static [UserFunctionDescriptor] = &[
&[I32],
None,
),
Static(
"_elog",
&[I32; 4],
None,
),
// TODO: Get rid of it also somehow?
Static(

View File

@ -55,6 +55,8 @@ pub enum UserTrap {
Unknown,
/// Passed string had invalid utf-8 encoding
BadUtf8,
/// Log event error
Log,
/// Other error in native code
Other,
/// Panic with message
@ -75,6 +77,7 @@ impl ::std::fmt::Display for UserTrap {
UserTrap::AllocationFailed => write!(f, "Memory allocation failed (OOM)"),
UserTrap::BadUtf8 => write!(f, "String encoding is bad utf-8 sequence"),
UserTrap::GasLimit => write!(f, "Invocation resulted in gas limit violated"),
UserTrap::Log => write!(f, "Error occured while logging an event"),
UserTrap::Other => write!(f, "Other unspecified error"),
UserTrap::Panic(ref msg) => write!(f, "Panic: {}", msg),
}
@ -232,6 +235,21 @@ impl<'a, 'b> Runtime<'a, 'b> {
}
}
pub fn overflow_charge<F>(&mut self, f: F) -> Result<(), InterpreterError>
where F: FnOnce(&vm::Schedule) -> Option<u64>
{
let amount = match f(self.ext.schedule()) {
Some(amount) => amount,
None => { return Err(UserTrap::GasLimit.into()); }
};
if !self.charge_gas(amount as u64) {
Err(UserTrap::GasLimit.into())
} else {
Ok(())
}
}
/// Invoke create in the state runtime
pub fn create(&mut self, context: InterpreterCallerContext)
-> Result<Option<interpreter::RuntimeValue>, InterpreterError>
@ -749,6 +767,44 @@ impl<'a, 'b> Runtime<'a, 'b> {
pub fn ext(&mut self) -> &mut vm::Ext {
self.ext
}
pub fn log(&mut self, context: InterpreterCallerContext)
-> Result<Option<interpreter::RuntimeValue>, InterpreterError>
{
// signature is:
// pub fn elog(topic_ptr: *const u8, topic_count: u32, data_ptr: *const u8, data_len: u32);
let data_len = context.value_stack.pop_as::<i32>()? as u32;
let data_ptr = context.value_stack.pop_as::<i32>()? as u32;
let topic_count = context.value_stack.pop_as::<i32>()? as u32;
let topic_ptr = context.value_stack.pop_as::<i32>()? as u32;
if topic_count > 4 {
return Err(UserTrap::Log.into());
}
self.overflow_charge(|schedule|
{
let topics_gas = schedule.log_gas as u64 + schedule.log_topic_gas as u64 * topic_count as u64;
(schedule.log_data_gas as u64)
.checked_mul(schedule.log_data_gas as u64)
.and_then(|data_gas| data_gas.checked_add(topics_gas))
}
)?;
let mut topics: Vec<H256> = Vec::with_capacity(topic_count as usize);
topics.resize(topic_count as usize, H256::zero());
for i in 0..topic_count {
let offset = i.checked_mul(32).ok_or(UserTrap::MemoryAccessViolation)?
.checked_add(topic_ptr).ok_or(UserTrap::MemoryAccessViolation)?;
*topics.get_mut(i as usize)
.expect("topics is resized to `topic_count`, i is in 0..topic count iterator, get_mut uses i as an indexer, get_mut cannot fail; qed")
= H256::from(&self.memory.get(offset, 32)?[..]);
}
self.ext.log(topics, &self.memory.get(data_ptr, data_len as usize)?).map_err(|_| UserTrap::Log)?;
Ok(None)
}
}
impl<'a, 'b> interpreter::UserFunctionExecutor<UserTrap> for Runtime<'a, 'b> {
@ -833,6 +889,9 @@ impl<'a, 'b> interpreter::UserFunctionExecutor<UserTrap> for Runtime<'a, 'b> {
"_value" => {
self.value(context)
},
"_elog" => {
self.log(context)
},
_ => {
trace!(target: "wasm", "Trapped due to unhandled function: '{}'", name);
Ok(self.unknown_trap(context)?)

View File

@ -680,7 +680,6 @@ fn externs() {
#[test]
fn embedded_keccak() {
::ethcore_logger::init_log();
let mut code = load_sample!("keccak.wasm");
code.extend_from_slice(b"something");
@ -703,4 +702,39 @@ fn embedded_keccak() {
assert_eq!(H256::from_slice(&result), H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87"));
assert_eq!(gas_left, U256::from(80_452));
}
/// This test checks the correctness of log extern
/// Target test puts one event with two topic [keccak(input), reverse(keccak(input))]
/// and reversed input as a data
#[test]
fn events() {
::ethcore_logger::init_log();
let code = load_sample!("events.wasm");
let mut params = ActionParams::default();
params.gas = U256::from(100_000);
params.code = Some(Arc::new(code));
params.data = Some(b"something".to_vec());
let mut ext = FakeExt::new();
let (gas_left, result) = {
let mut interpreter = wasm_interpreter();
let result = interpreter.exec(params, &mut ext).expect("Interpreter to execute without any errors");
match result {
GasLeft::Known(_) => { panic!("events should return payload"); },
GasLeft::NeedsReturn { gas_left: gas, data: result, apply_state: _apply } => (gas, result.to_vec()),
}
};
assert_eq!(ext.logs.len(), 1);
let log_entry = &ext.logs[0];
assert_eq!(log_entry.topics.len(), 2);
assert_eq!(&log_entry.topics[0], &H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87"));
assert_eq!(&log_entry.topics[1], &H256::from("871d5ea37430753faab7dff7a7187783517d83bd822c02e28a164c887e1d3768"));
assert_eq!(&log_entry.data, b"gnihtemos");
assert_eq!(&result, b"gnihtemos");
assert_eq!(gas_left, U256::from(78039));
}

1092
js/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,17 +21,13 @@
"Parity"
],
"scripts": {
"build": "npm run build:lib && npm run build:app",
"build": "npm run build:lib && npm run build:app && npm run build:embed",
"build:app": "webpack --progress --config webpack/app",
"build:lib": "webpack --progress --config webpack/libraries",
"build:embed": "EMBED=1 node webpack/embed",
"build:embed": "cross-env EMBED=1 node webpack/embed",
"build:i18n": "npm run clean && npm run build && babel-node ./scripts/build-i18n.js",
"ci:build": "npm run ci:build:lib && npm run ci:build:app && npm run ci:build:embed",
"ci:build:app": "NODE_ENV=production webpack --progress --config webpack/app",
"ci:build:lib": "NODE_ENV=production webpack --progress --config webpack/libraries",
"ci:build:npm": "NODE_ENV=production webpack --progress --config webpack/npm",
"ci:build:embed": "NODE_ENV=production EMBED=1 node webpack/embed",
"clean": "rm -rf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache",
"ci:build": "cross-env NODE_ENV=production npm run build",
"clean": "rimraf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache",
"coveralls": "npm run testCoverage && coveralls < coverage/lcov.info",
"lint": "npm run lint:css && npm run lint:js",
"lint:cached": "npm run lint:css && npm run lint:js:cached",
@ -44,10 +40,10 @@
"start": "npm run clean && npm install && npm run build:lib && npm run start:app",
"start:app": "node webpack/dev.server",
"start:electron": "npm run build:app && electron .build/",
"test": "NODE_ENV=test mocha --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:coverage": "NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:e2e": "NODE_ENV=test mocha 'src/**/*.e2e.js'",
"test:npm": "(cd .npmjs && npm i) && node test/npmParity && node test/npmJsonRpc && (rm -rf .npmjs/node_modules)",
"test": "cross-env NODE_ENV=test mocha --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:coverage": "cross-env NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:e2e": "cross-env NODE_ENV=test mocha 'src/**/*.e2e.js'",
"test:npm": "(cd .npmjs && npm i) && node test/npmParity && node test/npmJsonRpc && (rimraf .npmjs/node_modules)",
"prepush": "npm run lint:cached"
},
"devDependencies": {
@ -75,6 +71,7 @@
"copy-webpack-plugin": "4.0.1",
"core-js": "2.4.1",
"coveralls": "2.11.16",
"cross-env": "5.1.1",
"css-loader": "0.28.4",
"ejs-loader": "0.3.0",
"ejsify": "1.0.0",
@ -118,6 +115,7 @@
"react-addons-test-utils": "15.4.2",
"react-hot-loader": "3.0.0-beta.6",
"react-intl-aggregate-webpack-plugin": "0.0.1",
"rimraf": "2.6.2",
"sinon": "1.17.7",
"sinon-as-promised": "4.0.2",
"sinon-chai": "2.8.0",

View File

@ -31,6 +31,7 @@ import { patchApi } from '@parity/shared/util/tx';
import SecureApi from './secureApi';
import './ShellExtend';
import '@parity/shared/environment';
import '@parity/shared/assets/fonts/Roboto/font.css';
import '@parity/shared/assets/fonts/RobotoMono/font.css';
@ -70,8 +71,6 @@ class FrameSecureApi extends SecureApi {
connect () {
// Do nothing - this API does not need connecting
this.emit('connecting');
// Fetch settings
this._fetchSettings();
// Fire connected event with some delay.
setTimeout(() => {
this.emit('connected');
@ -99,7 +98,7 @@ transport.uiUrl = uiUrl.replace('http://', '').replace('https://', '');
const api = new FrameSecureApi(transport);
patchApi(api);
ContractInstances.create(api);
ContractInstances.get(api);
const store = initStore(api, null, true);
@ -125,3 +124,9 @@ ReactDOM.render(
</AppContainer>,
container
);
// testing, signer plugins
import '@parity/plugin-signer-account';
import '@parity/plugin-signer-default';
import '@parity/plugin-signer-hardware';
import '@parity/plugin-signer-qr';

View File

@ -46,7 +46,7 @@ const isProd = ENV === 'production';
const isEmbed = EMBED === '1' || EMBED === 'true';
const entry = isEmbed
? { embed: './embed.js' }
? { embed: ['babel-polyfill', './embed.js'] }
: { bundle: ['babel-polyfill', './index.parity.js'] };
module.exports = {
@ -238,7 +238,7 @@ module.exports = {
new HtmlWebpackPlugin({
title: 'Parity Bar',
filename: 'embed.html',
template: './index.ejs',
template: './index.parity.ejs',
favicon: FAVICON,
chunks: ['embed']
})

View File

@ -24,6 +24,7 @@ usage! {
// Subcommands must start with cmd_ and have '_' in place of '-'
// Sub-subcommands must start with the name of the subcommand
// Arguments must start with arg_
// Flags must start with flag_
CMD cmd_ui {
"Manage ui",
@ -53,10 +54,6 @@ usage! {
CMD cmd_account_new {
"Create a new acount",
ARG arg_account_new_password: (Option<String>) = None,
"--password=[FILE]",
"Path to the password file",
}
CMD cmd_account_list {
@ -81,10 +78,6 @@ usage! {
{
"Import wallet",
ARG arg_wallet_import_password: (Option<String>) = None,
"--password=[FILE]",
"Path to the password file",
ARG arg_wallet_import_path: (Option<String>) = None,
"<PATH>",
"Path to the wallet",
@ -179,10 +172,6 @@ usage! {
{
"Sign",
ARG arg_signer_sign_password: (Option<String>) = None,
"--password=[FILE]",
"Path to the password file",
ARG arg_signer_sign_id: (Option<usize>) = None,
"[ID]",
"ID",
@ -244,7 +233,7 @@ usage! {
}
}
{
// Flags and arguments
// Global flags and arguments
["Operating Options"]
FLAG flag_public_node: (bool) = false, or |c: &Config| otry!(c.parity).public_node.clone(),
"--public-node",
@ -353,7 +342,6 @@ usage! {
ARG arg_password: (Vec<String>) = Vec::new(), or |c: &Config| otry!(c.account).password.clone(),
"--password=[FILE]...",
"Provide a file containing a password for unlocking an account. Leading and trailing whitespace is trimmed.",
["UI options"]
FLAG flag_force_ui: (bool) = false, or |c: &Config| otry!(c.ui).force.clone(),
"--force-ui",
@ -840,6 +828,10 @@ usage! {
"Target size of the whisper message pool in megabytes.",
["Legacy options"]
FLAG flag_warp: (bool) = false, or |_| None,
"--warp",
"Does nothing; warp sync is enabled by default.",
FLAG flag_dapps_apis_all: (bool) = false, or |_| None,
"--dapps-apis-all",
"Dapps server is merged with RPC server. Use --jsonrpc-apis.",
@ -1208,6 +1200,29 @@ mod tests {
use toml;
use clap::{ErrorKind as ClapErrorKind};
#[test]
fn should_accept_any_argument_order() {
let args = Args::parse(&["parity", "--no-warp", "account", "list"]).unwrap();
assert_eq!(args.flag_no_warp, true);
let args = Args::parse(&["parity", "account", "list", "--no-warp"]).unwrap();
assert_eq!(args.flag_no_warp, true);
let args = Args::parse(&["parity", "--chain=dev", "account", "list"]).unwrap();
assert_eq!(args.arg_chain, "dev");
let args = Args::parse(&["parity", "account", "list", "--chain=dev"]).unwrap();
assert_eq!(args.arg_chain, "dev");
}
#[test]
fn should_not_crash_on_warp() {
let args = Args::parse(&["parity", "--warp"]);
assert!(args.is_ok());
let args = Args::parse(&["parity", "account", "list", "--warp"]);
assert!(args.is_ok());
}
#[test]
fn should_reject_invalid_values() {
@ -1380,9 +1395,6 @@ mod tests {
arg_restore_file: None,
arg_tools_hash_file: None,
arg_account_new_password: None,
arg_signer_sign_password: None,
arg_wallet_import_password: None,
arg_signer_sign_id: None,
arg_signer_reject_id: None,
arg_dapp_path: None,
@ -1565,6 +1577,7 @@ mod tests {
arg_whisper_pool_size: 20,
// -- Legacy Options
flag_warp: false,
flag_geth: false,
flag_testnet: false,
flag_import_geth_keys: false,

View File

@ -153,7 +153,7 @@ macro_rules! usage {
use std::{fs, io, process};
use std::io::{Read, Write};
use util::version;
use clap::{Arg, App, SubCommand, AppSettings, Error as ClapError, ErrorKind as ClapErrorKind};
use clap::{Arg, App, SubCommand, AppSettings, ArgMatches as ClapArgMatches, Error as ClapError, ErrorKind as ClapErrorKind};
use helpers::replace_home;
use std::ffi::OsStr;
use std::collections::HashMap;
@ -503,6 +503,36 @@ macro_rules! usage {
args
}
pub fn hydrate_with_globals(self: &mut Self, matches: &ClapArgMatches) -> Result<(), ClapError> {
$(
$(
self.$flag = self.$flag || matches.is_present(stringify!($flag));
)*
$(
if let some @ Some(_) = return_if_parse_error!(if_option!(
$($arg_type_tt)+,
THEN {
if_option_vec!(
$($arg_type_tt)+,
THEN { values_t!(matches, stringify!($arg), inner_option_vec_type!($($arg_type_tt)+)) }
ELSE { value_t!(matches, stringify!($arg), inner_option_type!($($arg_type_tt)+)) }
)
}
ELSE {
if_vec!(
$($arg_type_tt)+,
THEN { values_t!(matches, stringify!($arg), inner_vec_type!($($arg_type_tt)+)) }
ELSE { value_t!(matches, stringify!($arg), $($arg_type_tt)+) }
)
}
)) {
self.$arg = some;
}
)*
)*
Ok(())
}
#[allow(unused_variables)] // the submatches of arg-less subcommands aren't used
pub fn parse<S: AsRef<str>>(command: &[S]) -> Result<Self, ClapError> {
@ -559,12 +589,14 @@ macro_rules! usage {
SubCommand::with_name(&underscore_to_hyphen!(&stringify!($subc)[4..]))
.about($subc_help)
.args(&subc_usages.get(stringify!($subc)).unwrap().iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::<Vec<Arg>>())
.args(&usages.iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::<Vec<Arg>>()) // accept global arguments at this position
$(
.setting(AppSettings::SubcommandRequired) // prevent from running `parity account`
.subcommand(
SubCommand::with_name(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..]))
.about($subc_subc_help)
.args(&subc_usages.get(stringify!($subc_subc)).unwrap().iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::<Vec<Arg>>())
.args(&usages.iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::<Vec<Arg>>()) // accept global arguments at this position
)
)*
)
@ -572,36 +604,16 @@ macro_rules! usage {
.get_matches_from_safe(command.iter().map(|x| OsStr::new(x.as_ref())))?;
let mut raw_args : RawArgs = Default::default();
$(
$(
raw_args.$flag = matches.is_present(stringify!($flag));
)*
$(
raw_args.$arg = return_if_parse_error!(if_option!(
$($arg_type_tt)+,
THEN {
if_option_vec!(
$($arg_type_tt)+,
THEN { values_t!(matches, stringify!($arg), inner_option_vec_type!($($arg_type_tt)+)) }
ELSE { value_t!(matches, stringify!($arg), inner_option_type!($($arg_type_tt)+)) }
)
}
ELSE {
if_vec!(
$($arg_type_tt)+,
THEN { values_t!(matches, stringify!($arg), inner_vec_type!($($arg_type_tt)+)) }
ELSE { value_t!(matches, stringify!($arg), $($arg_type_tt)+) }
)
}
));
)*
)*
raw_args.hydrate_with_globals(&matches)?;
// Subcommands
$(
if let Some(submatches) = matches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc)[4..])) {
raw_args.$subc = true;
// Globals
raw_args.hydrate_with_globals(&submatches)?;
// Subcommand flags
$(
raw_args.$subc_flag = submatches.is_present(&stringify!($subc_flag));
@ -626,12 +638,13 @@ macro_rules! usage {
}
));
)*
// Sub-subcommands
$(
if let Some(subsubmatches) = submatches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..])) {
raw_args.$subc_subc = true;
// Globals
raw_args.hydrate_with_globals(&subsubmatches)?;
// Sub-subcommand flags
$(
raw_args.$subc_subc_flag = subsubmatches.is_present(&stringify!($subc_subc_flag));

View File

@ -28,7 +28,7 @@ use bigint::hash::H256;
use util::{version_data, Address};
use bytes::Bytes;
use ansi_term::Colour;
use ethsync::{NetworkConfiguration, is_valid_node_url};
use ethsync::{NetworkConfiguration, validate_node_url, NetworkError};
use ethcore::ethstore::ethkey::{Secret, Public};
use ethcore::client::{VMType};
use ethcore::miner::{MinerOptions, Banning, StratumOptions};
@ -143,7 +143,7 @@ impl Configuration {
if self.args.cmd_signer_new_token {
Cmd::SignerToken(ws_conf, ui_conf, logger_config.clone())
} else if self.args.cmd_signer_sign {
let pwfile = self.args.arg_signer_sign_password.map(|pwfile| {
let pwfile = self.args.arg_password.first().map(|pwfile| {
PathBuf::from(pwfile)
});
Cmd::SignerSign {
@ -180,7 +180,7 @@ impl Configuration {
iterations: self.args.arg_keys_iterations,
path: dirs.keys,
spec: spec,
password_file: self.args.arg_account_new_password.clone(),
password_file: self.args.arg_password.first().map(|x| x.to_owned()),
};
AccountCmd::New(new_acc)
} else if self.args.cmd_account_list {
@ -215,7 +215,7 @@ impl Configuration {
path: dirs.keys,
spec: spec,
wallet_path: self.args.arg_wallet_import_path.unwrap().clone(),
password_file: self.args.arg_wallet_import_password,
password_file: self.args.arg_password.first().map(|x| x.to_owned()),
};
Cmd::ImportPresaleWallet(presale_cmd)
} else if self.args.cmd_import {
@ -698,9 +698,15 @@ impl Configuration {
let mut node_file = File::open(path).map_err(|e| format!("Error opening reserved nodes file: {}", e))?;
node_file.read_to_string(&mut buffer).map_err(|_| "Error reading reserved node file")?;
let lines = buffer.lines().map(|s| s.trim().to_owned()).filter(|s| !s.is_empty() && !s.starts_with("#")).collect::<Vec<_>>();
if let Some(invalid) = lines.iter().find(|s| !is_valid_node_url(s)) {
return Err(format!("Invalid node address format given for a boot node: {}", invalid));
for line in &lines {
match validate_node_url(line) {
None => continue,
Some(NetworkError::AddressResolve(_)) => return Err(format!("Failed to resolve hostname of a boot node: {}", line)),
Some(_) => return Err(format!("Invalid node address format given for a boot node: {}", line)),
}
}
Ok(lines)
},
None => Ok(Vec::new())

View File

@ -37,6 +37,10 @@ impl fmt::Display for Deprecated {
pub fn find_deprecated(args: &Args) -> Vec<Deprecated> {
let mut result = vec![];
if args.flag_warp {
result.push(Deprecated::DoesNothing("--warp"));
}
if args.flag_jsonrpc {
result.push(Deprecated::DoesNothing("--jsonrpc"));
}
@ -117,6 +121,7 @@ mod tests {
assert_eq!(find_deprecated(&Args::default()), vec![]);
assert_eq!(find_deprecated(&{
let mut args = Args::default();
args.flag_warp = true;
args.flag_jsonrpc = true;
args.flag_rpc = true;
args.flag_jsonrpc_off = true;
@ -135,6 +140,7 @@ mod tests {
args.flag_dapps_apis_all = true;
args
}), vec![
Deprecated::DoesNothing("--warp"),
Deprecated::DoesNothing("--jsonrpc"),
Deprecated::DoesNothing("--rpc"),
Deprecated::Replaced("--jsonrpc-off", "--no-jsonrpc"),

View File

@ -29,7 +29,7 @@ use cache::CacheConfig;
use dir::DatabaseDirectories;
use upgrade::{upgrade, upgrade_data_paths};
use migration::migrate;
use ethsync::is_valid_node_url;
use ethsync::{validate_node_url, NetworkError};
use path;
pub fn to_duration(s: &str) -> Result<Duration, String> {
@ -181,10 +181,10 @@ pub fn parity_ipc_path(base: &str, path: &str, shift: u16) -> String {
pub fn to_bootnodes(bootnodes: &Option<String>) -> Result<Vec<String>, String> {
match *bootnodes {
Some(ref x) if !x.is_empty() => x.split(',').map(|s| {
if is_valid_node_url(s) {
Ok(s.to_owned())
} else {
Err(format!("Invalid node address format given for a boot node: {}", s))
match validate_node_url(s) {
None => Ok(s.to_owned()),
Some(NetworkError::AddressResolve(_)) => Err(format!("Failed to resolve hostname of a boot node: {}", s)),
Some(_) => Err(format!("Invalid node address format given for a boot node: {}", s)),
}
}).collect(),
Some(_) => Ok(vec![]),

View File

@ -392,8 +392,21 @@ impl<T: LightChainClient + 'static> Eth for EthClient<T> {
}
fn transaction_by_hash(&self, hash: RpcH256) -> BoxFuture<Option<Transaction>, Error> {
let hash = hash.into();
let eip86 = self.client.eip86_transition();
Box::new(self.fetcher().transaction_by_hash(hash.into(), eip86).map(|x| x.map(|(tx, _)| tx)))
{
let tx_queue = self.transaction_queue.read();
if let Some(tx) = tx_queue.get(&hash) {
return Box::new(future::ok(Some(Transaction::from_pending(
tx.clone(),
self.client.chain_info().best_block_number,
eip86,
))));
}
}
Box::new(self.fetcher().transaction_by_hash(hash, eip86).map(|x| x.map(|(tx, _)| tx)))
}
fn transaction_by_block_hash_and_index(&self, hash: RpcH256, idx: Index) -> BoxFuture<Option<Transaction>, Error> {

View File

@ -73,7 +73,7 @@ mod api;
pub use api::*;
pub use chain::{SyncStatus, SyncState};
pub use network::{is_valid_node_url, NonReservedPeerMode, NetworkError, ConnectionFilter, ConnectionDirection};
pub use network::{validate_node_url, NonReservedPeerMode, NetworkError, ConnectionFilter, ConnectionDirection};
#[cfg(test)]
pub(crate) type Address = bigint::hash::H160;

View File

@ -4,7 +4,7 @@ homepage = "http://parity.io"
repository = "https://github.com/paritytech/parity"
license = "MIT/Apache-2.0"
name = "ethcore-bigint"
version = "0.1.3"
version = "0.2.1"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
@ -13,9 +13,10 @@ rustc-hex = "1.0"
rand = "0.3.12"
libc = "0.2"
heapsize = { version = "0.4", optional = true }
plain_hasher = { path = "../plain_hasher" }
plain_hasher = { path = "../plain_hasher", version = "0.1" }
[features]
x64asm_arithmetic=[]
rust_arithmetic=[]
std = ["bigint/std"]
heapsizeof = ["heapsize", "bigint/heapsizeof"]

View File

@ -17,7 +17,7 @@ use rand::{Rand, Rng};
use rand::os::OsRng;
use rustc_hex::{FromHex, FromHexError};
use plain_hasher::PlainHasher;
use bigint::U256;
use uint::U256;
use libc::{c_void, memcmp};
/// Return `s` without the `0x` at the beginning of it, if any.

View File

@ -12,7 +12,6 @@
extern crate rand;
extern crate rustc_hex;
extern crate bigint;
extern crate libc;
extern crate plain_hasher;
@ -20,6 +19,7 @@ extern crate plain_hasher;
#[macro_use]
extern crate heapsize;
pub extern crate bigint as uint;
pub mod hash;
/// A prelude module for re-exporting all the types defined in this crate.
@ -31,6 +31,6 @@ pub mod hash;
/// let y = x + 1.into();
/// ```
pub mod prelude {
pub use ::bigint::*;
pub use ::uint::*;
pub use ::hash::*;
}

View File

@ -115,7 +115,7 @@ pub use session::SessionInfo;
pub use connection_filter::{ConnectionFilter, ConnectionDirection};
pub use io::TimerToken;
pub use node_table::{is_valid_node_url, NodeId};
pub use node_table::{validate_node_url, NodeId};
use ipnetwork::{IpNetwork, IpNetworkError};
use std::str::FromStr;

View File

@ -28,7 +28,7 @@ use std::io::{Read, Write};
use bigint::hash::*;
use rlp::*;
use time::Tm;
use error::NetworkError;
use NetworkError;
use {AllowIP, IpFilter};
use discovery::{TableUpdates, NodeEntry};
use ip_utils::*;
@ -363,9 +363,12 @@ impl Drop for NodeTable {
}
/// Check if node url is valid
pub fn is_valid_node_url(url: &str) -> bool {
pub fn validate_node_url(url: &str) -> Option<NetworkError> {
use std::str::FromStr;
Node::from_str(url).is_ok()
match Node::from_str(url) {
Ok(_) => None,
Err(e) => Some(e)
}
}
#[cfg(test)]
@ -390,7 +393,7 @@ mod tests {
#[test]
fn node_parse() {
assert!(is_valid_node_url("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770"));
assert!(validate_node_url("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770").is_none());
let node = Node::from_str("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770");
assert!(node.is_ok());
let node = node.unwrap();