Merge branch 'master' into fix-nonce-reservation

This commit is contained in:
Nicolas Gotchac 2017-11-10 17:36:12 +01:00
commit 8c6b89df72
27 changed files with 398 additions and 1187 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]] [[package]]
name = "adler32" name = "adler32"
version = "1.0.2" version = "1.0.2"
@ -181,7 +167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "bloomable" name = "bloomable"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"hash 0.1.0", "hash 0.1.0",
] ]
@ -294,7 +280,7 @@ name = "common-types"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bloomable 0.1.0", "bloomable 0.1.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
"ethjson 0.1.0", "ethjson 0.1.0",
@ -493,7 +479,7 @@ dependencies = [
"common-types 0.1.0", "common-types 0.1.0",
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.9.0", "ethash 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bloom-journal 0.1.0", "ethcore-bloom-journal 0.1.0",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
@ -553,7 +539,7 @@ dependencies = [
[[package]] [[package]]
name = "ethcore-bigint" name = "ethcore-bigint"
version = "0.1.3" version = "0.2.1"
dependencies = [ dependencies = [
"bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -598,7 +584,7 @@ version = "1.9.0"
dependencies = [ dependencies = [
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-io 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)", "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)", "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)", "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-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-io 1.9.0", "ethcore-io 1.9.0",
@ -685,7 +671,7 @@ version = "1.0.0"
dependencies = [ dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-logger 1.9.0", "ethcore-logger 1.9.0",
@ -719,7 +705,7 @@ name = "ethcore-stratum"
version = "1.9.0" version = "1.9.0"
dependencies = [ dependencies = [
"env_logger 0.4.3 (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-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-logger 1.9.0", "ethcore-logger 1.9.0",
"ethcore-util 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)", "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)", "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)", "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-bytes 0.1.0",
"ethcore-logger 1.9.0", "ethcore-logger 1.9.0",
"hash 0.1.0", "hash 0.1.0",
@ -771,7 +757,7 @@ name = "ethcrypto"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)", "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", "ethkey 0.2.0",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "subtle 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -783,7 +769,7 @@ name = "ethjson"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"clippy 0.0.103 (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",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "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 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)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
@ -796,7 +782,7 @@ version = "0.2.0"
dependencies = [ dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "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)", "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)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
@ -820,7 +806,7 @@ dependencies = [
name = "ethstore" name = "ethstore"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcrypto 0.1.0", "ethcrypto 0.1.0",
"ethkey 0.2.0", "ethkey 0.2.0",
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-io 1.9.0", "ethcore-io 1.9.0",
@ -888,7 +874,7 @@ name = "evm"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "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", "ethcore-util 1.9.0",
"evmjit 1.9.0", "evmjit 1.9.0",
"hash 0.1.0", "hash 0.1.0",
@ -907,7 +893,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
"ethjson 0.1.0", "ethjson 0.1.0",
@ -1028,7 +1014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "hardware-wallet" name = "hardware-wallet"
version = "1.9.0" version = "1.9.0"
dependencies = [ dependencies = [
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethkey 0.2.0", "ethkey 0.2.0",
"hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)", "hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)",
"libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)", "libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)",
@ -1044,7 +1030,7 @@ name = "hash"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1054,7 +1040,7 @@ name = "hashdb"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"elastic-array 0.9.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",
] ]
[[package]] [[package]]
@ -1233,7 +1219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "journaldb" name = "journaldb"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-logger 1.9.0", "ethcore-logger 1.9.0",
"hash 0.1.0", "hash 0.1.0",
@ -1375,7 +1361,7 @@ name = "kvdb-rocksdb"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"elastic-array 0.9.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",
"kvdb 0.1.0", "kvdb 0.1.0",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1525,7 +1511,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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", "hash 0.1.0",
"hashdb 0.1.0", "hashdb 0.1.0",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1671,7 +1657,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"native-contract-generator 0.1.0", "native-contract-generator 0.1.0",
] ]
@ -1705,7 +1691,7 @@ name = "node-filter"
version = "1.9.0" version = "1.9.0"
dependencies = [ dependencies = [
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-io 1.9.0", "ethcore-io 1.9.0",
"ethcore-network 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)", "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)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-io 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)", "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)", "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)", "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-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-util 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)", "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)", "mime_guess 2.0.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)",
"node-health 0.1.0", "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-hash-fetch 1.9.0",
"parity-reactor 0.1.0", "parity-reactor 0.1.0",
"parity-ui 1.9.0", "parity-ui 1.9.0",
@ -2014,7 +2000,7 @@ dependencies = [
[[package]] [[package]]
name = "parity-dapps-glue" name = "parity-dapps-glue"
version = "1.9.0" version = "1.9.1"
dependencies = [ dependencies = [
"aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2029,7 +2015,7 @@ dependencies = [
[[package]] [[package]]
name = "parity-dapps-glue" name = "parity-dapps-glue"
version = "1.9.0" version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "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" version = "1.9.0"
dependencies = [ dependencies = [
"ethabi 4.0.1 (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",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
"fetch 0.1.0", "fetch 0.1.0",
@ -2068,7 +2054,7 @@ version = "1.9.0"
dependencies = [ dependencies = [
"cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
"jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.8)", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.8)",
@ -2099,7 +2085,7 @@ dependencies = [
name = "parity-machine" name = "parity-machine"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
] ]
@ -2120,7 +2106,7 @@ dependencies = [
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.9.0", "ethash 1.9.0",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-devtools 1.9.0", "ethcore-devtools 1.9.0",
"ethcore-io 1.9.0", "ethcore-io 1.9.0",
@ -2219,14 +2205,14 @@ dependencies = [
name = "parity-ui-dev" name = "parity-ui-dev"
version = "1.9.0" version = "1.9.0"
dependencies = [ 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]] [[package]]
name = "parity-ui-old-dev" name = "parity-ui-old-dev"
version = "1.9.0" version = "1.9.0"
dependencies = [ 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]] [[package]]
@ -2234,7 +2220,7 @@ name = "parity-ui-old-precompiled"
version = "1.8.0" version = "1.8.0"
source = "git+https://github.com/paritytech/js-precompiled.git?branch=v1#94b0a89aac7eb5ddfdb53cd9bb039da6fdbf7583" source = "git+https://github.com/paritytech/js-precompiled.git?branch=v1#94b0a89aac7eb5ddfdb53cd9bb039da6fdbf7583"
dependencies = [ 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]] [[package]]
@ -2242,7 +2228,7 @@ name = "parity-ui-precompiled"
version = "1.9.0" version = "1.9.0"
source = "git+https://github.com/paritytech/js-precompiled.git#1626d64235241e75c531eece004a4923d9d4fcc6" source = "git+https://github.com/paritytech/js-precompiled.git#1626d64235241e75c531eece004a4923d9d4fcc6"
dependencies = [ 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]] [[package]]
@ -2251,7 +2237,7 @@ version = "1.9.0"
dependencies = [ dependencies = [
"ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.9.0", "ethcore 1.9.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
"ethsync 1.9.0", "ethsync 1.9.0",
@ -2281,7 +2267,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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", "ethcore-network 1.9.0",
"ethcrypto 0.1.0", "ethcrypto 0.1.0",
"ethkey 0.2.0", "ethkey 0.2.0",
@ -2344,7 +2330,7 @@ name = "patricia_trie"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"elastic-array 0.9.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",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-logger 1.9.0", "ethcore-logger 1.9.0",
"hash 0.1.0", "hash 0.1.0",
@ -2634,7 +2620,7 @@ version = "0.2.0"
dependencies = [ dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "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)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -3259,7 +3245,7 @@ dependencies = [
name = "triehash" name = "triehash"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"hash 0.1.0", "hash 0.1.0",
"rlp 0.2.0", "rlp 0.2.0",
] ]
@ -3362,7 +3348,7 @@ name = "util-error"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "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", "kvdb 0.1.0",
"rlp 0.2.0", "rlp 0.2.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3407,7 +3393,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"common-types 0.1.0", "common-types 0.1.0",
"ethcore-bigint 0.1.3", "ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-util 1.9.0", "ethcore-util 1.9.0",
"ethjson 0.1.0", "ethjson 0.1.0",
@ -3422,6 +3408,20 @@ name = "void"
version = "1.0.2" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" 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]] [[package]]
name = "wasm-utils" name = "wasm-utils"
version = "0.1.0" 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 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 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 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-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-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>" "checksum parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)" = "<none>"

View File

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

View File

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

View File

@ -1242,7 +1242,7 @@ impl BlockChainClient for Client {
// that's just a copy of the state. // that's just a copy of the state.
let original_state = self.state_at(block).ok_or(CallError::StatePruned)?; let original_state = self.state_at(block).ok_or(CallError::StatePruned)?;
let sender = t.sender(); let sender = t.sender();
let options = || TransactOptions::with_tracing(); let options = || TransactOptions::with_tracing().dont_check_nonce();
let cond = |gas| { let cond = |gas| {
let mut tx = t.as_unsigned().clone(); let mut tx = t.as_unsigned().clone();

View File

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

View File

@ -55,6 +55,8 @@ pub enum UserTrap {
Unknown, Unknown,
/// Passed string had invalid utf-8 encoding /// Passed string had invalid utf-8 encoding
BadUtf8, BadUtf8,
/// Log event error
Log,
/// Other error in native code /// Other error in native code
Other, Other,
/// Panic with message /// Panic with message
@ -75,6 +77,7 @@ impl ::std::fmt::Display for UserTrap {
UserTrap::AllocationFailed => write!(f, "Memory allocation failed (OOM)"), UserTrap::AllocationFailed => write!(f, "Memory allocation failed (OOM)"),
UserTrap::BadUtf8 => write!(f, "String encoding is bad utf-8 sequence"), UserTrap::BadUtf8 => write!(f, "String encoding is bad utf-8 sequence"),
UserTrap::GasLimit => write!(f, "Invocation resulted in gas limit violated"), 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::Other => write!(f, "Other unspecified error"),
UserTrap::Panic(ref msg) => write!(f, "Panic: {}", msg), 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 /// Invoke create in the state runtime
pub fn create(&mut self, context: InterpreterCallerContext) pub fn create(&mut self, context: InterpreterCallerContext)
-> Result<Option<interpreter::RuntimeValue>, InterpreterError> -> Result<Option<interpreter::RuntimeValue>, InterpreterError>
@ -749,6 +767,44 @@ impl<'a, 'b> Runtime<'a, 'b> {
pub fn ext(&mut self) -> &mut vm::Ext { pub fn ext(&mut self) -> &mut vm::Ext {
self.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> { 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" => { "_value" => {
self.value(context) self.value(context)
}, },
"_elog" => {
self.log(context)
},
_ => { _ => {
trace!(target: "wasm", "Trapped due to unhandled function: '{}'", name); trace!(target: "wasm", "Trapped due to unhandled function: '{}'", name);
Ok(self.unknown_trap(context)?) Ok(self.unknown_trap(context)?)

View File

@ -680,7 +680,6 @@ fn externs() {
#[test] #[test]
fn embedded_keccak() { fn embedded_keccak() {
::ethcore_logger::init_log(); ::ethcore_logger::init_log();
let mut code = load_sample!("keccak.wasm"); let mut code = load_sample!("keccak.wasm");
code.extend_from_slice(b"something"); code.extend_from_slice(b"something");
@ -704,3 +703,38 @@ fn embedded_keccak() {
assert_eq!(H256::from_slice(&result), H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87")); assert_eq!(H256::from_slice(&result), H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87"));
assert_eq!(gas_left, U256::from(80_452)); 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" "Parity"
], ],
"scripts": { "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:app": "webpack --progress --config webpack/app",
"build:lib": "webpack --progress --config webpack/libraries", "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", "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": "cross-env NODE_ENV=production npm run build",
"ci:build:app": "NODE_ENV=production webpack --progress --config webpack/app", "clean": "rimraf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache",
"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",
"coveralls": "npm run testCoverage && coveralls < coverage/lcov.info", "coveralls": "npm run testCoverage && coveralls < coverage/lcov.info",
"lint": "npm run lint:css && npm run lint:js", "lint": "npm run lint:css && npm run lint:js",
"lint:cached": "npm run lint:css && npm run lint:js:cached", "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": "npm run clean && npm install && npm run build:lib && npm run start:app",
"start:app": "node webpack/dev.server", "start:app": "node webpack/dev.server",
"start:electron": "npm run build:app && electron .build/", "start:electron": "npm run build:app && electron .build/",
"test": "NODE_ENV=test mocha --compilers ejs:ejsify 'src/**/*.spec.js'", "test": "cross-env 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:coverage": "cross-env NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:e2e": "NODE_ENV=test mocha 'src/**/*.e2e.js'", "test:e2e": "cross-env 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:npm": "(cd .npmjs && npm i) && node test/npmParity && node test/npmJsonRpc && (rimraf .npmjs/node_modules)",
"prepush": "npm run lint:cached" "prepush": "npm run lint:cached"
}, },
"devDependencies": { "devDependencies": {
@ -75,6 +71,7 @@
"copy-webpack-plugin": "4.0.1", "copy-webpack-plugin": "4.0.1",
"core-js": "2.4.1", "core-js": "2.4.1",
"coveralls": "2.11.16", "coveralls": "2.11.16",
"cross-env": "5.1.1",
"css-loader": "0.28.4", "css-loader": "0.28.4",
"ejs-loader": "0.3.0", "ejs-loader": "0.3.0",
"ejsify": "1.0.0", "ejsify": "1.0.0",
@ -118,6 +115,7 @@
"react-addons-test-utils": "15.4.2", "react-addons-test-utils": "15.4.2",
"react-hot-loader": "3.0.0-beta.6", "react-hot-loader": "3.0.0-beta.6",
"react-intl-aggregate-webpack-plugin": "0.0.1", "react-intl-aggregate-webpack-plugin": "0.0.1",
"rimraf": "2.6.2",
"sinon": "1.17.7", "sinon": "1.17.7",
"sinon-as-promised": "4.0.2", "sinon-as-promised": "4.0.2",
"sinon-chai": "2.8.0", "sinon-chai": "2.8.0",

View File

@ -31,6 +31,7 @@ import { patchApi } from '@parity/shared/util/tx';
import SecureApi from './secureApi'; import SecureApi from './secureApi';
import './ShellExtend';
import '@parity/shared/environment'; import '@parity/shared/environment';
import '@parity/shared/assets/fonts/Roboto/font.css'; import '@parity/shared/assets/fonts/Roboto/font.css';
import '@parity/shared/assets/fonts/RobotoMono/font.css'; import '@parity/shared/assets/fonts/RobotoMono/font.css';
@ -70,8 +71,6 @@ class FrameSecureApi extends SecureApi {
connect () { connect () {
// Do nothing - this API does not need connecting // Do nothing - this API does not need connecting
this.emit('connecting'); this.emit('connecting');
// Fetch settings
this._fetchSettings();
// Fire connected event with some delay. // Fire connected event with some delay.
setTimeout(() => { setTimeout(() => {
this.emit('connected'); this.emit('connected');
@ -99,7 +98,7 @@ transport.uiUrl = uiUrl.replace('http://', '').replace('https://', '');
const api = new FrameSecureApi(transport); const api = new FrameSecureApi(transport);
patchApi(api); patchApi(api);
ContractInstances.create(api); ContractInstances.get(api);
const store = initStore(api, null, true); const store = initStore(api, null, true);
@ -125,3 +124,9 @@ ReactDOM.render(
</AppContainer>, </AppContainer>,
container 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 isEmbed = EMBED === '1' || EMBED === 'true';
const entry = isEmbed const entry = isEmbed
? { embed: './embed.js' } ? { embed: ['babel-polyfill', './embed.js'] }
: { bundle: ['babel-polyfill', './index.parity.js'] }; : { bundle: ['babel-polyfill', './index.parity.js'] };
module.exports = { module.exports = {
@ -238,7 +238,7 @@ module.exports = {
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
title: 'Parity Bar', title: 'Parity Bar',
filename: 'embed.html', filename: 'embed.html',
template: './index.ejs', template: './index.parity.ejs',
favicon: FAVICON, favicon: FAVICON,
chunks: ['embed'] chunks: ['embed']
}) })

View File

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

View File

@ -153,7 +153,7 @@ macro_rules! usage {
use std::{fs, io, process}; use std::{fs, io, process};
use std::io::{Read, Write}; use std::io::{Read, Write};
use util::version; 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 helpers::replace_home;
use std::ffi::OsStr; use std::ffi::OsStr;
use std::collections::HashMap; use std::collections::HashMap;
@ -503,6 +503,36 @@ macro_rules! usage {
args 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 #[allow(unused_variables)] // the submatches of arg-less subcommands aren't used
pub fn parse<S: AsRef<str>>(command: &[S]) -> Result<Self, ClapError> { 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..])) SubCommand::with_name(&underscore_to_hyphen!(&stringify!($subc)[4..]))
.about($subc_help) .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(&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` .setting(AppSettings::SubcommandRequired) // prevent from running `parity account`
.subcommand( .subcommand(
SubCommand::with_name(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..])) SubCommand::with_name(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..]))
.about($subc_subc_help) .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(&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())))?; .get_matches_from_safe(command.iter().map(|x| OsStr::new(x.as_ref())))?;
let mut raw_args : RawArgs = Default::default(); let mut raw_args : RawArgs = Default::default();
$(
$( raw_args.hydrate_with_globals(&matches)?;
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)+) }
)
}
));
)*
)*
// Subcommands // Subcommands
$( $(
if let Some(submatches) = matches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc)[4..])) { if let Some(submatches) = matches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc)[4..])) {
raw_args.$subc = true; raw_args.$subc = true;
// Globals
raw_args.hydrate_with_globals(&submatches)?;
// Subcommand flags // Subcommand flags
$( $(
raw_args.$subc_flag = submatches.is_present(&stringify!($subc_flag)); raw_args.$subc_flag = submatches.is_present(&stringify!($subc_flag));
@ -626,12 +638,13 @@ macro_rules! usage {
} }
)); ));
)* )*
// Sub-subcommands // Sub-subcommands
$( $(
if let Some(subsubmatches) = submatches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..])) { if let Some(subsubmatches) = submatches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..])) {
raw_args.$subc_subc = true; raw_args.$subc_subc = true;
// Globals
raw_args.hydrate_with_globals(&subsubmatches)?;
// Sub-subcommand flags // Sub-subcommand flags
$( $(
raw_args.$subc_subc_flag = subsubmatches.is_present(&stringify!($subc_subc_flag)); 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 util::{version_data, Address};
use bytes::Bytes; use bytes::Bytes;
use ansi_term::Colour; 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::ethstore::ethkey::{Secret, Public};
use ethcore::client::{VMType}; use ethcore::client::{VMType};
use ethcore::miner::{MinerOptions, Banning, StratumOptions}; use ethcore::miner::{MinerOptions, Banning, StratumOptions};
@ -143,7 +143,7 @@ impl Configuration {
if self.args.cmd_signer_new_token { if self.args.cmd_signer_new_token {
Cmd::SignerToken(ws_conf, ui_conf, logger_config.clone()) Cmd::SignerToken(ws_conf, ui_conf, logger_config.clone())
} else if self.args.cmd_signer_sign { } 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) PathBuf::from(pwfile)
}); });
Cmd::SignerSign { Cmd::SignerSign {
@ -180,7 +180,7 @@ impl Configuration {
iterations: self.args.arg_keys_iterations, iterations: self.args.arg_keys_iterations,
path: dirs.keys, path: dirs.keys,
spec: spec, 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) AccountCmd::New(new_acc)
} else if self.args.cmd_account_list { } else if self.args.cmd_account_list {
@ -215,7 +215,7 @@ impl Configuration {
path: dirs.keys, path: dirs.keys,
spec: spec, spec: spec,
wallet_path: self.args.arg_wallet_import_path.unwrap().clone(), 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) Cmd::ImportPresaleWallet(presale_cmd)
} else if self.args.cmd_import { } 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))?; 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")?; 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<_>>(); 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) Ok(lines)
}, },
None => Ok(Vec::new()) None => Ok(Vec::new())

View File

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

View File

@ -29,7 +29,7 @@ use cache::CacheConfig;
use dir::DatabaseDirectories; use dir::DatabaseDirectories;
use upgrade::{upgrade, upgrade_data_paths}; use upgrade::{upgrade, upgrade_data_paths};
use migration::migrate; use migration::migrate;
use ethsync::is_valid_node_url; use ethsync::{validate_node_url, NetworkError};
use path; use path;
pub fn to_duration(s: &str) -> Result<Duration, String> { 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> { pub fn to_bootnodes(bootnodes: &Option<String>) -> Result<Vec<String>, String> {
match *bootnodes { match *bootnodes {
Some(ref x) if !x.is_empty() => x.split(',').map(|s| { Some(ref x) if !x.is_empty() => x.split(',').map(|s| {
if is_valid_node_url(s) { match validate_node_url(s) {
Ok(s.to_owned()) None => Ok(s.to_owned()),
} else { Some(NetworkError::AddressResolve(_)) => Err(format!("Failed to resolve hostname of a boot node: {}", s)),
Err(format!("Invalid node address format given for a boot node: {}", s)) Some(_) => Err(format!("Invalid node address format given for a boot node: {}", s)),
} }
}).collect(), }).collect(),
Some(_) => Ok(vec![]), 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> { fn transaction_by_hash(&self, hash: RpcH256) -> BoxFuture<Option<Transaction>, Error> {
let hash = hash.into();
let eip86 = self.client.eip86_transition(); 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> { 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 api::*;
pub use chain::{SyncStatus, SyncState}; 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)] #[cfg(test)]
pub(crate) type Address = bigint::hash::H160; pub(crate) type Address = bigint::hash::H160;

View File

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

View File

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

View File

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

View File

@ -115,7 +115,7 @@ pub use session::SessionInfo;
pub use connection_filter::{ConnectionFilter, ConnectionDirection}; pub use connection_filter::{ConnectionFilter, ConnectionDirection};
pub use io::TimerToken; 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 ipnetwork::{IpNetwork, IpNetworkError};
use std::str::FromStr; use std::str::FromStr;

View File

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