diff --git a/Cargo.lock b/Cargo.lock index 103e86e7a..177b1b5be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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)" = "" "checksum parity-ui-old-precompiled 1.8.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)" = "" "checksum parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)" = "" diff --git a/dapps/js-glue/Cargo.toml b/dapps/js-glue/Cargo.toml index 76c5457d7..4cad9cdab 100644 --- a/dapps/js-glue/Cargo.toml +++ b/dapps/js-glue/Cargo.toml @@ -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 "] build = "build.rs" diff --git a/dapps/js-glue/src/js.rs b/dapps/js-glue/src/js.rs index 49ccdd26f..d1d1cdda9 100644 --- a/dapps/js-glue/src/js.rs +++ b/dapps/js-glue/src/js.rs @@ -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") diff --git a/docs/CHANGELOG-1.7.md b/docs/CHANGELOG-1.7.md index 4042d56da..fc28e6a45 100644 --- a/docs/CHANGELOG-1.7.md +++ b/docs/CHANGELOG-1.7.md @@ -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. diff --git a/ethcore/light/src/transaction_queue.rs b/ethcore/light/src/transaction_queue.rs index 090919245..7f67c3718 100644 --- a/ethcore/light/src/transaction_queue.rs +++ b/ethcore/light/src/transaction_queue.rs @@ -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)] diff --git a/ethcore/res/wasm-tests b/ethcore/res/wasm-tests index c8129ce2f..94b7877b5 160000 --- a/ethcore/res/wasm-tests +++ b/ethcore/res/wasm-tests @@ -1 +1 @@ -Subproject commit c8129ce2f36c26ed634eda786960978a28e28d0e +Subproject commit 94b7877b5826a53627b8732ea0feb45869dd04ab diff --git a/ethcore/src/account_provider/mod.rs b/ethcore/src/account_provider/mod.rs index 6d7ab52cb..498c84bbf 100755 --- a/ethcore/src/account_provider/mod.rs +++ b/ethcore/src/account_provider/mod.rs @@ -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 { diff --git a/ethcore/wasm/src/env.rs b/ethcore/wasm/src/env.rs index a09ceea86..4a518beec 100644 --- a/ethcore/wasm/src/env.rs +++ b/ethcore/wasm/src/env.rs @@ -147,6 +147,11 @@ pub const SIGNATURES: &'static [UserFunctionDescriptor] = &[ &[I32], None, ), + Static( + "_elog", + &[I32; 4], + None, + ), // TODO: Get rid of it also somehow? Static( diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index d26346a3e..39b239fe8 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -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(&mut self, f: F) -> Result<(), InterpreterError> + where F: FnOnce(&vm::Schedule) -> Option + { + 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, 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, 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::()? as u32; + let data_ptr = context.value_stack.pop_as::()? as u32; + let topic_count = context.value_stack.pop_as::()? as u32; + let topic_ptr = context.value_stack.pop_as::()? 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 = 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 for Runtime<'a, 'b> { @@ -833,6 +889,9 @@ impl<'a, 'b> interpreter::UserFunctionExecutor 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)?) diff --git a/ethcore/wasm/src/tests.rs b/ethcore/wasm/src/tests.rs index c9174f288..245f27536 100644 --- a/ethcore/wasm/src/tests.rs +++ b/ethcore/wasm/src/tests.rs @@ -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)); } \ No newline at end of file diff --git a/js/package-lock.json b/js/package-lock.json index cb7da8602..a9a3d1d6e 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -44,76 +44,76 @@ } }, "@parity/dapp-account": { - "version": "github:paritytech/dapp-account#67eec35f3ef21aab77aee5c2ca4b8ae0bf5251f0", + "version": "github:paritytech/dapp-account#65b03835243219a678c1a517e2eb69845a097dcd", "requires": { - "@parity/dapp-accounts": "github:paritytech/dapp-accounts#8abec008e59c4c4df8902188371ab83c77d1d3de", - "@parity/dapp-vaults": "github:paritytech/dapp-vaults#b3c16b417e7b1cc671de91c719040924a6632806" + "@parity/dapp-accounts": "github:paritytech/dapp-accounts#ca55be1774563862e7b0cc72740d0747a60036b8", + "@parity/dapp-vaults": "github:paritytech/dapp-vaults#1bd5de3994227e6b733e7b3e985117a59f0ad638" } }, "@parity/dapp-accounts": { - "version": "github:paritytech/dapp-accounts#8abec008e59c4c4df8902188371ab83c77d1d3de", + "version": "github:paritytech/dapp-accounts#ca55be1774563862e7b0cc72740d0747a60036b8", "requires": { - "@parity/dapp-vaults": "github:paritytech/dapp-vaults#b3c16b417e7b1cc671de91c719040924a6632806" + "@parity/dapp-vaults": "github:paritytech/dapp-vaults#1bd5de3994227e6b733e7b3e985117a59f0ad638" } }, "@parity/dapp-address": { - "version": "github:paritytech/dapp-address#79d0f5300d17ec66476f9f59e62e73d62b31dadf", + "version": "github:paritytech/dapp-address#9b40c93dac5efa0d6a3b8aa30ea6ba19c9fd71cb", "requires": { - "@parity/dapp-account": "github:paritytech/dapp-account#67eec35f3ef21aab77aee5c2ca4b8ae0bf5251f0", - "@parity/dapp-addresses": "github:paritytech/dapp-addresses#d884a81b072805806ac6820f8b6c83d6faa04468" + "@parity/dapp-account": "github:paritytech/dapp-account#65b03835243219a678c1a517e2eb69845a097dcd", + "@parity/dapp-addresses": "github:paritytech/dapp-addresses#525453c8484b9c0e1b7ede1c5929b2e3374e2715" } }, "@parity/dapp-addresses": { - "version": "github:paritytech/dapp-addresses#d884a81b072805806ac6820f8b6c83d6faa04468", + "version": "github:paritytech/dapp-addresses#525453c8484b9c0e1b7ede1c5929b2e3374e2715", "requires": { - "@parity/dapp-accounts": "github:paritytech/dapp-accounts#8abec008e59c4c4df8902188371ab83c77d1d3de" + "@parity/dapp-accounts": "github:paritytech/dapp-accounts#ca55be1774563862e7b0cc72740d0747a60036b8" } }, "@parity/dapp-chaindeploy": { - "version": "github:paritytech/dapp-chaindeploy#922c728698187db94a732cd0b2c583715b9b50b8" + "version": "github:paritytech/dapp-chaindeploy#2adc0da8514c171957823d1b72131f48274300b9" }, "@parity/dapp-contract": { - "version": "github:paritytech/dapp-contract#f21537da25990a7dad4b6ec06dbb6aea4046a2a8", + "version": "github:paritytech/dapp-contract#0196d82260dbb54b468a27bed94fb0b8669ca6a0", "requires": { - "@parity/dapp-account": "github:paritytech/dapp-account#67eec35f3ef21aab77aee5c2ca4b8ae0bf5251f0" + "@parity/dapp-account": "github:paritytech/dapp-account#65b03835243219a678c1a517e2eb69845a097dcd" } }, "@parity/dapp-contracts": { - "version": "github:paritytech/dapp-contracts#6da86f65d367cab14c372825d8b25553d05ad4e8", + "version": "github:paritytech/dapp-contracts#30db6a5e6aba7cc7626972f9569319549efb7888", "requires": { - "@parity/dapp-account": "github:paritytech/dapp-account#67eec35f3ef21aab77aee5c2ca4b8ae0bf5251f0", - "@parity/dapp-accounts": "github:paritytech/dapp-accounts#8abec008e59c4c4df8902188371ab83c77d1d3de" + "@parity/dapp-account": "github:paritytech/dapp-account#65b03835243219a678c1a517e2eb69845a097dcd", + "@parity/dapp-accounts": "github:paritytech/dapp-accounts#ca55be1774563862e7b0cc72740d0747a60036b8" } }, "@parity/dapp-dapp-accounts": { - "version": "github:paritytech/dapp-dapp-accounts#d1692a1ed49809d4b0572e48aad0a4ed2926a10a" + "version": "github:paritytech/dapp-dapp-accounts#4cdbb5962c7a946da9df2fd80f120d9195087d41" }, "@parity/dapp-dapp-methods": { - "version": "github:paritytech/dapp-dapp-methods#3ecabdb95ef82578d5e1da4842a078db0db82d7b" + "version": "github:paritytech/dapp-dapp-methods#910fa7ba753a69d988146017a2096948463d33f4" }, "@parity/dapp-dapp-visible": { - "version": "github:paritytech/dapp-dapp-visible#337db256537c4c8195b46a1fd18fb9330d664180" + "version": "github:paritytech/dapp-dapp-visible#4506e9e9d25b837ab95d003fcd9f090db5cfefe8" }, "@parity/dapp-dappreg": { - "version": "github:paritytech/dapp-dappreg#10238d9074094fb1c97236d2416709db4267b4d2" + "version": "github:paritytech/dapp-dappreg#9cd360d7dc505b5661470ee9d6b98650c85b83b3" }, "@parity/dapp-develop": { - "version": "github:paritytech/dapp-develop#e7a32ecf2ff84772d2c437556b718cc1a56d656f", + "version": "github:paritytech/dapp-develop#85e436cdd1710e39ac45eb546ae8c029015a70ca", "requires": { - "@parity/dapp-contracts": "github:paritytech/dapp-contracts#6da86f65d367cab14c372825d8b25553d05ad4e8" + "@parity/dapp-contracts": "github:paritytech/dapp-contracts#30db6a5e6aba7cc7626972f9569319549efb7888" } }, "@parity/dapp-githubhint": { - "version": "github:paritytech/dapp-githubhint#76c60102473f80a240b99b9d1e7b84de3d7101c8" + "version": "github:paritytech/dapp-githubhint#8e299c739e1663d8590d6a8d345147e974341664" }, "@parity/dapp-home": { - "version": "github:paritytech/dapp-home#3a8c6c8efcb5c92390518f5d1cfcb3408089f218", + "version": "github:paritytech/dapp-home#d32073c41a048bb1be98cda2f569e70f6ee38070", "requires": { - "@parity/dapp-web": "github:paritytech/dapp-web#9fc091bad5fc7c960da3c90d630732ef48d7fdf7" + "@parity/dapp-web": "github:paritytech/dapp-web#fb0dbd86eeeacabda786150d1d1c2a9add8584d2" } }, "@parity/dapp-localtx": { - "version": "github:paritytech/dapp-localtx#a83b527d969f5f5de6ea02d6dcf1729e08b1ec02" + "version": "github:paritytech/dapp-localtx#087d32621c5ab87e72bd777b4dd580e9a3c844c4" }, "@parity/dapp-playground": { "version": "github:paritytech/dapp-playground#e136730fa64aceae2d7e0d2cd2aeea24d22b30f3", @@ -124,27 +124,13 @@ } }, "@parity/dapp-registry": { - "version": "github:paritytech/dapp-registry#8a3f61d10e858fe81b3731dd231b73e66a0879d9", - "requires": { - "@parity/api": "2.0.17", - "@parity/shared": "2.0.17", - "@parity/ui": "2.0.47", - "material-ui": "0.16.5" - } + "version": "github:paritytech/dapp-registry#654b44d9bccb324d27803c8751742d63e4c7690e" }, "@parity/dapp-settings": { - "version": "github:paritytech/dapp-settings#90737d6b34a62fe0843f8acbbf5669427cc2530a" + "version": "github:paritytech/dapp-settings#96d9f7a3c5e0d6fd21a8363bce1cf2a02bf746e7" }, "@parity/dapp-signaturereg": { - "version": "github:paritytech/dapp-signaturereg#31d70570a5c11bd5d954ccdcccc3dbb8f0e26f76", - "requires": { - "@parity/api": "2.0.17", - "@parity/shared": "2.0.17", - "moment": "2.17.0", - "react": "15.6.1", - "react-dom": "15.6.1", - "react-tap-event-plugin": "2.0.1" - } + "version": "github:paritytech/dapp-signaturereg#508ff60a6ed59d1d693e39fbcebce92f79ad9691" }, "@parity/dapp-signer": { "version": "github:paritytech/dapp-signer#96514150d210530eb3261399de84874b80a71f60", @@ -155,25 +141,25 @@ } }, "@parity/dapp-status": { - "version": "github:paritytech/dapp-status#4247a7885d24f7cd402264713ab37e4aab1779c0" + "version": "github:paritytech/dapp-status#397de2851688213091e161cd0c8251368406697d" }, "@parity/dapp-tokendeploy": { - "version": "github:paritytech/dapp-tokendeploy#09931fc07684e01ef0ecaa796a2ebea51ad90d6b" + "version": "github:paritytech/dapp-tokendeploy#ef5df286fa9eaed7a393fc93224004221d840af5" }, "@parity/dapp-tokenreg": { - "version": "github:paritytech/dapp-tokenreg#611f513f4c644c6513e58c4b06ea71a489a72cc7" + "version": "github:paritytech/dapp-tokenreg#530980bf9305755936b0692e63a4b7559b0f1027" }, "@parity/dapp-vaults": { - "version": "github:paritytech/dapp-vaults#b3c16b417e7b1cc671de91c719040924a6632806" + "version": "github:paritytech/dapp-vaults#1bd5de3994227e6b733e7b3e985117a59f0ad638" }, "@parity/dapp-wallet": { - "version": "github:paritytech/dapp-wallet#d7fb2e40b879676f99c36b53ce21480722b99b69", + "version": "github:paritytech/dapp-wallet#055fba4e8c3dd1e58ebc091a08df50583ac82fe0", "requires": { - "@parity/dapp-account": "github:paritytech/dapp-account#67eec35f3ef21aab77aee5c2ca4b8ae0bf5251f0" + "@parity/dapp-account": "github:paritytech/dapp-account#65b03835243219a678c1a517e2eb69845a097dcd" } }, "@parity/dapp-web": { - "version": "github:paritytech/dapp-web#9fc091bad5fc7c960da3c90d630732ef48d7fdf7", + "version": "github:paritytech/dapp-web#fb0dbd86eeeacabda786150d1d1c2a9add8584d2", "requires": { "base32.js": "0.1.0" } @@ -213,16 +199,16 @@ } }, "@parity/plugin-signer-account": { - "version": "github:paritytech/plugin-signer-account#b64a252097c09bc04cb14749d1d75778e22acbb6" + "version": "github:paritytech/plugin-signer-account#a00e131273becccab59e9852ec3313cb0fe19663" }, "@parity/plugin-signer-default": { - "version": "github:paritytech/plugin-signer-default#c6755830a3e20156f48a9d3967c152ee6a77fd1f" + "version": "github:paritytech/plugin-signer-default#54e7fa63063f2dcae409ead222ff87fbcc19f1f9" }, "@parity/plugin-signer-hardware": { - "version": "github:paritytech/plugin-signer-hardware#768207e21766ececac0295aa1a00b02925fd3766" + "version": "github:paritytech/plugin-signer-hardware#34b5562062bb1fe8ea6246c06d45624d7f309aa7" }, "@parity/plugin-signer-qr": { - "version": "github:paritytech/plugin-signer-qr#eef7108f90f625a550ad3cf1a970938eebf2bddb" + "version": "github:paritytech/plugin-signer-qr#8d937dd5f5d726fb22be72967fd9a472fa467bfd" }, "@parity/shapeshift": { "version": "2.0.17", @@ -2062,11 +2048,6 @@ "hoek": "2.16.3" } }, - "bowser": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.8.1.tgz", - "integrity": "sha512-NMPaR8ILtdLSWzxQtEs16XbxMcY8ohWGQ5V+TZSJS3fNUt/PBAGkF6YWO9B/4qWE23bK3o0moQKq8UyFEosYkA==" - }, "brace": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/brace/-/brace-0.9.0.tgz", @@ -2453,11 +2434,6 @@ "supports-color": "2.0.0" } }, - "change-emitter": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz", - "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=" - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -2496,7 +2472,6 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.1.2", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -3056,6 +3031,16 @@ "unique-concat": "0.2.2" } }, + "cross-env": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.1.1.tgz", + "integrity": "sha512-Wtvr+z0Z06KO1JxjfRRsPC+df7biIOiuV4iZ73cThjFGkH+ULBZq1MkBdywEcJC4cTDbO6c8IjgRjfswx3YTBA==", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "is-windows": "1.0.1" + } + }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", @@ -5465,905 +5450,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.7.0", - "node-pre-gyp": "0.6.36" - }, - "dependencies": { - "abbrev": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.9" - } - }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "balanced-match": { - "version": "0.4.2", - "bundled": true, - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "node-pre-gyp": { - "version": "0.6.36", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" - } - }, - "npmlog": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" - } - }, - "rimraf": { - "version": "2.6.1", - "bundled": true, - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.0.1", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.3.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -7321,11 +6407,6 @@ } } }, - "hyphenate-style-name": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz", - "integrity": "sha1-MRYKNpMK2vH8BMYHT360FGXU7Es=" - }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", @@ -7591,15 +6672,6 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" }, - "inline-style-prefixer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-2.0.5.tgz", - "integrity": "sha1-wVPH6I/YT+9cYC6VqBaLJ3BnH+c=", - "requires": { - "bowser": "1.8.1", - "hyphenate-style-name": "1.0.2" - } - }, "inquirer": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", @@ -8046,6 +7118,12 @@ "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", "dev": true }, + "is-windows": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.1.tgz", + "integrity": "sha1-MQ23D3QtJZoWo2kgK1GvhCMzENk=", + "dev": true + }, "is-zip": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-zip/-/is-zip-1.0.0.tgz", @@ -8862,7 +7940,8 @@ "lodash.merge": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz", - "integrity": "sha1-aYhLoUSsM/5plzemCG3v+t0PicU=" + "integrity": "sha1-aYhLoUSsM/5plzemCG3v+t0PicU=", + "dev": true }, "lodash.omitby": { "version": "4.6.0", @@ -9093,24 +8172,6 @@ "integrity": "sha1-ssbGGPzOzk74bE/Gy4p8v1rtqNc=", "dev": true }, - "material-ui": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/material-ui/-/material-ui-0.16.5.tgz", - "integrity": "sha1-u4ZhqsfKyMsiOj529PV+4YpK78E=", - "requires": { - "babel-runtime": "6.26.0", - "inline-style-prefixer": "2.0.5", - "keycode": "2.1.9", - "lodash.merge": "4.6.0", - "lodash.throttle": "4.1.1", - "react-addons-create-fragment": "15.6.2", - "react-addons-transition-group": "15.6.2", - "react-event-listener": "0.4.5", - "recompose": "0.20.2", - "simple-assign": "0.1.0", - "warning": "3.0.0" - } - }, "math-expression-evaluator": { "version": "1.2.17", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", @@ -9302,7 +8363,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -11560,16 +10621,6 @@ } } }, - "react-addons-create-fragment": { - "version": "15.6.2", - "resolved": "https://registry.npmjs.org/react-addons-create-fragment/-/react-addons-create-fragment-15.6.2.tgz", - "integrity": "sha1-o5TefCx77Na1R1uhuXrEcs58dPg=", - "requires": { - "fbjs": "0.8.16", - "loose-envify": "1.3.1", - "object-assign": "4.1.1" - } - }, "react-addons-perf": { "version": "15.4.2", "resolved": "https://registry.npmjs.org/react-addons-perf/-/react-addons-perf-15.4.2.tgz", @@ -11763,7 +10814,7 @@ "react-qr-reader": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/react-qr-reader/-/react-qr-reader-1.1.3.tgz", - "integrity": "sha512-ruBF8KaSwUW9nbzjO4rA7/HOCGYZuNUz9od7uBRy8SRBi24nwxWWmwa2z8R6vPGDRglA0y2Qk1aVBuC1olTnHw==", + "integrity": "sha1-dDmnZvyZPLj17u/HLCnblh1AswI=", "requires": { "jsqr": "git+https://github.com/JodusNodus/jsQR.git#5ba1acefa1cbb9b2bc92b49f503f2674e2ec212b", "prop-types": "15.5.10", @@ -11989,24 +11040,6 @@ "resolve": "1.5.0" } }, - "recompose": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/recompose/-/recompose-0.20.2.tgz", - "integrity": "sha1-ET1qx+KcpmTP/+wWtoHd3fFSULw=", - "requires": { - "change-emitter": "0.1.6", - "fbjs": "0.8.16", - "hoist-non-react-statics": "1.2.0", - "symbol-observable": "0.2.4" - }, - "dependencies": { - "symbol-observable": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-0.2.4.tgz", - "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=" - } - } - }, "redbox-react": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/redbox-react/-/redbox-react-1.5.0.tgz", @@ -12718,11 +11751,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, - "simple-assign": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/simple-assign/-/simple-assign-0.1.0.tgz", - "integrity": "sha1-F/0wZqXz13OPUDIbsPFMooHMS6o=" - }, "simple-get": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-1.4.3.tgz", diff --git a/js/package.json b/js/package.json index 508b328f4..3ff5a08ca 100644 --- a/js/package.json +++ b/js/package.json @@ -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", diff --git a/js/src/embed.js b/js/src/embed.js index a1a2573d1..ace85a016 100644 --- a/js/src/embed.js +++ b/js/src/embed.js @@ -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( , container ); + +// testing, signer plugins +import '@parity/plugin-signer-account'; +import '@parity/plugin-signer-default'; +import '@parity/plugin-signer-hardware'; +import '@parity/plugin-signer-qr'; diff --git a/js/webpack/app.js b/js/webpack/app.js index d9ec3e48a..8fbe18d85 100644 --- a/js/webpack/app.js +++ b/js/webpack/app.js @@ -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'] }) diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index cf49c6452..c46965ef2 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -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) = 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) = None, - "--password=[FILE]", - "Path to the password file", - ARG arg_wallet_import_path: (Option) = None, "", "Path to the wallet", @@ -179,10 +172,6 @@ usage! { { "Sign", - ARG arg_signer_sign_password: (Option) = None, - "--password=[FILE]", - "Path to the password file", - ARG arg_signer_sign_id: (Option) = 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) = 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, diff --git a/parity/cli/usage.rs b/parity/cli/usage.rs index 83b878ee1..71ac01295 100644 --- a/parity/cli/usage.rs +++ b/parity/cli/usage.rs @@ -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>(command: &[S]) -> Result { @@ -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::>()) + .args(&usages.iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::>()) // 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::>()) + .args(&usages.iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::>()) // 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)); diff --git a/parity/configuration.rs b/parity/configuration.rs index 31febd375..249c64acb 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -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::>(); - 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()) diff --git a/parity/deprecated.rs b/parity/deprecated.rs index d80ea3357..b41475d9d 100644 --- a/parity/deprecated.rs +++ b/parity/deprecated.rs @@ -37,6 +37,10 @@ impl fmt::Display for Deprecated { pub fn find_deprecated(args: &Args) -> Vec { 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"), diff --git a/parity/helpers.rs b/parity/helpers.rs index f04027029..8527850e8 100644 --- a/parity/helpers.rs +++ b/parity/helpers.rs @@ -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 { @@ -181,10 +181,10 @@ pub fn parity_ipc_path(base: &str, path: &str, shift: u16) -> String { pub fn to_bootnodes(bootnodes: &Option) -> Result, 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![]), diff --git a/rpc/src/v1/impls/light/eth.rs b/rpc/src/v1/impls/light/eth.rs index b797e76c2..d498c6ccd 100644 --- a/rpc/src/v1/impls/light/eth.rs +++ b/rpc/src/v1/impls/light/eth.rs @@ -392,8 +392,21 @@ impl Eth for EthClient { } fn transaction_by_hash(&self, hash: RpcH256) -> BoxFuture, 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, Error> { diff --git a/sync/src/lib.rs b/sync/src/lib.rs index 091ce5ba9..0495d72a7 100644 --- a/sync/src/lib.rs +++ b/sync/src/lib.rs @@ -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; diff --git a/util/bigint/Cargo.toml b/util/bigint/Cargo.toml index fcca56078..3e9f9fd37 100644 --- a/util/bigint/Cargo.toml +++ b/util/bigint/Cargo.toml @@ -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 "] [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"] diff --git a/util/bigint/src/hash.rs b/util/bigint/src/hash.rs index 316062bc4..212a1dd13 100644 --- a/util/bigint/src/hash.rs +++ b/util/bigint/src/hash.rs @@ -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. diff --git a/util/bigint/src/lib.rs b/util/bigint/src/lib.rs index 1b1b5d488..58d416b50 100644 --- a/util/bigint/src/lib.rs +++ b/util/bigint/src/lib.rs @@ -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::*; } diff --git a/util/network/src/lib.rs b/util/network/src/lib.rs index bc5459d5a..6cf81fa9d 100644 --- a/util/network/src/lib.rs +++ b/util/network/src/lib.rs @@ -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; diff --git a/util/network/src/node_table.rs b/util/network/src/node_table.rs index 94ad4d30a..6ba598291 100644 --- a/util/network/src/node_table.rs +++ b/util/network/src/node_table.rs @@ -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 { 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();