From 8f6911af201439c9e52f607cfd63ab0df0be5d61 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Mon, 1 Apr 2019 17:04:50 +0200 Subject: [PATCH] 2.4.4 more beta backports (#10554) * fix(rpc-types): replace uint and hash with `ethereum_types v0.4` (#10217) * fix(rpc-types): remove uint and hash wrappers * fix(tests) * fix(cleanup) * grumbles(rpc-api): revert `verify_signature` * revert change of `U64` -> `u64` * fix(cleanup after bad merge) * chore(bump ethereum-types) * fix(bad merge) * feat(tests ethereum-types): add tests * chore(update `ethereum-types` to 0.4.2) * feat(tests for h256) * chore(rpc): remove `ethbloom` import Use re-export from `ethereum-types` instead * fix(bad merge): remove `DefaultAccount` type * doc(add TODO with issue link) * chore(bump ethereum-types) (#10396) Fixes a de-serialization bug in `ethereum-tyes` * fix(light eth_gasPrice): ask network if not in cache (#10535) * fix(light eth_gasPrice): ask N/W if not in cache * fix(bad rebase) * fix(light account response): update `tx_queue` (#10545) * fix(bump dependencies) (#10540) * cargo update -p log:0.4.5 * cargo update -p regex:1.0.5 * cargo update -p parking_lot * cargo update -p serde_derive * cargo update -p serde_json * cargo update -p serde * cargo update -p lazy_static * cargo update -p num_cpus * cargo update -p toml # Conflicts: # Cargo.lock * tx-pool: check transaction readiness before replacing (#10526) * Update to vanilla tx pool error * Prevent a non ready tx replacing a ready tx * Make tests compile * Test ready tx not replaced by future tx * Transaction indirection * Use StateReadiness to calculate Ready in `should_replace` * Test existing txs from same sender are used to compute Readiness * private-tx: Wire up ShouldReplace * Revert "Use StateReadiness to calculate Ready in `should_replace`" This reverts commit af9e69c8 * Make replace generic so it works with private-tx * Rename Replace and add missing docs * ShouldReplace no longer mutable * tx-pool: update to transaction-pool 2.0 from crates.io * tx-pool: generic error type alias * Exit early for first unmatching nonce * Fix private-tx test, use existing write lock * Use read lock for pool scoring * fix #10390 (#10391) * private-tx: replace error_chain (#10510) * Update to vanilla tx pool error * private-tx: remove error-chain, implement Error, derive Display * private-tx: replace ErrorKind and bail! * private-tx: add missing From impls and other compiler errors * private-tx: use original tx-pool error * Don't be silly cargo --- Cargo.lock | 637 +++++++++--------- cli-signer/Cargo.toml | 1 + cli-signer/rpc-client/Cargo.toml | 1 + cli-signer/rpc-client/src/lib.rs | 1 + cli-signer/rpc-client/src/signer_client.rs | 3 +- cli-signer/src/lib.rs | 4 +- ethcore/private-tx/Cargo.toml | 4 +- ethcore/private-tx/src/encryptor.rs | 26 +- ethcore/private-tx/src/error.rs | 288 ++++---- ethcore/private-tx/src/lib.rs | 55 +- .../private-tx/src/private_transactions.rs | 15 +- ethcore/service/src/error.rs | 5 +- miner/Cargo.toml | 2 +- miner/src/pool/listener.rs | 2 +- miner/src/pool/local_transactions.rs | 2 +- miner/src/pool/mod.rs | 3 +- miner/src/pool/queue.rs | 26 +- miner/src/pool/replace.rs | 415 ++++++++++++ miner/src/pool/scoring.rs | 171 ----- rpc/Cargo.toml | 2 +- rpc/src/v1/helpers/dispatch/mod.rs | 4 +- .../helpers/external_signer/signing_queue.rs | 1 + rpc/src/v1/helpers/light_fetch.rs | 65 +- rpc/src/v1/helpers/secretstore.rs | 3 +- rpc/src/v1/helpers/signature.rs | 7 +- rpc/src/v1/helpers/subscribers.rs | 5 +- rpc/src/v1/helpers/work.rs | 6 +- rpc/src/v1/impls/eth.rs | 83 +-- rpc/src/v1/impls/eth_filter.rs | 12 +- rpc/src/v1/impls/light/eth.rs | 87 ++- rpc/src/v1/impls/light/parity.rs | 3 +- rpc/src/v1/impls/light/parity_set.rs | 5 +- rpc/src/v1/impls/light/trace.rs | 4 +- rpc/src/v1/impls/parity.rs | 4 +- rpc/src/v1/impls/parity_accounts.rs | 71 +- rpc/src/v1/impls/parity_set.rs | 5 +- rpc/src/v1/impls/personal.rs | 36 +- rpc/src/v1/impls/private.rs | 4 +- rpc/src/v1/impls/secretstore.rs | 7 +- rpc/src/v1/impls/signer.rs | 3 +- rpc/src/v1/impls/signing.rs | 23 +- rpc/src/v1/impls/signing_unsafe.rs | 21 +- rpc/src/v1/impls/traces.rs | 4 +- rpc/src/v1/impls/web3.rs | 3 +- rpc/src/v1/mod.rs | 2 +- rpc/src/v1/tests/eth.rs | 5 +- rpc/src/v1/tests/mocked/personal.rs | 8 +- rpc/src/v1/tests/mocked/secretstore.rs | 3 +- rpc/src/v1/tests/mocked/signer.rs | 6 +- rpc/src/v1/tests/mocked/signing_unsafe.rs | 2 +- rpc/src/v1/traits/eth.rs | 4 +- rpc/src/v1/traits/eth_signing.rs | 3 +- rpc/src/v1/traits/parity.rs | 3 +- rpc/src/v1/traits/parity_accounts.rs | 3 +- rpc/src/v1/traits/parity_set.rs | 3 +- rpc/src/v1/traits/parity_signing.rs | 3 +- rpc/src/v1/traits/personal.rs | 4 +- rpc/src/v1/traits/private.rs | 3 +- rpc/src/v1/traits/secretstore.rs | 5 +- rpc/src/v1/traits/signer.rs | 4 +- rpc/src/v1/traits/traces.rs | 4 +- rpc/src/v1/traits/web3.rs | 3 +- rpc/src/v1/types/account_info.rs | 4 +- rpc/src/v1/types/block.rs | 19 +- rpc/src/v1/types/call_request.rs | 5 +- rpc/src/v1/types/confirmations.rs | 6 +- rpc/src/v1/types/consensus_status.rs | 2 +- rpc/src/v1/types/derivation.rs | 3 +- rpc/src/v1/types/eip191.rs | 4 +- rpc/src/v1/types/eth_types.rs | 84 +++ rpc/src/v1/types/filter.rs | 3 +- rpc/src/v1/types/hash.rs | 165 ----- rpc/src/v1/types/histogram.rs | 2 +- rpc/src/v1/types/log.rs | 6 +- rpc/src/v1/types/mod.rs | 7 +- rpc/src/v1/types/private_receipt.rs | 3 +- rpc/src/v1/types/provenance.rs | 2 +- rpc/src/v1/types/pubsub.rs | 3 +- rpc/src/v1/types/receipt.rs | 3 +- rpc/src/v1/types/secretstore.rs | 5 +- rpc/src/v1/types/sync.rs | 3 +- rpc/src/v1/types/trace.rs | 8 +- rpc/src/v1/types/trace_filter.rs | 3 +- rpc/src/v1/types/transaction.rs | 3 +- rpc/src/v1/types/transaction_request.rs | 6 +- rpc/src/v1/types/uint.rs | 172 ----- rpc/src/v1/types/work.rs | 2 +- 87 files changed, 1367 insertions(+), 1353 deletions(-) create mode 100644 miner/src/pool/replace.rs create mode 100644 rpc/src/v1/types/eth_types.rs delete mode 100644 rpc/src/v1/types/hash.rs delete mode 100644 rpc/src/v1/types/uint.rs diff --git a/Cargo.lock b/Cargo.lock index 25db4ae0e..9f6136d21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,7 +115,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -161,7 +161,7 @@ version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -220,7 +220,7 @@ name = "chainspec" version = "0.1.0" dependencies = [ "ethjson 0.1.0", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -261,6 +261,7 @@ dependencies = [ name = "cli-signer" version = "1.4.0" dependencies = [ + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.12.0", "parity-rpc-client 1.4.0", @@ -299,7 +300,7 @@ dependencies = [ name = "common-types" version = "0.1.0" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -327,10 +328,10 @@ dependencies = [ "handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", "itertools-num 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "simplelog 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -352,7 +353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -415,7 +416,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -429,7 +430,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -442,7 +443,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -484,7 +485,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "csv-core 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -513,6 +514,17 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "derive_more" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "difference" version = "1.0.0" @@ -531,7 +543,7 @@ name = "dir" version = "0.1.2" dependencies = [ "app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", ] @@ -541,10 +553,10 @@ name = "docopt" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -558,18 +570,18 @@ name = "eip-712" version = "0.1.0" dependencies = [ "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lunarity-lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "toolshed 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "validator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "validator_derive 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -603,8 +615,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -633,11 +645,11 @@ version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -665,14 +677,14 @@ dependencies = [ "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -682,9 +694,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types-serialize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -713,7 +725,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-stratum 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "evm 0.1.0", @@ -727,21 +739,21 @@ dependencies = [ "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "len-caching-lock 0.1.1", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "memory-cache 0.1.0", "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-machine 0.1.0", "parity-runtime 0.1.0", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -749,8 +761,8 @@ dependencies = [ "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "time-utils 0.1.0", @@ -769,16 +781,16 @@ name = "ethcore-accounts" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-hardware-wallet 0.0.1", "hardware-wallet 1.12.0", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -791,16 +803,16 @@ dependencies = [ "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-db 0.1.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_compress 0.1.0", @@ -821,7 +833,7 @@ name = "ethcore-call-contract" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -830,10 +842,10 @@ name = "ethcore-db" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", ] @@ -845,10 +857,10 @@ dependencies = [ "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -867,7 +879,7 @@ dependencies = [ "ethcore-db 0.1.0", "ethcore-io 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "failsafe 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastmap 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", @@ -879,17 +891,17 @@ dependencies = [ "keccak-hasher 0.1.1", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -906,10 +918,10 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -926,7 +938,7 @@ dependencies = [ "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethcore-call-contract 0.1.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "fetch 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", @@ -934,14 +946,14 @@ dependencies = [ "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "price-info 1.12.0", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "transaction-pool 1.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -952,17 +964,17 @@ dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-io 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -976,27 +988,27 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-io 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "igd 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1007,8 +1019,8 @@ name = "ethcore-private-tx" version = "1.0.0" dependencies = [ "common-types 0.1.0", + "derive_more 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1016,27 +1028,27 @@ dependencies = [ "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "fetch 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "transaction-pool 1.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1055,23 +1067,23 @@ dependencies = [ "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1092,10 +1104,10 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1105,12 +1117,12 @@ name = "ethcore-stratum" version = "1.12.0" dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1128,7 +1140,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", "ethcore-private-tx 1.0.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fastmap 0.1.0", @@ -1138,10 +1150,10 @@ dependencies = [ "keccak-hasher 0.1.1", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1151,34 +1163,34 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types-serialize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethereum-types-serialize" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethjson" version = "0.1.0" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1188,17 +1200,17 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memzero 0.1.0", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1212,8 +1224,8 @@ dependencies = [ "panic_hook 0.1.0", "parity-wordlist 1.2.1 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1222,21 +1234,21 @@ name = "ethstore" version = "0.2.1" dependencies = [ "dir 0.1.2", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1251,12 +1263,12 @@ dependencies = [ "docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethstore 0.2.1", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1266,14 +1278,14 @@ version = "0.1.0" dependencies = [ "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", ] @@ -1286,16 +1298,16 @@ dependencies = [ "docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (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.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", ] @@ -1343,7 +1355,7 @@ dependencies = [ name = "fake-hardware-wallet" version = "0.0.1" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", ] @@ -1356,7 +1368,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fastmap" version = "0.1.0" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1377,7 +1389,7 @@ dependencies = [ "http 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1408,7 +1420,7 @@ name = "fs-swap" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1444,7 +1456,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1483,9 +1495,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1499,7 +1511,7 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1515,26 +1527,26 @@ name = "handlebars" version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "pest_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hardware-wallet" version = "1.12.0" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)", "libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1621,7 +1633,7 @@ dependencies = [ "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1647,7 +1659,7 @@ dependencies = [ "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1795,7 +1807,7 @@ dependencies = [ "combine 3.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "jni-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1809,7 +1821,7 @@ name = "journaldb" version = "0.2.0" dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "fastmap 0.1.0", "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1817,10 +1829,10 @@ dependencies = [ "keccak-hasher 0.1.1", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1830,10 +1842,10 @@ version = "10.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1854,7 +1866,7 @@ dependencies = [ "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-server-utils 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1866,9 +1878,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-server-utils 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-tokio-ipc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1878,9 +1890,9 @@ version = "10.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1891,9 +1903,9 @@ dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1906,8 +1918,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-server-utils 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1919,9 +1931,9 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-server-utils 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-ws 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1930,7 +1942,7 @@ name = "keccak-hash" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1938,7 +1950,7 @@ dependencies = [ name = "keccak-hasher" version = "0.1.1" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1981,7 +1993,7 @@ dependencies = [ "interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rocksdb 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1994,7 +2006,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2006,7 +2018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "len-caching-lock" version = "0.1.1" dependencies = [ - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2076,12 +2088,12 @@ name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2168,7 +2180,7 @@ version = "0.1.0" dependencies = [ "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2203,7 +2215,7 @@ dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2216,7 +2228,7 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2226,7 +2238,7 @@ name = "mio-named-pipes" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2306,11 +2318,11 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2337,7 +2349,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2373,7 +2385,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num_cpus" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2466,7 +2478,7 @@ dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2497,7 +2509,7 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-service 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-fetch 0.0.1", @@ -2509,11 +2521,11 @@ dependencies = [ "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "migration-rocksdb 0.1.0", "node-filter 1.12.0", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2527,22 +2539,22 @@ dependencies = [ "parity-updater 1.12.0", "parity-version 2.4.4", "parity-whisper 0.1.0", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "registrar 0.0.1", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2553,17 +2565,17 @@ dependencies = [ "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "fake-fetch 0.0.1", "fetch 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "registrar 0.0.1", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2575,7 +2587,7 @@ version = "1.12.0" dependencies = [ "cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2593,18 +2605,18 @@ dependencies = [ "ethkey 0.3.0", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-machine" version = "0.1.0" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2651,7 +2663,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.1", @@ -2668,7 +2680,7 @@ dependencies = [ "jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2677,20 +2689,20 @@ dependencies = [ "parity-runtime 0.1.0", "parity-updater 1.12.0", "parity-version 2.4.4", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "transaction-pool 1.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", @@ -2700,16 +2712,17 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.12.0", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2746,7 +2759,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2766,16 +2779,16 @@ dependencies = [ "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-hash-fetch 1.12.0", "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-version 2.4.4", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2790,7 +2803,7 @@ dependencies = [ "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2809,22 +2822,22 @@ dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-network 1.12.0", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-derive 10.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memzero 0.1.0", "ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "time-utils 0.1.0", @@ -2837,7 +2850,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2849,7 +2862,7 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2869,7 +2882,7 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2908,7 +2921,7 @@ name = "patricia-trie-ethereum" version = "0.1.0" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3006,10 +3019,10 @@ dependencies = [ "fake-fetch 0.0.1", "fetch 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", - "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3081,12 +3094,12 @@ version = "0.1.0" dependencies = [ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", "wasm 0.1.0", ] @@ -3097,7 +3110,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3240,9 +3253,9 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3272,7 +3285,7 @@ dependencies = [ [[package]] name = "regex" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3331,7 +3344,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3343,7 +3356,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3353,7 +3366,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3362,7 +3375,7 @@ name = "rlp_compress" version = "0.1.0" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3438,7 +3451,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", "sct 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3488,7 +3501,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3498,12 +3511,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.80" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.80" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3513,12 +3526,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.32" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3557,7 +3570,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3623,7 +3636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "stats" version = "0.1.0" dependencies = [ - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3762,7 +3775,7 @@ name = "thread_local" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3770,7 +3783,7 @@ name = "threadpool" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3842,7 +3855,7 @@ dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3886,7 +3899,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3908,10 +3921,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3969,8 +3982,8 @@ dependencies = [ "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4002,7 +4015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4018,7 +4031,7 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4027,10 +4040,10 @@ dependencies = [ [[package]] name = "toml" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4046,16 +4059,15 @@ name = "trace-time" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "transaction-pool" -version = "1.13.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4080,7 +4092,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4089,7 +4101,7 @@ name = "trie-standardmap" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4108,7 +4120,7 @@ dependencies = [ name = "triehash-ethereum" version = "0.2.0" dependencies = [ - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", "triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4235,11 +4247,11 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4249,10 +4261,10 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", "validator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4281,10 +4293,10 @@ name = "vm" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4312,7 +4324,7 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4322,7 +4334,7 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4332,9 +4344,9 @@ version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", @@ -4381,11 +4393,11 @@ dependencies = [ "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", "parity-whisper 0.1.0", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4520,6 +4532,7 @@ dependencies = [ "checksum csv-core 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4dd8e6d86f7ba48b4276ef1317edc8cc36167546d8972feb4a2b5fec0b374105" "checksum ct-logs 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b4660f8b07a560a88c02d76286edb9f0d5d64e495d2b0f233186155aa51be1f" "checksum ctrlc 1.1.1 (git+https://github.com/paritytech/rust-ctrlc.git)" = "" +"checksum derive_more 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fbe9f11be34f800b3ecaaed0ec9ec2e015d1d0ba0c8644c1310f73d6e8994615" "checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" "checksum docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db2906c2579b5b7207fc1e328796a9a8835dc44e22dbe8e460b1d636f9a7b225" @@ -4534,8 +4547,8 @@ dependencies = [ "checksum ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "795e25fd868e12a59ca235dbe1f6cc8f1eba8f67d6a39438b29535e0126e0c27" "checksum ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "66a587250c8190be9d6ae28d67b8957ed97cb9eee2e272173a20593ab054a075" "checksum ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a93a43ce2e9f09071449da36bfa7a1b20b950ee344b6904ff23de493b03b386" -"checksum ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "35b3c5a18bc5e73a32a110ac743ec04b02bbbcd3b71d3118d40a6113d509378a" -"checksum ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ac59a21a9ce98e188f3dace9eb67a6c4a3c67ec7fbc7218cb827852679dc002" +"checksum ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e742184dc63a01c8ea0637369f8faa27c40f537949908a237f95c05e68d2c96" +"checksum ethereum-types-serialize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1873d77b32bc1891a79dad925f2acbc318ee942b38b9110f9dbc5fbeffcea350" "checksum failsafe 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad3bf1642583ea2f1fa38a1e8546613a7488816941b33e5f0fccceac61879118" "checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7" "checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596" @@ -4600,7 +4613,7 @@ dependencies = [ "checksum kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45bcdf5eb083602cff61a6f8438dce2a7900d714e893fc48781c39fb119d37aa" "checksum kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "06cf755dc587839ba34d3cbe3f12b6ad55850fbcdfe67336157a021a1a5c43ae" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" +"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" "checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)" = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" @@ -4611,7 +4624,7 @@ dependencies = [ "checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66" "checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" +"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21" "checksum lunarity-lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a1670671f305792567116d4660e6e5bd785d6fa973e817c3445c0a7a54cecb6" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" @@ -4639,7 +4652,7 @@ dependencies = [ "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" -"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" +"checksum num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a23f0ed30a54abaa0c7e83b1d2d87ada7c3c23078d1d87815af3e3b6385fbba" "checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee" "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" "checksum order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efa535d5117d3661134dbf1719b6f0ffe06f2375843b13935db186cd094105eb" @@ -4659,7 +4672,7 @@ dependencies = [ "checksum parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf13102febd98f4ad416a526b42deb82daf482626ba6ab10d0ebf8f45327514c" "checksum parity-ws 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2fec5048fba72a2e01baeb0d08089db79aead4b57e2443df172fb1840075a233" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" -"checksum parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9723236a9525c757d9725b993511e3fc941e33f27751942232f0058298297edf" +"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" "checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" @@ -4700,7 +4713,7 @@ dependencies = [ "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341" +"checksum regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53ee8cfdddb2e0291adfb9f13d31d3bbe0a03c9a402c01b1e24188d86c35b24f" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" @@ -4725,9 +4738,9 @@ dependencies = [ "checksum sct 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f5adf8fbd58e1b1b52699dc8bed2630faecb6d8c7bee77d009d6bbe4af569b9" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" -"checksum serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "225de307c6302bec3898c51ca302fc94a7a1697ef0845fcee6448f33c032249c" -"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" +"checksum serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)" = "92514fb95f900c9b5126e32d020f5c6d40564c27a5ea6d1d7d9f157a96623560" +"checksum serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6eabf4b5914e88e24eea240bb7c9f9a2cbc1bbbe8d961d381975ec3c6b806c" +"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d" "checksum sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "171698ce4ec7cbb93babeb3190021b4d72e96ccb98e33d277ae4ea959d6f2d9e" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" @@ -4781,10 +4794,10 @@ dependencies = [ "checksum tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3a52f00c97fedb6d535d27f65cccb7181c8dd4c6edc3eda9ea93f6d45d05168e" "checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" "checksum tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22e3aa6d1fcc19e635418dc0a30ab5bd65d347973d6f43f1a37bf8d9d1335fc9" -"checksum toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4a2ecc31b0351ea18b3fe11274b8db6e4d82bce861bbb22e6dbed40417902c65" +"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" "checksum toolshed 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "450441e131c7663af72e63a33c02a6a1fbaaa8601dc652ed6757813bb55aeec7" "checksum trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe82f2f0bf1991e163e757baf044282823155dd326e70f44ce2186c3c320cc9" -"checksum transaction-pool 1.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e5866e5126b14358f1d7af4bf51a0be677a363799b90e655edcec8254edef1d2" +"checksum transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d8bd3123931aa6e49dd03bc8a2400490e14701d779458d1f1fff1f04c6f666" "checksum transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb4b191d033a35edfce392a38cdcf9790b6cebcb30fa690c312c29da4dc433e" "checksum trezor-sys 1.0.0 (git+https://github.com/paritytech/trezor-sys)" = "" "checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index f4fa86d94..11dd06107 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -7,6 +7,7 @@ name = "cli-signer" version = "1.4.0" [dependencies] +ethereum-types = "0.4" futures = "0.1" rpassword = "1.0" parity-rpc = { path = "../rpc" } diff --git a/cli-signer/rpc-client/Cargo.toml b/cli-signer/rpc-client/Cargo.toml index e7eb35461..53ec98339 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -7,6 +7,7 @@ name = "parity-rpc-client" version = "1.4.0" [dependencies] +ethereum-types = "0.4" futures = "0.1" log = "0.4" serde = "1.0" diff --git a/cli-signer/rpc-client/src/lib.rs b/cli-signer/rpc-client/src/lib.rs index df7936eae..d0e087e59 100644 --- a/cli-signer/rpc-client/src/lib.rs +++ b/cli-signer/rpc-client/src/lib.rs @@ -17,6 +17,7 @@ pub mod client; pub mod signer_client; +extern crate ethereum_types; extern crate futures; extern crate jsonrpc_core; extern crate jsonrpc_ws_server as ws; diff --git a/cli-signer/rpc-client/src/signer_client.rs b/cli-signer/rpc-client/src/signer_client.rs index 339f43b6e..997841936 100644 --- a/cli-signer/rpc-client/src/signer_client.rs +++ b/cli-signer/rpc-client/src/signer_client.rs @@ -15,7 +15,8 @@ // along with Parity Ethereum. If not, see . use client::{Rpc, RpcError}; -use rpc::signer::{ConfirmationRequest, TransactionModification, U256, TransactionCondition}; +use ethereum_types::U256; +use rpc::signer::{ConfirmationRequest, TransactionModification, TransactionCondition}; use serde; use serde_json::{Value as JsonValue, to_value}; use std::path::PathBuf; diff --git a/cli-signer/src/lib.rs b/cli-signer/src/lib.rs index f09d4403a..3ef6e7054 100644 --- a/cli-signer/src/lib.rs +++ b/cli-signer/src/lib.rs @@ -14,13 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +extern crate ethereum_types; extern crate futures; extern crate rpassword; extern crate parity_rpc as rpc; extern crate parity_rpc_client as client; -use rpc::signer::{U256, ConfirmationRequest}; +use ethereum_types::U256; +use rpc::signer::ConfirmationRequest; use client::signer_client::SignerRpc; use std::io::{Write, BufRead, BufReader, stdout, stdin}; use std::path::PathBuf; diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index fdf6e52ba..2ce127a8b 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../types" } -error-chain = { version = "0.12", default-features = false } +derive_more = "0.14.0" ethabi = "6.0" ethabi-contract = "6.0" ethabi-derive = "6.0" @@ -36,7 +36,7 @@ serde = "1.0" serde_derive = "1.0" serde_json = "1.0" tiny-keccak = "1.4" -transaction-pool = "1.13.2" +transaction-pool = "2.0" url = "1" [dev-dependencies] diff --git a/ethcore/private-tx/src/encryptor.rs b/ethcore/private-tx/src/encryptor.rs index 2d284dd38..597cc8879 100644 --- a/ethcore/private-tx/src/encryptor.rs +++ b/ethcore/private-tx/src/encryptor.rs @@ -31,7 +31,7 @@ use crypto; use futures::Future; use fetch::{Fetch, Client as FetchClient, Method, BodyReader, Request}; use bytes::{Bytes, ToPretty}; -use error::{Error, ErrorKind}; +use error::Error; use url::Url; use super::Signer; use super::key_server_keys::address_to_key; @@ -111,11 +111,11 @@ impl SecretStoreEncryptor { return Ok(key); } let contract_address_signature = self.sign_contract_address(contract_address)?; - let requester = self.config.key_server_account.ok_or_else(|| ErrorKind::KeyServerAccountNotSet)?; + let requester = self.config.key_server_account.ok_or_else(|| Error::KeyServerAccountNotSet)?; // key id in SS is H256 && we have H160 here => expand with assitional zeros let contract_address_extended: H256 = contract_address.into(); - let base_url = self.config.base_url.clone().ok_or_else(|| ErrorKind::KeyServerNotSet)?; + let base_url = self.config.base_url.clone().ok_or_else(|| Error::KeyServerNotSet)?; // prepare request url let url = format!("{}/{}/{}{}", @@ -132,16 +132,16 @@ impl SecretStoreEncryptor { Method::GET }; - let url = Url::from_str(&url).map_err(|e| ErrorKind::Encrypt(e.to_string()))?; + let url = Url::from_str(&url).map_err(|e| Error::Encrypt(e.to_string()))?; let response = self.client.fetch(Request::new(url, method), Default::default()).wait() - .map_err(|e| ErrorKind::Encrypt(e.to_string()))?; + .map_err(|e| Error::Encrypt(e.to_string()))?; if response.is_not_found() { - bail!(ErrorKind::EncryptionKeyNotFound(*contract_address)); + return Err(Error::EncryptionKeyNotFound(*contract_address)); } if !response.is_success() { - bail!(ErrorKind::Encrypt(response.status().canonical_reason().unwrap_or("unknown").into())); + return Err(Error::Encrypt(response.status().canonical_reason().unwrap_or("unknown").into())); } // read HTTP response @@ -149,7 +149,7 @@ impl SecretStoreEncryptor { BodyReader::new(response).read_to_string(&mut result)?; // response is JSON string (which is, in turn, hex-encoded, encrypted Public) - let encrypted_bytes: ethjson::bytes::Bytes = result.trim_matches('\"').parse().map_err(|e| ErrorKind::Encrypt(e))?; + let encrypted_bytes: ethjson::bytes::Bytes = result.trim_matches('\"').parse().map_err(|e| Error::Encrypt(e))?; // decrypt Public let decrypted_bytes = self.signer.decrypt(requester, &crypto::DEFAULT_MAC, &encrypted_bytes)?; @@ -189,7 +189,7 @@ impl SecretStoreEncryptor { } fn sign_contract_address(&self, contract_address: &Address) -> Result { - let key_server_account = self.config.key_server_account.ok_or_else(|| ErrorKind::KeyServerAccountNotSet)?; + let key_server_account = self.config.key_server_account.ok_or_else(|| Error::KeyServerAccountNotSet)?; Ok(self.signer.sign(key_server_account, address_to_key(contract_address))?) } } @@ -204,7 +204,7 @@ impl Encryptor for SecretStoreEncryptor { // retrieve the key, try to generate it if it doesn't exist yet let key = match self.retrieve_key("", false, contract_address) { Ok(key) => Ok(key), - Err(Error(ErrorKind::EncryptionKeyNotFound(_), _)) => { + Err(Error::EncryptionKeyNotFound(_)) => { trace!(target: "privatetx", "Key for account wasnt found in sstore. Creating. Address: {:?}", contract_address); self.retrieve_key(&format!("/{}", self.config.threshold), true, contract_address) } @@ -215,7 +215,7 @@ impl Encryptor for SecretStoreEncryptor { let mut cypher = Vec::with_capacity(plain_data.len() + initialisation_vector.len()); cypher.extend(repeat(0).take(plain_data.len())); crypto::aes::encrypt_128_ctr(&key, initialisation_vector, plain_data, &mut cypher) - .map_err(|e| ErrorKind::Encrypt(e.to_string()))?; + .map_err(|e| Error::Encrypt(e.to_string()))?; cypher.extend_from_slice(&initialisation_vector); Ok(cypher) @@ -230,7 +230,7 @@ impl Encryptor for SecretStoreEncryptor { // initialization vector takes INIT_VEC_LEN bytes let cypher_len = cypher.len(); if cypher_len < INIT_VEC_LEN { - bail!(ErrorKind::Decrypt("Invalid cypher".into())); + return Err(Error::Decrypt("Invalid cypher".into())); } // retrieve existing key @@ -241,7 +241,7 @@ impl Encryptor for SecretStoreEncryptor { let mut plain_data = Vec::with_capacity(cypher_len - INIT_VEC_LEN); plain_data.extend(repeat(0).take(cypher_len - INIT_VEC_LEN)); crypto::aes::decrypt_128_ctr(&key, &iv, cypher, &mut plain_data) - .map_err(|e| ErrorKind::Decrypt(e.to_string()))?; + .map_err(|e| Error::Decrypt(e.to_string()))?; Ok(plain_data) } } diff --git a/ethcore/private-tx/src/error.rs b/ethcore/private-tx/src/error.rs index b3465883f..eda08b2a5 100644 --- a/ethcore/private-tx/src/error.rs +++ b/ethcore/private-tx/src/error.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +use std::error; +use derive_more::Display; use ethereum_types::Address; use rlp::DecoderError; use ethtrie::TrieError; @@ -21,173 +23,173 @@ use ethcore::error::{Error as EthcoreError, ExecutionError}; use types::transaction::Error as TransactionError; use ethkey::Error as KeyError; use ethkey::crypto::Error as CryptoError; -use txpool::Error as TxPoolError; +use txpool::VerifiedTransaction; +use private_transactions::VerifiedPrivateTransaction; -error_chain! { - foreign_links { - Io(::std::io::Error) #[doc = "Error concerning the Rust standard library's IO subsystem."]; - Decoder(DecoderError) #[doc = "RLP decoding error."]; - Trie(TrieError) #[doc = "Error concerning TrieDBs."]; - Txpool(TxPoolError) #[doc = "Tx pool error."]; - Crypto(CryptoError) #[doc = "Crypto error."]; +type TxPoolError = txpool::Error<::Hash>; + +#[derive(Debug, Display)] +pub enum Error { + /// Error concerning the Rust standard library's IO subsystem. + #[display(fmt = "Io Error: {}", _0)] + Io(::std::io::Error), + /// RLP decoding error. + #[display(fmt = "Decoder Error: {}", _0)] + Decoder(DecoderError), + /// Error concerning TrieDBs. + #[display(fmt = "Trie Error: {}", _0)] + Trie(TrieError), + /// Transaction pool error. + #[display(fmt = "Transaction Pool Error: {}", _0)] + TxPool(TxPoolError), + /// Crypto error. + #[display(fmt = "Crypto Error {}", _0)] + Crypto(CryptoError), + /// Encryption error. + #[display(fmt = "Encryption error. ({})", _0)] + Encrypt(String), + /// Decryption error. + #[display(fmt = "Decryption error. ({})", _0)] + Decrypt(String), + /// Address not authorized. + #[display(fmt = "Private transaction execution is not authorised for {}", _0)] + NotAuthorised(Address), + /// Transaction creates more than one contract. + #[display(fmt = "Private transaction created too many contracts")] + TooManyContracts, + /// Contract call error. + #[display(fmt = "Contract call error. ({})", _0)] + Call(String), + /// State is not available. + #[display(fmt = "State is not available")] + StatePruned, + /// State is incorrect. + #[display(fmt = "State is incorrect")] + StateIncorrect, + /// Wrong private transaction type. + #[display(fmt = "Wrong private transaction type")] + BadTransactionType, + /// Contract does not exist or was not created. + #[display(fmt = "Contract does not exist or was not created")] + ContractDoesNotExist, + /// Reference to the client is corrupted. + #[display(fmt = "Reference to the client is corrupted")] + ClientIsMalformed, + /// Queue of private transactions for verification is full. + #[display(fmt = "Queue of private transactions for verification is full")] + QueueIsFull, + /// The transaction already exists in queue of private transactions. + #[display(fmt = "The transaction already exists in queue of private transactions.")] + PrivateTransactionAlreadyImported, + /// The information about private transaction is not found in the store. + #[display(fmt = "The information about private transaction is not found in the store.")] + PrivateTransactionNotFound, + /// Account for signing public transactions not set. + #[display(fmt = "Account for signing public transactions not set.")] + SignerAccountNotSet, + /// Account for validating private transactions not set. + #[display(fmt = "Account for validating private transactions not set.")] + ValidatorAccountNotSet, + /// Account for signing requests to key server not set. + #[display(fmt = "Account for signing requests to key server not set.")] + KeyServerAccountNotSet, + /// Encryption key is not found on key server. + #[display(fmt = "Encryption key is not found on key server for {}", _0)] + EncryptionKeyNotFound(Address), + /// Key server URL is not set. + #[display(fmt = "Key server URL is not set.")] + KeyServerNotSet, + /// VM execution error. + #[display(fmt = "VM execution error {}", _0)] + Execution(ExecutionError), + /// General signing error. + #[display(fmt = "General signing error {}", _0)] + Key(KeyError), + /// Error of transactions processing. + #[display(fmt = "Error of transactions processing {}", _0)] + Transaction(TransactionError), + /// General ethcore error. + #[display(fmt = "General ethcore error {}", _0)] + Ethcore(EthcoreError), + /// A convenient variant for String. + #[display(fmt = "{}", _0)] + Msg(String), +} + +impl error::Error for Error { + fn source(&self) -> Option<&(error::Error + 'static)> { + match self { + Error::Io(e) => Some(e), + Error::Decoder(e) => Some(e), + Error::Trie(e) => Some(e), + Error::TxPool(e) => Some(e), + Error::Crypto(e) => Some(e), + Error::Execution(e) => Some(e), + Error::Key(e) => Some(e), + Error::Transaction(e) => Some(e), + Error::Ethcore(e) => Some(e), + _ => None, + } } +} - errors { - #[doc = "Encryption error."] - Encrypt(err: String) { - description("Encryption error"), - display("Encryption error. ({})", err), - } +impl From for Error { + fn from(s: String) -> Self { + Error::Msg(s) + } +} - #[doc = "Decryption error."] - Decrypt(err: String) { - description("Decryption error"), - display("Decryption error. ({})", err), - } - - #[doc = "Address not authorized."] - NotAuthorised(address: Address) { - description("Address not authorized"), - display("Private transaction execution is not authorised for {}", address), - } - - #[doc = "Transaction creates more than one contract."] - TooManyContracts { - description("Transaction creates more than one contract."), - display("Private transaction created too many contracts"), - } - - #[doc = "Contract call error."] - Call(err: String) { - description("Contract call error."), - display("Contract call error. ({})", err), - } - - #[doc = "State is not available."] - StatePruned { - description("State is not available."), - display("State is not available"), - } - - #[doc = "State is incorrect."] - StateIncorrect { - description("State is incorrect."), - display("State is incorrect"), - } - - #[doc = "Wrong private transaction type."] - BadTransactionType { - description("Wrong private transaction type."), - display("Wrong private transaction type"), - } - - #[doc = "Contract does not exist or was not created."] - ContractDoesNotExist { - description("Contract does not exist or was not created."), - display("Contract does not exist or was not created"), - } - - #[doc = "Reference to the client is corrupted."] - ClientIsMalformed { - description("Reference to the client is corrupted."), - display("Reference to the client is corrupted"), - } - - #[doc = "Queue of private transactions for verification is full."] - QueueIsFull { - description("Queue of private transactions for verification is full."), - display("Queue of private transactions for verification is full"), - } - - #[doc = "The transaction already exists in queue of private transactions."] - PrivateTransactionAlreadyImported { - description("The transaction already exists in queue of private transactions."), - display("The transaction already exists in queue of private transactions."), - } - - #[doc = "The information about private transaction is not found in the store."] - PrivateTransactionNotFound { - description("The information about private transaction is not found in the store."), - display("The information about private transaction is not found in the store."), - } - - #[doc = "Account for signing public transactions not set."] - SignerAccountNotSet { - description("Account for signing public transactions not set."), - display("Account for signing public transactions not set."), - } - - #[doc = "Account for validating private transactions not set."] - ValidatorAccountNotSet { - description("Account for validating private transactions not set."), - display("Account for validating private transactions not set."), - } - - #[doc = "Account for signing requests to key server not set."] - KeyServerAccountNotSet { - description("Account for signing requests to key server not set."), - display("Account for signing requests to key server not set."), - } - - #[doc = "Encryption key is not found on key server."] - EncryptionKeyNotFound(address: Address) { - description("Encryption key is not found on key server"), - display("Encryption key is not found on key server for {}", address), - } - - #[doc = "Key server URL is not set."] - KeyServerNotSet { - description("Key server URL is not set."), - display("Key server URL is not set."), - } - - #[doc = "VM execution error."] - Execution(err: ExecutionError) { - description("VM execution error."), - display("VM execution error {}", err), - } - - #[doc = "General signing error."] - Key(err: KeyError) { - description("General signing error."), - display("General signing error {}", err), - } - - #[doc = "Error of transactions processing."] - Transaction(err: TransactionError) { - description("Error of transactions processing."), - display("Error of transactions processing {}", err), - } - - #[doc = "General ethcore error."] - Ethcore(err: EthcoreError) { - description("General ethcore error."), - display("General ethcore error {}", err), - } +impl From for Error { + fn from(err: std::io::Error) -> Self { + Error::Io(err).into() } } impl From for Error { fn from(err: KeyError) -> Self { - ErrorKind::Key(err).into() + Error::Key(err).into() + } +} + +impl From for Error { + fn from(err: CryptoError) -> Self { + Error::Crypto(err).into() + } +} + +impl From for Error { + fn from(err: DecoderError) -> Self { + Error::Decoder(err).into() } } impl From for Error { fn from(err: ExecutionError) -> Self { - ErrorKind::Execution(err).into() + Error::Execution(err).into() } } impl From for Error { fn from(err: TransactionError) -> Self { - ErrorKind::Transaction(err).into() + Error::Transaction(err).into() + } +} + +impl From for Error { + fn from(err: TrieError) -> Self { + Error::Trie(err).into() + } +} + +impl From for Error { + fn from(err: TxPoolError) -> Self { + Error::TxPool(err).into() } } impl From for Error { fn from(err: EthcoreError) -> Self { - ErrorKind::Ethcore(err).into() + Error::Ethcore(err).into() } } diff --git a/ethcore/private-tx/src/lib.rs b/ethcore/private-tx/src/lib.rs index 711bdc612..64381b497 100644 --- a/ethcore/private-tx/src/lib.rs +++ b/ethcore/private-tx/src/lib.rs @@ -54,8 +54,7 @@ extern crate log; extern crate ethabi_derive; #[macro_use] extern crate ethabi_contract; -#[macro_use] -extern crate error_chain; +extern crate derive_more; #[macro_use] extern crate rlp_derive; @@ -68,7 +67,7 @@ pub use encryptor::{Encryptor, SecretStoreEncryptor, EncryptorConfig, NoopEncryp pub use key_server_keys::{KeyProvider, SecretStoreKeys, StoringKeyProvider}; pub use private_transactions::{VerifiedPrivateTransaction, VerificationStore, PrivateTransactionSigningDesc, SigningStore}; pub use messages::{PrivateTransaction, SignedPrivateTransaction}; -pub use error::{Error, ErrorKind}; +pub use error::Error; use std::sync::{Arc, Weak}; use std::collections::{HashMap, HashSet, BTreeMap}; @@ -238,10 +237,10 @@ impl Provider { trace!(target: "privatetx", "Creating private transaction from regular transaction: {:?}", signed_transaction); if self.signer_account.is_none() { warn!(target: "privatetx", "Signing account not set"); - bail!(ErrorKind::SignerAccountNotSet); + return Err(Error::SignerAccountNotSet); } let tx_hash = signed_transaction.hash(); - let contract = Self::contract_address_from_transaction(&signed_transaction).map_err(|_| ErrorKind::BadTransactionType)?; + let contract = Self::contract_address_from_transaction(&signed_transaction).map_err(|_| Error::BadTransactionType)?; let data = signed_transaction.rlp_bytes(); let encrypted_transaction = self.encrypt(&contract, &Self::iv_from_transaction(&signed_transaction), &data)?; let private = PrivateTransaction::new(encrypted_transaction, contract); @@ -309,19 +308,19 @@ impl Provider { // TODO #9825 [ToDr] Usage of BlockId::Latest let contract_nonce = self.get_contract_nonce(&contract, BlockId::Latest); if let Err(e) = contract_nonce { - bail!("Cannot retrieve contract nonce: {:?}", e); + return Err(format!("Cannot retrieve contract nonce: {:?}", e).into()); } let contract_nonce = contract_nonce.expect("Error was checked before"); let private_state = self.execute_private_transaction(BlockId::Latest, &transaction.transaction); if let Err(e) = private_state { - bail!("Cannot retrieve private state: {:?}", e); + return Err(format!("Cannot retrieve private state: {:?}", e).into()); } let private_state = private_state.expect("Error was checked before"); let private_state_hash = self.calculate_state_hash(&private_state, contract_nonce); trace!(target: "privatetx", "Hashed effective private state for validator: {:?}", private_state_hash); let signed_state = self.accounts.sign(validator_account, private_state_hash); if let Err(e) = signed_state { - bail!("Cannot sign the state: {:?}", e); + return Err(format!("Cannot sign the state: {:?}", e).into()); } let signed_state = signed_state.expect("Error was checked before"); let signed_private_transaction = SignedPrivateTransaction::new(private_hash, signed_state, None); @@ -362,25 +361,27 @@ impl Provider { signatures.push(signed_tx.signature()); let rsv: Vec = signatures.into_iter().map(|sign| sign.into_electrum().into()).collect(); // Create public transaction + let signer_account = self.signer_account.ok_or_else(|| Error::SignerAccountNotSet)?; + let state = self.client.state_at(BlockId::Latest).ok_or(Error::StatePruned)?; + let nonce = state.nonce(&signer_account)?; let public_tx = self.public_transaction( desc.state.clone(), &desc.original_transaction, &rsv, - desc.original_transaction.nonce, + nonce, desc.original_transaction.gas_price )?; trace!(target: "privatetx", "Last required signature received, public transaction created: {:?}", public_tx); // Sign and add it to the queue let chain_id = desc.original_transaction.chain_id(); let hash = public_tx.hash(chain_id); - let signer_account = self.signer_account.ok_or_else(|| ErrorKind::SignerAccountNotSet)?; let signature = self.accounts.sign(signer_account, hash)?; let signed = SignedTransaction::new(public_tx.with_signature(signature, chain_id))?; match self.miner.import_own_transaction(&*self.client, signed.into()) { Ok(_) => trace!(target: "privatetx", "Public transaction added to queue"), Err(err) => { warn!(target: "privatetx", "Failed to add transaction to queue, error: {:?}", err); - bail!(err); + return Err(err.into()); } } // Notify about state changes @@ -395,7 +396,7 @@ impl Provider { // Remove from store for signing if let Err(err) = self.transactions_for_signing.write().remove(&private_hash) { warn!(target: "privatetx", "Failed to remove transaction from signing store, error: {:?}", err); - bail!(err); + return Err(err); } } else { // Add signature to the store @@ -403,7 +404,7 @@ impl Provider { Ok(_) => trace!(target: "privatetx", "Signature stored for private transaction"), Err(err) => { warn!(target: "privatetx", "Failed to add signature to signing store, error: {:?}", err); - bail!(err); + return Err(err); } } } @@ -415,7 +416,7 @@ impl Provider { Action::Call(contract) => Ok(contract), _ => { warn!(target: "privatetx", "Incorrect type of action for the transaction"); - bail!(ErrorKind::BadTransactionType); + return Err(Error::BadTransactionType); } } } @@ -434,13 +435,13 @@ impl Provider { } false => { warn!(target: "privatetx", "Sender's state doesn't correspond to validator's"); - bail!(ErrorKind::StateIncorrect); + return Err(Error::StateIncorrect); } } } Err(err) => { warn!(target: "privatetx", "Sender's state doesn't correspond to validator's, error {:?}", err); - bail!(err); + return Err(err.into()); } } } @@ -480,21 +481,21 @@ impl Provider { fn get_decrypted_state(&self, address: &Address, block: BlockId) -> Result { let (data, decoder) = private_contract::functions::state::call(); let value = self.client.call_contract(block, *address, data)?; - let state = decoder.decode(&value).map_err(|e| ErrorKind::Call(format!("Contract call failed {:?}", e)))?; + let state = decoder.decode(&value).map_err(|e| Error::Call(format!("Contract call failed {:?}", e)))?; self.decrypt(address, &state) } fn get_decrypted_code(&self, address: &Address, block: BlockId) -> Result { let (data, decoder) = private_contract::functions::code::call(); let value = self.client.call_contract(block, *address, data)?; - let state = decoder.decode(&value).map_err(|e| ErrorKind::Call(format!("Contract call failed {:?}", e)))?; + let state = decoder.decode(&value).map_err(|e| Error::Call(format!("Contract call failed {:?}", e)))?; self.decrypt(address, &state) } pub fn get_contract_nonce(&self, address: &Address, block: BlockId) -> Result { let (data, decoder) = private_contract::functions::nonce::call(); let value = self.client.call_contract(block, *address, data)?; - decoder.decode(&value).map_err(|e| ErrorKind::Call(format!("Contract call failed {:?}", e)).into()) + decoder.decode(&value).map_err(|e| Error::Call(format!("Contract call failed {:?}", e)).into()) } fn snapshot_to_storage(raw: Bytes) -> HashMap { @@ -531,10 +532,10 @@ impl Provider { T: Tracer, V: VMTracer, { - let mut env_info = self.client.env_info(block).ok_or(ErrorKind::StatePruned)?; + let mut env_info = self.client.env_info(block).ok_or(Error::StatePruned)?; env_info.gas_limit = transaction.gas; - let mut state = self.client.state_at(block).ok_or(ErrorKind::StatePruned)?; + let mut state = self.client.state_at(block).ok_or(Error::StatePruned)?; // TODO #9825 in case of BlockId::Latest these need to operate on the same state let contract_address = match transaction.action { Action::Call(ref contract_address) => { @@ -610,15 +611,15 @@ impl Provider { /// Create encrypted public contract deployment transaction. pub fn public_creation_transaction(&self, block: BlockId, source: &SignedTransaction, validators: &[Address], gas_price: U256) -> Result<(Transaction, Address), Error> { if let Action::Call(_) = source.action { - bail!(ErrorKind::BadTransactionType); + return Err(Error::BadTransactionType); } let sender = source.sender(); - let state = self.client.state_at(block).ok_or(ErrorKind::StatePruned)?; + let state = self.client.state_at(block).ok_or(Error::StatePruned)?; let nonce = state.nonce(&sender)?; let executed = self.execute_private(source, TransactOptions::with_no_tracing(), block)?; let header = self.client.block_header(block) - .ok_or(ErrorKind::StatePruned) - .and_then(|h| h.decode().map_err(|_| ErrorKind::StateIncorrect).into())?; + .ok_or(Error::StatePruned) + .and_then(|h| h.decode().map_err(|_| Error::StateIncorrect).into())?; let (executed_code, executed_state) = (executed.code.unwrap_or_default(), executed.state); let tx_data = Self::generate_constructor(validators, executed_code.clone(), executed_state.clone()); let mut tx = Transaction { @@ -649,7 +650,7 @@ impl Provider { /// Create encrypted public contract deployment transaction. Returns updated encrypted state. pub fn execute_private_transaction(&self, block: BlockId, source: &SignedTransaction) -> Result { if let Action::Create = source.action { - bail!(ErrorKind::BadTransactionType); + return Err(Error::BadTransactionType); } let result = self.execute_private(source, TransactOptions::with_no_tracing(), block)?; Ok(result.state) @@ -678,7 +679,7 @@ impl Provider { pub fn get_validators(&self, block: BlockId, address: &Address) -> Result, Error> { let (data, decoder) = private_contract::functions::get_validators::call(); let value = self.client.call_contract(block, *address, data)?; - decoder.decode(&value).map_err(|e| ErrorKind::Call(format!("Contract call failed {:?}", e)).into()) + decoder.decode(&value).map_err(|e| Error::Call(format!("Contract call failed {:?}", e)).into()) } fn get_contract_version(&self, block: BlockId, address: &Address) -> usize { diff --git a/ethcore/private-tx/src/private_transactions.rs b/ethcore/private-tx/src/private_transactions.rs index 21989025b..d0456657b 100644 --- a/ethcore/private-tx/src/private_transactions.rs +++ b/ethcore/private-tx/src/private_transactions.rs @@ -28,7 +28,7 @@ use parking_lot::RwLock; use types::transaction::{UnverifiedTransaction, SignedTransaction}; use txpool; use txpool::{VerifiedTransaction, Verifier}; -use error::{Error, ErrorKind}; +use error::Error; type Pool = txpool::Pool; @@ -154,7 +154,7 @@ impl Default for VerificationStore { impl VerificationStore { /// Adds private transaction for verification into the store - pub fn add_transaction( + pub fn add_transaction( &self, transaction: UnverifiedTransaction, validator_account: Option
, @@ -164,7 +164,7 @@ impl VerificationStore { let options = self.verification_options.clone(); // Use pool's verifying pipeline for original transaction's verification - let verifier = pool::verifier::Verifier::new(client, options, Default::default(), None); + let verifier = pool::verifier::Verifier::new(client.clone(), options, Default::default(), None); let unverified = pool::verifier::Transaction::Unverified(transaction); let verified_tx = verifier.verify_transaction(unverified)?; let signed_tx: SignedTransaction = verified_tx.signed().clone(); @@ -177,8 +177,9 @@ impl VerificationStore { transaction_hash: signed_hash, transaction_sender: signed_sender, }; - let mut pool = self.verification_pool.write(); - pool.import(verified)?; + let replace = pool::replace::ReplaceByScoreAndReadiness::new( + self.verification_pool.read().scoring().clone(), client); + self.verification_pool.write().import(verified, &replace)?; Ok(()) } @@ -228,7 +229,7 @@ impl SigningStore { contract_nonce: U256, ) -> Result<(), Error> { if self.transactions.len() > MAX_QUEUE_LEN { - bail!(ErrorKind::QueueIsFull); + return Err(Error::QueueIsFull); } self.transactions.insert(private_hash, PrivateTransactionSigningDesc { @@ -254,7 +255,7 @@ impl SigningStore { /// Adds received signature for the stored private transaction pub fn add_signature(&mut self, private_hash: &H256, signature: Signature) -> Result<(), Error> { - let desc = self.transactions.get_mut(private_hash).ok_or_else(|| ErrorKind::PrivateTransactionNotFound)?; + let desc = self.transactions.get_mut(private_hash).ok_or_else(|| Error::PrivateTransactionNotFound)?; if !desc.received_signatures.contains(&signature) { desc.received_signatures.push(signature); } diff --git a/ethcore/service/src/error.rs b/ethcore/service/src/error.rs index 483409535..ba401cab4 100644 --- a/ethcore/service/src/error.rs +++ b/ethcore/service/src/error.rs @@ -19,12 +19,9 @@ use io; use ethcore_private_tx; error_chain! { - links { - PrivateTransactions(ethcore_private_tx::Error, ethcore_private_tx::ErrorKind); - } - foreign_links { Ethcore(ethcore::error::Error); IoError(io::IoError); + PrivateTransactions(ethcore_private_tx::Error); } } diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 02e64ad4f..f7dfd8f08 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -32,7 +32,7 @@ parking_lot = "0.7" price-info = { path = "./price-info", optional = true } rlp = { version = "0.3.0", features = ["ethereum"] } trace-time = "0.1" -transaction-pool = "1.13" +transaction-pool = "2.0" [dev-dependencies] env_logger = "0.5" diff --git a/miner/src/pool/listener.rs b/miner/src/pool/listener.rs index fac98b0a1..67034aa52 100644 --- a/miner/src/pool/listener.rs +++ b/miner/src/pool/listener.rs @@ -92,7 +92,7 @@ impl txpool::Listener for Logger { } } - fn rejected(&mut self, _tx: &Arc, reason: &txpool::ErrorKind) { + fn rejected(&mut self, _tx: &Arc, reason: &txpool::Error) { trace!(target: "txqueue", "Rejected {}.", reason); } diff --git a/miner/src/pool/local_transactions.rs b/miner/src/pool/local_transactions.rs index c805484d1..346877d03 100644 --- a/miner/src/pool/local_transactions.rs +++ b/miner/src/pool/local_transactions.rs @@ -171,7 +171,7 @@ impl txpool::Listener for LocalTransactionsList { } } - fn rejected(&mut self, tx: &Arc, reason: &txpool::ErrorKind) { + fn rejected(&mut self, tx: &Arc, reason: &txpool::Error) { if !tx.priority().is_local() { return; } diff --git a/miner/src/pool/mod.rs b/miner/src/pool/mod.rs index 561b85f4b..40a226d9f 100644 --- a/miner/src/pool/mod.rs +++ b/miner/src/pool/mod.rs @@ -27,6 +27,7 @@ mod ready; pub mod client; pub mod local_transactions; +pub mod replace; pub mod scoring; pub mod verifier; @@ -121,7 +122,7 @@ pub trait ScoredTransaction { } /// Verified transaction stored in the pool. -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct VerifiedTransaction { transaction: transaction::PendingTransaction, // TODO [ToDr] hash and sender should go directly from the transaction diff --git a/miner/src/pool/queue.rs b/miner/src/pool/queue.rs index 51c46ad82..ad7c9e6f1 100644 --- a/miner/src/pool/queue.rs +++ b/miner/src/pool/queue.rs @@ -27,7 +27,7 @@ use txpool::{self, Verifier}; use types::transaction; use pool::{ - self, scoring, verifier, client, ready, listener, + self, replace, scoring, verifier, client, ready, listener, PrioritizationStrategy, PendingOrdering, PendingSettings, }; use pool::local_transactions::LocalTransactionsList; @@ -240,7 +240,7 @@ impl TransactionQueue { /// /// Given blockchain and state access (Client) /// verifies and imports transactions to the pool. - pub fn import( + pub fn import( &self, client: C, transactions: Vec, @@ -263,12 +263,14 @@ impl TransactionQueue { }; let verifier = verifier::Verifier::new( - client, + client.clone(), options, self.insertion_id.clone(), transaction_to_replace, ); + let mut replace = replace::ReplaceByScoreAndReadiness::new(self.pool.read().scoring().clone(), client); + let results = transactions .into_iter() .map(|transaction| { @@ -286,7 +288,7 @@ impl TransactionQueue { let imported = verifier .verify_transaction(transaction) .and_then(|verified| { - self.pool.write().import(verified).map_err(convert_error) + self.pool.write().import(verified, &mut replace).map_err(convert_error) }); match imported { @@ -579,17 +581,13 @@ impl TransactionQueue { } } -fn convert_error(err: txpool::Error) -> transaction::Error { - use self::txpool::ErrorKind; +fn convert_error(err: txpool::Error) -> transaction::Error { + use self::txpool::Error; - match *err.kind() { - ErrorKind::AlreadyImported(..) => transaction::Error::AlreadyImported, - ErrorKind::TooCheapToEnter(..) => transaction::Error::LimitReached, - ErrorKind::TooCheapToReplace(..) => transaction::Error::TooCheapToReplace, - ref e => { - warn!(target: "txqueue", "Unknown import error: {:?}", e); - transaction::Error::NotAllowed - }, + match err { + Error::AlreadyImported(..) => transaction::Error::AlreadyImported, + Error::TooCheapToEnter(..) => transaction::Error::LimitReached, + Error::TooCheapToReplace(..) => transaction::Error::TooCheapToReplace } } diff --git a/miner/src/pool/replace.rs b/miner/src/pool/replace.rs new file mode 100644 index 000000000..b1112dcae --- /dev/null +++ b/miner/src/pool/replace.rs @@ -0,0 +1,415 @@ +// Copyright 2015-2019 Parity Technologies (UK) Ltd. +// This file is part of Parity Ethereum. + +// Parity Ethereum is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Ethereum is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Ethereum. If not, see . + +//! Replacing Transactions +//! +//! When queue limits are reached, a new transaction may replace one already +//! in the pool. The decision whether to reject, replace or retain both is +//! delegated to an implementation of `ShouldReplace`. +//! +//! Here we decide based on the sender, the nonce and gas price, and finally +//! on the `Readiness` of the transactions when comparing them + +use std::cmp; + +use ethereum_types::{U256, H160 as Address}; +use txpool::{self, scoring::{Choice, Scoring}, ReplaceTransaction}; +use txpool::VerifiedTransaction; +use super::{client, ScoredTransaction}; + +/// Choose whether to replace based on the sender, the score and finally the +/// `Readiness` of the transactions being compared. +#[derive(Debug)] +pub struct ReplaceByScoreAndReadiness { + scoring: S, + client: C, +} + +impl ReplaceByScoreAndReadiness { + /// Create a new `ReplaceByScoreAndReadiness` + pub fn new(scoring: S, client: C) -> Self { + ReplaceByScoreAndReadiness { scoring, client } + } +} + +impl txpool::ShouldReplace for ReplaceByScoreAndReadiness +where + T: VerifiedTransaction + ScoredTransaction + PartialEq, + S: Scoring, + C: client::NonceClient, +{ + fn should_replace( + &self, + old: &ReplaceTransaction, + new: &ReplaceTransaction, + ) -> Choice { + let both_local = old.priority().is_local() && new.priority().is_local(); + if old.sender() == new.sender() { + // prefer earliest transaction + match new.nonce().cmp(&old.nonce()) { + cmp::Ordering::Equal => self.scoring.choose(&old, &new), + _ if both_local => Choice::InsertNew, + cmp::Ordering::Less => Choice::ReplaceOld, + cmp::Ordering::Greater => Choice::RejectNew, + } + } else if both_local { + Choice::InsertNew + } else { + let old_score = (old.priority(), old.gas_price()); + let new_score = (new.priority(), new.gas_price()); + if new_score > old_score { + let state = &self.client; + // calculate readiness based on state nonce + pooled txs from same sender + let is_ready = |replace: &ReplaceTransaction| { + let mut nonce = state.account_nonce(replace.sender()); + if let Some(txs) = replace.pooled_by_sender { + for tx in txs.iter() { + if nonce == tx.nonce() && *tx.transaction != ***replace.transaction { + nonce = nonce.saturating_add(U256::from(1)) + } else { + break + } + } + } + nonce == replace.nonce() + }; + + if !is_ready(new) && is_ready(old) { + // prevent a ready transaction being replace by a non-ready transaction + Choice::RejectNew + } else { + Choice::ReplaceOld + } + } else { + Choice::RejectNew + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + use std::sync::Arc; + use ethkey::{Random, Generator, KeyPair}; + use pool::tests::tx::{Tx, TxExt}; + use pool::tests::client::TestClient; + use pool::scoring::*; + use pool::{PrioritizationStrategy, VerifiedTransaction}; + use txpool::scoring::Choice::*; + use txpool::ShouldReplace; + + fn local_tx_verified(tx: Tx, keypair: &KeyPair) -> VerifiedTransaction { + let mut verified_tx = tx.unsigned().sign(keypair.secret(), None).verified(); + verified_tx.priority = ::pool::Priority::Local; + verified_tx + } + + fn should_replace(replace: &ShouldReplace, old: VerifiedTransaction, new: VerifiedTransaction) -> Choice { + let old_tx = txpool::Transaction { insertion_id: 0, transaction: Arc::new(old) }; + let new_tx = txpool::Transaction { insertion_id: 0, transaction: Arc::new(new) }; + let old = ReplaceTransaction::new(&old_tx, Default::default()); + let new = ReplaceTransaction::new(&new_tx, Default::default()); + replace.should_replace(&old, &new) + } + + #[test] + fn should_always_accept_local_transactions_unless_same_sender_and_nonce() { + let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); + let client = TestClient::new().with_nonce(1); + let replace = ReplaceByScoreAndReadiness::new(scoring, client); + + // same sender txs + let keypair = Random.generate().unwrap(); + + let same_sender_tx1 = local_tx_verified(Tx { + nonce: 1, + gas_price: 1, + ..Default::default() + }, &keypair); + + let same_sender_tx2 = local_tx_verified(Tx { + nonce: 2, + gas_price: 100, + ..Default::default() + }, &keypair); + + let same_sender_tx3 = local_tx_verified(Tx { + nonce: 2, + gas_price: 200, + ..Default::default() + }, &keypair); + + // different sender txs + let sender1 = Random.generate().unwrap(); + let different_sender_tx1 = local_tx_verified(Tx { + nonce: 2, + gas_price: 1, + ..Default::default() + }, &sender1); + + let sender2 = Random.generate().unwrap(); + let different_sender_tx2 = local_tx_verified(Tx { + nonce: 1, + gas_price: 10, + ..Default::default() + }, &sender2); + + assert_eq!(should_replace(&replace, same_sender_tx1.clone(), same_sender_tx2.clone()), InsertNew); + assert_eq!(should_replace(&replace, same_sender_tx2.clone(), same_sender_tx1.clone()), InsertNew); + + assert_eq!(should_replace(&replace, different_sender_tx1.clone(), different_sender_tx2.clone()), InsertNew); + assert_eq!(should_replace(&replace, different_sender_tx2.clone(), different_sender_tx1.clone()), InsertNew); + + // txs with same sender and nonce + assert_eq!(should_replace(&replace, same_sender_tx2.clone(), same_sender_tx3.clone()), ReplaceOld); + assert_eq!(should_replace(&replace, same_sender_tx3.clone(), same_sender_tx2.clone()), RejectNew); + } + + #[test] + fn should_replace_same_sender_by_nonce() { + let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); + let client = TestClient::new().with_nonce(1); + let replace = ReplaceByScoreAndReadiness::new(scoring, client); + + let tx1 = Tx { + nonce: 1, + gas_price: 1, + ..Default::default() + }; + let tx2 = Tx { + nonce: 2, + gas_price: 100, + ..Default::default() + }; + let tx3 = Tx { + nonce: 2, + gas_price: 110, + ..Default::default() + }; + let tx4 = Tx { + nonce: 2, + gas_price: 130, + ..Default::default() + }; + + let keypair = Random.generate().unwrap(); + let txs = vec![tx1, tx2, tx3, tx4].into_iter().map(|tx| { + tx.unsigned().sign(keypair.secret(), None).verified() + }).collect::>(); + + assert_eq!(should_replace(&replace, txs[0].clone(), txs[1].clone()), RejectNew); + assert_eq!(should_replace(&replace, txs[1].clone(), txs[0].clone()), ReplaceOld); + + assert_eq!(should_replace(&replace, txs[1].clone(), txs[2].clone()), RejectNew); + assert_eq!(should_replace(&replace, txs[2].clone(), txs[1].clone()), RejectNew); + + assert_eq!(should_replace(&replace, txs[1].clone(), txs[3].clone()), ReplaceOld); + assert_eq!(should_replace(&replace, txs[3].clone(), txs[1].clone()), RejectNew); + } + + #[test] + fn should_replace_different_sender_by_priority_and_gas_price() { + // given + let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); + let client = TestClient::new().with_nonce(0); + let replace = ReplaceByScoreAndReadiness::new(scoring, client); + + let tx_regular_low_gas = { + let tx = Tx { + nonce: 1, + gas_price: 1, + ..Default::default() + }; + tx.signed().verified() + }; + let tx_regular_high_gas = { + let tx = Tx { + nonce: 2, + gas_price: 10, + ..Default::default() + }; + tx.signed().verified() + }; + let tx_local_low_gas = { + let tx = Tx { + nonce: 2, + gas_price: 1, + ..Default::default() + }; + let mut verified_tx = tx.signed().verified(); + verified_tx.priority = ::pool::Priority::Local; + verified_tx + }; + let tx_local_high_gas = { + let tx = Tx { + nonce: 1, + gas_price: 10, + ..Default::default() + }; + let mut verified_tx = tx.signed().verified(); + verified_tx.priority = ::pool::Priority::Local; + verified_tx + }; + + assert_eq!(should_replace(&replace, tx_regular_low_gas.clone(), tx_regular_high_gas.clone()), ReplaceOld); + assert_eq!(should_replace(&replace, tx_regular_high_gas.clone(), tx_regular_low_gas.clone()), RejectNew); + + assert_eq!(should_replace(&replace, tx_regular_high_gas.clone(), tx_local_low_gas.clone()), ReplaceOld); + assert_eq!(should_replace(&replace, tx_local_low_gas.clone(), tx_regular_high_gas.clone()), RejectNew); + + assert_eq!(should_replace(&replace, tx_local_low_gas.clone(), tx_local_high_gas.clone()), InsertNew); + assert_eq!(should_replace(&replace, tx_local_high_gas.clone(), tx_regular_low_gas.clone()), RejectNew); + } + + #[test] + fn should_not_replace_ready_transaction_with_future_transaction() { + let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); + let client = TestClient::new().with_nonce(1); + let replace = ReplaceByScoreAndReadiness::new(scoring, client); + + let tx_ready_low_score = { + let tx = Tx { + nonce: 1, + gas_price: 1, + ..Default::default() + }; + tx.signed().verified() + }; + let tx_future_high_score = { + let tx = Tx { + nonce: 3, // future nonce + gas_price: 10, + ..Default::default() + }; + tx.signed().verified() + }; + + assert_eq!(should_replace(&replace, tx_ready_low_score, tx_future_high_score), RejectNew); + } + + #[test] + fn should_compute_readiness_with_pooled_transactions_from_the_same_sender_as_the_existing_transaction() { + let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); + let client = TestClient::new().with_nonce(1); + let replace = ReplaceByScoreAndReadiness::new(scoring, client); + + let old_sender = Random.generate().unwrap(); + let tx_old_ready_1 = { + let tx = Tx { + nonce: 1, + gas_price: 1, + ..Default::default() + }; + tx.unsigned().sign(&old_sender.secret(), None).verified() + }; + let tx_old_ready_2 = { + let tx = Tx { + nonce: 2, + gas_price: 1, + ..Default::default() + }; + tx.unsigned().sign(&old_sender.secret(), None).verified() + }; + let tx_old_ready_3 = { + let tx = Tx { + nonce: 3, + gas_price: 1, + ..Default::default() + }; + tx.unsigned().sign(&old_sender.secret(), None).verified() + }; + + let new_tx = { + let tx = Tx { + nonce: 3, // future nonce + gas_price: 10, + ..Default::default() + }; + tx.signed().verified() + }; + + let old_tx = txpool::Transaction { insertion_id: 0, transaction: Arc::new(tx_old_ready_3) }; + let pooled_txs = [ + txpool::Transaction { insertion_id: 0, transaction: Arc::new(tx_old_ready_1) }, + txpool::Transaction { insertion_id: 0, transaction: Arc::new(tx_old_ready_2) }, + ]; + + let new_tx = txpool::Transaction { insertion_id: 0, transaction: Arc::new(new_tx) }; + + let old = ReplaceTransaction::new(&old_tx, Some(&pooled_txs)); + let new = ReplaceTransaction::new(&new_tx, Default::default()); + + assert_eq!(replace.should_replace(&old, &new), RejectNew); + } + + #[test] + fn should_compute_readiness_with_pooled_transactions_from_the_same_sender_as_the_new_transaction() { + let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); + let client = TestClient::new().with_nonce(1); + let replace = ReplaceByScoreAndReadiness::new(scoring, client); + + // current transaction is ready but has a lower gas price than the new one + let old_tx = { + let tx = Tx { + nonce: 1, + gas_price: 1, + ..Default::default() + }; + tx.signed().verified() + }; + + let new_sender = Random.generate().unwrap(); + let tx_new_ready_1 = { + let tx = Tx { + nonce: 1, + gas_price: 1, + ..Default::default() + }; + tx.unsigned().sign(&new_sender.secret(), None).verified() + }; + let tx_new_ready_2 = { + let tx = Tx { + nonce: 2, + gas_price: 1, + ..Default::default() + }; + tx.unsigned().sign(&new_sender.secret(), None).verified() + }; + let tx_new_ready_3 = { + let tx = Tx { + nonce: 3, + gas_price: 10, // hi + ..Default::default() + }; + tx.unsigned().sign(&new_sender.secret(), None).verified() + }; + + let old_tx = txpool::Transaction { insertion_id: 0, transaction: Arc::new(old_tx) }; + + let new_tx = txpool::Transaction { insertion_id: 0, transaction: Arc::new(tx_new_ready_3) }; + let pooled_txs = [ + txpool::Transaction { insertion_id: 0, transaction: Arc::new(tx_new_ready_1) }, + txpool::Transaction { insertion_id: 0, transaction: Arc::new(tx_new_ready_2) }, + ]; + + let old = ReplaceTransaction::new(&old_tx, None); + let new = ReplaceTransaction::new(&new_tx, Some(&pooled_txs)); + + assert_eq!(replace.should_replace(&old, &new), ReplaceOld); + } +} diff --git a/miner/src/pool/scoring.rs b/miner/src/pool/scoring.rs index aff7ac49e..0360bec35 100644 --- a/miner/src/pool/scoring.rs +++ b/miner/src/pool/scoring.rs @@ -122,29 +122,6 @@ impl

txpool::Scoring

for NonceAndGasPrice where P: ScoredTransaction + txp } } - fn should_replace(&self, old: &P, new: &P) -> scoring::Choice { - let both_local = old.priority().is_local() && new.priority().is_local(); - if old.sender() == new.sender() { - // prefer earliest transaction - match new.nonce().cmp(&old.nonce()) { - cmp::Ordering::Equal => self.choose(old, new), - _ if both_local => scoring::Choice::InsertNew, - cmp::Ordering::Less => scoring::Choice::ReplaceOld, - cmp::Ordering::Greater => scoring::Choice::RejectNew, - } - } else if both_local { - scoring::Choice::InsertNew - } else { - let old_score = (old.priority(), old.gas_price()); - let new_score = (new.priority(), new.gas_price()); - if new_score > old_score { - scoring::Choice::ReplaceOld - } else { - scoring::Choice::RejectNew - } - } - } - fn should_ignore_sender_limit(&self, new: &P) -> bool { new.priority().is_local() } @@ -155,156 +132,8 @@ mod tests { use super::*; use std::sync::Arc; - use ethkey::{Random, Generator, KeyPair}; use pool::tests::tx::{Tx, TxExt}; use txpool::Scoring; - use txpool::scoring::Choice::*; - - fn local_tx_verified(tx: Tx, keypair: &KeyPair) -> VerifiedTransaction { - let mut verified_tx = tx.unsigned().sign(keypair.secret(), None).verified(); - verified_tx.priority = ::pool::Priority::Local; - verified_tx - } - - #[test] - fn should_always_accept_local_transactions_unless_same_sender_and_nonce() { - let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); - - // same sender txs - let keypair = Random.generate().unwrap(); - - let same_sender_tx1 = local_tx_verified(Tx { - nonce: 1, - gas_price: 1, - ..Default::default() - }, &keypair); - - let same_sender_tx2 = local_tx_verified(Tx { - nonce: 2, - gas_price: 100, - ..Default::default() - }, &keypair); - - let same_sender_tx3 = local_tx_verified(Tx { - nonce: 2, - gas_price: 200, - ..Default::default() - }, &keypair); - - // different sender txs - let different_sender_tx1 = local_tx_verified(Tx { - nonce: 2, - gas_price: 1, - ..Default::default() - }, &Random.generate().unwrap()); - - let different_sender_tx2 = local_tx_verified(Tx { - nonce: 1, - gas_price: 10, - ..Default::default() - }, &Random.generate().unwrap()); - - assert_eq!(scoring.should_replace(&same_sender_tx1, &same_sender_tx2), InsertNew); - assert_eq!(scoring.should_replace(&same_sender_tx2, &same_sender_tx1), InsertNew); - - assert_eq!(scoring.should_replace(&different_sender_tx1, &different_sender_tx2), InsertNew); - assert_eq!(scoring.should_replace(&different_sender_tx2, &different_sender_tx1), InsertNew); - - // txs with same sender and nonce - assert_eq!(scoring.should_replace(&same_sender_tx2, &same_sender_tx3), ReplaceOld); - assert_eq!(scoring.should_replace(&same_sender_tx3, &same_sender_tx2), RejectNew); - } - - #[test] - fn should_replace_same_sender_by_nonce() { - let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); - - let tx1 = Tx { - nonce: 1, - gas_price: 1, - ..Default::default() - }; - let tx2 = Tx { - nonce: 2, - gas_price: 100, - ..Default::default() - }; - let tx3 = Tx { - nonce: 2, - gas_price: 110, - ..Default::default() - }; - let tx4 = Tx { - nonce: 2, - gas_price: 130, - ..Default::default() - }; - - let keypair = Random.generate().unwrap(); - let txs = vec![tx1, tx2, tx3, tx4].into_iter().map(|tx| { - tx.unsigned().sign(keypair.secret(), None).verified() - }).collect::>(); - - assert_eq!(scoring.should_replace(&txs[0], &txs[1]), RejectNew); - assert_eq!(scoring.should_replace(&txs[1], &txs[0]), ReplaceOld); - - assert_eq!(scoring.should_replace(&txs[1], &txs[2]), RejectNew); - assert_eq!(scoring.should_replace(&txs[2], &txs[1]), RejectNew); - - assert_eq!(scoring.should_replace(&txs[1], &txs[3]), ReplaceOld); - assert_eq!(scoring.should_replace(&txs[3], &txs[1]), RejectNew); - } - - #[test] - fn should_replace_different_sender_by_priority_and_gas_price() { - // given - let scoring = NonceAndGasPrice(PrioritizationStrategy::GasPriceOnly); - let tx_regular_low_gas = { - let tx = Tx { - nonce: 1, - gas_price: 1, - ..Default::default() - }; - tx.signed().verified() - }; - let tx_regular_high_gas = { - let tx = Tx { - nonce: 2, - gas_price: 10, - ..Default::default() - }; - tx.signed().verified() - }; - let tx_local_low_gas = { - let tx = Tx { - nonce: 2, - gas_price: 1, - ..Default::default() - }; - let mut verified_tx = tx.signed().verified(); - verified_tx.priority = ::pool::Priority::Local; - verified_tx - }; - let tx_local_high_gas = { - let tx = Tx { - nonce: 1, - gas_price: 10, - ..Default::default() - }; - let mut verified_tx = tx.signed().verified(); - verified_tx.priority = ::pool::Priority::Local; - verified_tx - }; - - assert_eq!(scoring.should_replace(&tx_regular_low_gas, &tx_regular_high_gas), ReplaceOld); - assert_eq!(scoring.should_replace(&tx_regular_high_gas, &tx_regular_low_gas), RejectNew); - - assert_eq!(scoring.should_replace(&tx_regular_high_gas, &tx_local_low_gas), ReplaceOld); - assert_eq!(scoring.should_replace(&tx_local_low_gas, &tx_regular_high_gas), RejectNew); - - assert_eq!(scoring.should_replace(&tx_local_low_gas, &tx_local_high_gas), InsertNew); - assert_eq!(scoring.should_replace(&tx_local_high_gas, &tx_regular_low_gas), RejectNew); - } #[test] fn should_calculate_score_correctly() { diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index c6c59dc15..fd111116e 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -72,7 +72,7 @@ fake-fetch = { path = "../util/fake-fetch" } kvdb-memorydb = "0.1" macros = { path = "../util/macros" } pretty_assertions = "0.1" -transaction-pool = "1.13" +transaction-pool = "2.0" [features] accounts = ["ethcore-accounts"] diff --git a/rpc/src/v1/helpers/dispatch/mod.rs b/rpc/src/v1/helpers/dispatch/mod.rs index d23619f41..887720972 100644 --- a/rpc/src/v1/helpers/dispatch/mod.rs +++ b/rpc/src/v1/helpers/dispatch/mod.rs @@ -86,7 +86,7 @@ use jsonrpc_core::{BoxFuture, Result, Error}; use jsonrpc_core::futures::{future, Future, IntoFuture}; use v1::helpers::{TransactionRequest, FilledTransactionRequest, ConfirmationPayload}; use v1::types::{ - H520 as RpcH520, Bytes as RpcBytes, + Bytes as RpcBytes, RichRawTransaction as RpcRichRawTransaction, ConfirmationPayload as RpcConfirmationPayload, ConfirmationResponse, @@ -309,7 +309,6 @@ pub fn execute( let res = signer.sign_message(address, pass, SignMessage::Data(data)) .map(|result| result .map(|s| H520(s.into_electrum())) - .map(RpcH520::from) .map(ConfirmationResponse::Signature) ); @@ -319,7 +318,6 @@ pub fn execute( let res = signer.sign_message(address, pass, SignMessage::Hash(data)) .map(|result| result .map(|rsv| H520(rsv.into_electrum())) - .map(RpcH520::from) .map(ConfirmationResponse::Signature) ); diff --git a/rpc/src/v1/helpers/external_signer/signing_queue.rs b/rpc/src/v1/helpers/external_signer/signing_queue.rs index 764050052..9bbc778ec 100644 --- a/rpc/src/v1/helpers/external_signer/signing_queue.rs +++ b/rpc/src/v1/helpers/external_signer/signing_queue.rs @@ -15,6 +15,7 @@ // along with Parity Ethereum. If not, see . use std::collections::BTreeMap; + use ethereum_types::U256; use parking_lot::{Mutex, RwLock}; use super::oneshot; diff --git a/rpc/src/v1/helpers/light_fetch.rs b/rpc/src/v1/helpers/light_fetch.rs index 3ac17c2fd..3d6d61c54 100644 --- a/rpc/src/v1/helpers/light_fetch.rs +++ b/rpc/src/v1/helpers/light_fetch.rs @@ -40,13 +40,14 @@ use light::on_demand::{ }; use light::on_demand::error::Error as OnDemandError; use light::request::Field; +use light::TransactionQueue; use sync::{LightNetworkDispatcher, ManageNetwork, LightSyncProvider}; -use ethereum_types::{U256, Address}; +use ethereum_types::{Address, U256}; use hash::H256; -use parking_lot::Mutex; +use parking_lot::{Mutex, RwLock}; use fastmap::H256FastMap; use std::collections::BTreeMap; use types::transaction::{Action, Transaction as EthTransaction, PendingTransaction, SignedTransaction, LocalizedTransaction}; @@ -56,6 +57,7 @@ use v1::types::{BlockNumber, CallRequest, Log, Transaction}; const NO_INVALID_BACK_REFS_PROOF: &str = "Fails only on invalid back-references; back-references here known to be valid; qed"; const WRONG_RESPONSE_AMOUNT_TYPE_PROOF: &str = "responses correspond directly with requests in amount and type; qed"; +const DEFAULT_GAS_PRICE: u64 = 21_000; pub fn light_all_transactions(dispatch: &Arc>) -> impl Iterator where @@ -95,7 +97,7 @@ where on_demand: self.on_demand.clone(), sync: self.sync.clone(), cache: self.cache.clone(), - gas_price_percentile: self.gas_price_percentile + gas_price_percentile: self.gas_price_percentile, } } } @@ -209,7 +211,13 @@ where /// Helper for getting account info at a given block. /// `None` indicates the account doesn't exist at the given block. - pub fn account(&self, address: Address, id: BlockId) -> impl Future, Error = Error> + Send { + pub fn account( + &self, + address: Address, + id: BlockId, + tx_queue: Arc> + ) -> impl Future, Error = Error> + Send { + let mut reqs = Vec::new(); let header_ref = match self.make_header_requests(id, &mut reqs) { Ok(r) => r, @@ -218,15 +226,26 @@ where reqs.push(request::Account { header: header_ref, address: address }.into()); - Either::B(self.send_requests(reqs, |mut res|match res.pop() { - Some(OnDemandResponse::Account(acc)) => acc, + Either::B(self.send_requests(reqs, move |mut res| match res.pop() { + Some(OnDemandResponse::Account(maybe_account)) => { + if let Some(ref acc) = maybe_account { + let mut txq = tx_queue.write(); + txq.cull(address, acc.nonce); + } + maybe_account + } _ => panic!(WRONG_RESPONSE_AMOUNT_TYPE_PROOF), })) } /// Helper for getting proved execution. - pub fn proved_read_only_execution(&self, req: CallRequest, num: Option) -> impl Future + Send { - const DEFAULT_GAS_PRICE: u64 = 21_000; + pub fn proved_read_only_execution( + &self, + req: CallRequest, + num: Option, + txq: Arc> + ) -> impl Future + Send { + // (21000 G_transaction + 32000 G_create + some marginal to allow a few operations) const START_GAS: u64 = 60_000; @@ -249,21 +268,12 @@ where let from = req.from.unwrap_or_else(|| Address::zero()); let nonce_fut = match req.nonce { Some(nonce) => Either::A(future::ok(Some(nonce))), - None => Either::B(self.account(from, id).map(|acc| acc.map(|a| a.nonce))), + None => Either::B(self.account(from, id, txq).map(|acc| acc.map(|a| a.nonce))), }; - let gas_price_percentile = self.gas_price_percentile; let gas_price_fut = match req.gas_price { Some(price) => Either::A(future::ok(price)), - None => Either::B(dispatch::light::fetch_gas_price_corpus( - self.sync.clone(), - self.client.clone(), - self.on_demand.clone(), - self.cache.clone(), - ).map(move |corp| match corp.percentile(gas_price_percentile) { - Some(percentile) => *percentile, - None => DEFAULT_GAS_PRICE.into(), - })) + None => Either::B(self.gas_price()), }; // if nonce resolves, this should too since it'll be in the LRU-cache. @@ -302,6 +312,23 @@ where })) } + /// Helper to fetch the corpus gas price from 1) the cache 2) the network then it tries to estimate the percentile + /// using `gas_price_percentile` if the estimated percentile is zero the `DEFAULT_GAS_PRICE` is returned + pub fn gas_price(&self) -> impl Future + Send { + let gas_price_percentile = self.gas_price_percentile; + + dispatch::light::fetch_gas_price_corpus( + self.sync.clone(), + self.client.clone(), + self.on_demand.clone(), + self.cache.clone(), + ) + .map(move |corp| { + corp.percentile(gas_price_percentile) + .map_or_else(|| DEFAULT_GAS_PRICE.into(), |percentile| *percentile) + }) + } + /// Get a block itself. Fails on unknown block ID. pub fn block(&self, id: BlockId) -> impl Future + Send { let mut reqs = Vec::new(); diff --git a/rpc/src/v1/helpers/secretstore.rs b/rpc/src/v1/helpers/secretstore.rs index d8a60d592..6e1cbca45 100644 --- a/rpc/src/v1/helpers/secretstore.rs +++ b/rpc/src/v1/helpers/secretstore.rs @@ -16,12 +16,13 @@ use std::collections::BTreeSet; use rand::{Rng, OsRng}; +use ethereum_types::{H256, H512}; use ethkey::{self, Public, Secret, Random, Generator, math}; use crypto; use bytes::Bytes; use jsonrpc_core::Error; use v1::helpers::errors; -use v1::types::{H256, H512, EncryptedDocumentKey}; +use v1::types::EncryptedDocumentKey; use tiny_keccak::Keccak; /// Initialization vector length. diff --git a/rpc/src/v1/helpers/signature.rs b/rpc/src/v1/helpers/signature.rs index b2bea2588..32827ea1e 100644 --- a/rpc/src/v1/helpers/signature.rs +++ b/rpc/src/v1/helpers/signature.rs @@ -15,8 +15,9 @@ // along with Parity Ethereum. If not, see . use ethkey::{recover, public_to_address, Signature}; +use ethereum_types::{H256, U64}; use jsonrpc_core::Result; -use v1::types::{Bytes, RecoveredAccount, H256, U64}; +use v1::types::{Bytes, RecoveredAccount}; use v1::helpers::errors; use v1::helpers::dispatch::eth_data_hash; use hash::keccak; @@ -35,7 +36,7 @@ pub fn verify_signature( } else { keccak(message.0) }; - let v: u64 = v.into(); + let v = v.as_u64(); let is_valid_for_current_chain = match (chain_id, v) { (None, v) if v == 0 || v == 1 => true, (Some(chain_id), v) if v >= 35 => (v - 35) / 2 == chain_id, @@ -54,7 +55,7 @@ pub fn verify_signature( mod tests { use super::*; use ethkey::Generator; - use v1::types::H160; + use ethereum_types::{H160, U64}; pub fn add_chain_replay_protection(v: u64, chain_id: Option) -> u64 { v + if let Some(n) = chain_id { 35 + n * 2 } else { 0 } diff --git a/rpc/src/v1/helpers/subscribers.rs b/rpc/src/v1/helpers/subscribers.rs index 5b48b67a2..9483d8e32 100644 --- a/rpc/src/v1/helpers/subscribers.rs +++ b/rpc/src/v1/helpers/subscribers.rs @@ -19,8 +19,8 @@ use std::{ops, str}; use std::collections::HashMap; use jsonrpc_pubsub::{typed::{Subscriber, Sink}, SubscriptionId}; +use ethereum_types::H64; use rand::{Rng, StdRng}; -use v1::types::H64; #[derive(Debug, Clone, Hash, Eq, PartialEq)] pub struct Id(H64); @@ -36,8 +36,9 @@ impl str::FromStr for Id { } } impl Id { + // TODO: replace `format!` see [#10412](https://github.com/paritytech/parity-ethereum/issues/10412) pub fn as_string(&self) -> String { - format!("0x{:?}", self.0) + format!("{:?}", self.0) } } diff --git a/rpc/src/v1/helpers/work.rs b/rpc/src/v1/helpers/work.rs index 0a90d446e..661b4cab8 100644 --- a/rpc/src/v1/helpers/work.rs +++ b/rpc/src/v1/helpers/work.rs @@ -20,17 +20,13 @@ use std::sync::Arc; use rlp; use ethcore::miner::{BlockChainClient, MinerService}; -use ethereum_types::{H64 as EthcoreH64, H256 as EthcoreH256}; +use ethereum_types::{H64, H256}; use jsonrpc_core::Error; -use v1::types::{H64, H256}; use v1::helpers::errors; // Submit a POW work and return the block's hash pub fn submit_work_detail(client: &Arc, miner: &Arc, nonce: H64, pow_hash: H256, mix_hash: H256) -> Result { // TODO [ToDr] Should disallow submissions in case of PoA? - let nonce: EthcoreH64 = nonce.into(); - let pow_hash: EthcoreH256 = pow_hash.into(); - let mix_hash: EthcoreH256 = mix_hash.into(); trace!(target: "miner", "submit_work_detail: Decoded: nonce={}, pow_hash={}, mix_hash={}", nonce, pow_hash, mix_hash); let seal = vec![rlp::encode(&mix_hash), rlp::encode(&nonce)]; let import = miner.submit_seal(pow_hash, seal) diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index 8d47b9b7b..2e2fd05c2 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -21,7 +21,7 @@ use std::time::{Instant, Duration, SystemTime, UNIX_EPOCH}; use std::sync::Arc; use rlp::Rlp; -use ethereum_types::{U256, H256, H160, Address}; +use ethereum_types::{Address, H64, H160, H256, U64, U256}; use parking_lot::Mutex; use ethash::{self, SeedHashCompute}; @@ -47,8 +47,7 @@ use v1::traits::Eth; use v1::types::{ RichBlock, Block, BlockTransactions, BlockNumber, Bytes, SyncStatus, SyncInfo, Transaction, CallRequest, Index, Filter, Log, Receipt, Work, EthAccount, StorageProof, - H64 as RpcH64, H256 as RpcH256, H160 as RpcH160, U256 as RpcU256, block_number_to_id, - U64 as RpcU64, + block_number_to_id }; use v1::metadata::Metadata; @@ -530,7 +529,7 @@ impl Eth for EthClient< } } - fn author(&self) -> Result { + fn author(&self) -> Result { let miner = self.miner.authoring_params().author; if miner == 0.into() { (self.accounts)() @@ -539,7 +538,7 @@ impl Eth for EthClient< .map(From::from) .ok_or_else(|| errors::account("No accounts were found", "")) } else { - Ok(RpcH160::from(miner)) + Ok(H160::from(miner)) } } @@ -547,32 +546,30 @@ impl Eth for EthClient< Ok(self.miner.is_currently_sealing()) } - fn chain_id(&self) -> Result> { - Ok(self.client.signing_chain_id().map(RpcU64::from)) + fn chain_id(&self) -> Result> { + Ok(self.client.signing_chain_id().map(U64::from)) } - fn hashrate(&self) -> Result { - Ok(RpcU256::from(self.external_miner.hashrate())) + fn hashrate(&self) -> Result { + Ok(U256::from(self.external_miner.hashrate())) } - fn gas_price(&self) -> Result { - Ok(RpcU256::from(default_gas_price(&*self.client, &*self.miner, self.options.gas_price_percentile))) + fn gas_price(&self) -> BoxFuture { + Box::new(future::ok(default_gas_price(&*self.client, &*self.miner, self.options.gas_price_percentile))) } - fn accounts(&self) -> Result> { + fn accounts(&self) -> Result> { self.deprecation_notice.print("eth_accounts", deprecated::msgs::ACCOUNTS); let accounts = (self.accounts)(); Ok(accounts.into_iter().map(Into::into).collect()) } - fn block_number(&self) -> Result { - Ok(RpcU256::from(self.client.chain_info().best_block_number)) + fn block_number(&self) -> Result { + Ok(U256::from(self.client.chain_info().best_block_number)) } - fn balance(&self, address: RpcH160, num: Option) -> BoxFuture { - let address = address.into(); - + fn balance(&self, address: H160, num: Option) -> BoxFuture { let num = num.unwrap_or_default(); try_bf!(check_known(&*self.client, num.clone())); @@ -584,11 +581,10 @@ impl Eth for EthClient< Box::new(future::done(res)) } - fn proof(&self, address: RpcH160, values: Vec, num: Option) -> BoxFuture { + fn proof(&self, address: H160, values: Vec, num: Option) -> BoxFuture { try_bf!(errors::require_experimental(self.options.allow_experimental_rpcs, "1186")); - let a: H160 = address.clone().into(); - let key1 = keccak(a); + let key1 = keccak(address); let num = num.unwrap_or_default(); let id = match num { @@ -603,7 +599,7 @@ impl Eth for EthClient< try_bf!(check_known(&*self.client, num.clone())); let res = match self.client.prove_account(key1, id) { - Some((proof,account)) => Ok(EthAccount { + Some((proof, account)) => Ok(EthAccount { address: address, balance: account.balance.into(), nonce: account.nonce.into(), @@ -627,10 +623,8 @@ impl Eth for EthClient< Box::new(future::done(res)) } - fn storage_at(&self, address: RpcH160, pos: RpcU256, num: Option) -> BoxFuture { - let address: Address = RpcH160::into(address); - let position: U256 = RpcU256::into(pos); - + fn storage_at(&self, address: H160, position: U256, num: Option) -> BoxFuture { + let address: Address = address.into(); let num = num.unwrap_or_default(); try_bf!(check_known(&*self.client, num.clone())); @@ -642,8 +636,8 @@ impl Eth for EthClient< Box::new(future::done(res)) } - fn transaction_count(&self, address: RpcH160, num: Option) -> BoxFuture { - let address: Address = RpcH160::into(address); + fn transaction_count(&self, address: H160, num: Option) -> BoxFuture { + let address: Address = address.into(); let res = match num.unwrap_or_default() { BlockNumber::Pending if self.options.pending_nonce_from_queue => { @@ -676,7 +670,7 @@ impl Eth for EthClient< Box::new(future::done(res)) } - fn block_transaction_count_by_hash(&self, hash: RpcH256) -> BoxFuture> { + fn block_transaction_count_by_hash(&self, hash: H256) -> BoxFuture> { let trx_count = self.client.block(BlockId::Hash(hash.into())) .map(|block| block.transactions_count().into()); let result = Ok(trx_count) @@ -684,7 +678,7 @@ impl Eth for EthClient< Box::new(future::done(result)) } - fn block_transaction_count_by_number(&self, num: BlockNumber) -> BoxFuture> { + fn block_transaction_count_by_number(&self, num: BlockNumber) -> BoxFuture> { Box::new(future::done(match num { BlockNumber::Pending => Ok(Some(self.miner.pending_transaction_hashes(&*self.client).len().into())), @@ -701,7 +695,7 @@ impl Eth for EthClient< })) } - fn block_uncles_count_by_hash(&self, hash: RpcH256) -> BoxFuture> { + fn block_uncles_count_by_hash(&self, hash: H256) -> BoxFuture> { let uncle_count = self.client.block(BlockId::Hash(hash.into())) .map(|block| block.uncles_count().into()); let result = Ok(uncle_count) @@ -709,7 +703,7 @@ impl Eth for EthClient< Box::new(future::done(result)) } - fn block_uncles_count_by_number(&self, num: BlockNumber) -> BoxFuture> { + fn block_uncles_count_by_number(&self, num: BlockNumber) -> BoxFuture> { Box::new(future::done(match num { BlockNumber::Pending => Ok(Some(0.into())), _ => { @@ -725,8 +719,8 @@ impl Eth for EthClient< })) } - fn code_at(&self, address: RpcH160, num: Option) -> BoxFuture { - let address: Address = RpcH160::into(address); + fn code_at(&self, address: H160, num: Option) -> BoxFuture { + let address: Address = H160::into(address); let num = num.unwrap_or_default(); try_bf!(check_known(&*self.client, num.clone())); @@ -739,7 +733,7 @@ impl Eth for EthClient< Box::new(future::done(res)) } - fn block_by_hash(&self, hash: RpcH256, include_txs: bool) -> BoxFuture> { + fn block_by_hash(&self, hash: H256, include_txs: bool) -> BoxFuture> { let result = self.rich_block(BlockId::Hash(hash.into()).into(), include_txs) .and_then(errors::check_block_gap(&*self.client, self.options.allow_missing_blocks)); Box::new(future::done(result)) @@ -751,8 +745,7 @@ impl Eth for EthClient< Box::new(future::done(result)) } - fn transaction_by_hash(&self, hash: RpcH256) -> BoxFuture> { - let hash: H256 = hash.into(); + fn transaction_by_hash(&self, hash: H256) -> BoxFuture> { let tx = try_bf!(self.transaction(PendingTransactionId::Hash(hash))).or_else(|| { self.miner.transaction(&hash) .map(|t| Transaction::from_pending(t.pending().clone())) @@ -762,7 +755,7 @@ impl Eth for EthClient< Box::new(future::done(result)) } - fn transaction_by_block_hash_and_index(&self, hash: RpcH256, index: Index) -> BoxFuture> { + fn transaction_by_block_hash_and_index(&self, hash: H256, index: Index) -> BoxFuture> { let id = PendingTransactionId::Location(PendingOrBlock::Block(BlockId::Hash(hash.into())), index.value()); let result = self.transaction(id).and_then( errors::check_block_gap(&*self.client, self.options.allow_missing_blocks)); @@ -783,9 +776,7 @@ impl Eth for EthClient< Box::new(future::done(result)) } - fn transaction_receipt(&self, hash: RpcH256) -> BoxFuture> { - let hash: H256 = hash.into(); - + fn transaction_receipt(&self, hash: H256) -> BoxFuture> { if self.options.allow_pending_receipt_query { let best_block = self.client.chain_info().best_block_number; if let Some(receipt) = self.miner.pending_receipt(best_block, &hash) { @@ -799,7 +790,7 @@ impl Eth for EthClient< Box::new(future::done(result)) } - fn uncle_by_block_hash_and_index(&self, hash: RpcH256, index: Index) -> BoxFuture> { + fn uncle_by_block_hash_and_index(&self, hash: H256, index: Index) -> BoxFuture> { let result = self.uncle(PendingUncleId { id: PendingOrBlock::Block(BlockId::Hash(hash.into())), position: index.value() @@ -889,19 +880,19 @@ impl Eth for EthClient< } } - fn submit_work(&self, nonce: RpcH64, pow_hash: RpcH256, mix_hash: RpcH256) -> Result { + fn submit_work(&self, nonce: H64, pow_hash: H256, mix_hash: H256) -> Result { match helpers::submit_work_detail(&self.client, &self.miner, nonce, pow_hash, mix_hash) { Ok(_) => Ok(true), Err(_) => Ok(false), } } - fn submit_hashrate(&self, rate: RpcU256, id: RpcH256) -> Result { + fn submit_hashrate(&self, rate: U256, id: H256) -> Result { self.external_miner.submit_hashrate(rate.into(), id.into()); Ok(true) } - fn send_raw_transaction(&self, raw: Bytes) -> Result { + fn send_raw_transaction(&self, raw: Bytes) -> Result { Rlp::new(&raw.into_vec()).as_val() .map_err(errors::rlp) .and_then(|tx| SignedTransaction::new(tx).map_err(errors::transaction)) @@ -916,7 +907,7 @@ impl Eth for EthClient< .map(Into::into) } - fn submit_transaction(&self, raw: Bytes) -> Result { + fn submit_transaction(&self, raw: Bytes) -> Result { self.send_raw_transaction(raw) } @@ -960,7 +951,7 @@ impl Eth for EthClient< )) } - fn estimate_gas(&self, request: CallRequest, num: Option) -> BoxFuture { + fn estimate_gas(&self, request: CallRequest, num: Option) -> BoxFuture { let request = CallRequest::into(request); let signed = try_bf!(fake_sign::sign_call(request)); let num = num.unwrap_or_default(); diff --git a/rpc/src/v1/impls/eth_filter.rs b/rpc/src/v1/impls/eth_filter.rs index 20a0d2740..f8d4d2902 100644 --- a/rpc/src/v1/impls/eth_filter.rs +++ b/rpc/src/v1/impls/eth_filter.rs @@ -21,7 +21,7 @@ use std::collections::{BTreeSet, VecDeque}; use ethcore::client::{BlockChainClient, BlockId}; use ethcore::miner::{self, MinerService}; -use ethereum_types::H256; +use ethereum_types::{H256, U256}; use parking_lot::Mutex; use types::filter::Filter as EthcoreFilter; @@ -29,7 +29,7 @@ use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_core::futures::{future, Future}; use jsonrpc_core::futures::future::Either; use v1::traits::EthFilter; -use v1::types::{BlockNumber, Index, Filter, FilterChanges, Log, H256 as RpcH256, U256 as RpcU256}; +use v1::types::{BlockNumber, Index, Filter, FilterChanges, Log}; use v1::helpers::{errors, SyncPollFilter, PollFilter, PollManager, limit_logs}; use v1::impls::eth::pending_logs; @@ -137,7 +137,7 @@ impl Filterable for EthFilterClient where } impl EthFilter for T { - fn new_filter(&self, filter: Filter) -> Result { + fn new_filter(&self, filter: Filter) -> Result { let mut polls = self.polls().lock(); let block_number = self.best_block_number(); let include_pending = filter.to_block == Some(BlockNumber::Pending); @@ -150,7 +150,7 @@ impl EthFilter for T { Ok(id.into()) } - fn new_block_filter(&self) -> Result { + fn new_block_filter(&self) -> Result { let mut polls = self.polls().lock(); // +1, since we don't want to include the current block let id = polls.create_poll(SyncPollFilter::new(PollFilter::Block { @@ -160,7 +160,7 @@ impl EthFilter for T { Ok(id.into()) } - fn new_pending_transaction_filter(&self) -> Result { + fn new_pending_transaction_filter(&self) -> Result { let mut polls = self.polls().lock(); let pending_transactions = self.pending_transaction_hashes(); let id = polls.create_poll(SyncPollFilter::new(PollFilter::PendingTransaction(pending_transactions))); @@ -191,7 +191,7 @@ impl EthFilter for T { match self.block_hash(block_number) { Some(hash) => { *last_block_number = n; - hashes.push(RpcH256::from(hash)); + hashes.push(H256::from(hash)); // Only keep the most recent history if recent_reported_hashes.len() >= PollFilter::MAX_BLOCK_HISTORY_SIZE { recent_reported_hashes.pop_back(); diff --git a/rpc/src/v1/impls/light/eth.rs b/rpc/src/v1/impls/light/eth.rs index e13f56219..a9ba1773f 100644 --- a/rpc/src/v1/impls/light/eth.rs +++ b/rpc/src/v1/impls/light/eth.rs @@ -28,7 +28,7 @@ use light::client::LightChainClient; use light::{cht, TransactionQueue}; use light::on_demand::{request, OnDemand}; -use ethereum_types::{U256, Address}; +use ethereum_types::{Address, H64, H160, H256, U64, U256}; use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP}; use parking_lot::{RwLock, Mutex}; use rlp::Rlp; @@ -38,17 +38,13 @@ use types::filter::Filter as EthcoreFilter; use types::ids::BlockId; use v1::impls::eth_filter::Filterable; -use v1::helpers::{errors, limit_logs}; -use v1::helpers::{SyncPollFilter, PollManager}; +use v1::helpers::{errors, limit_logs, SyncPollFilter, PollManager}; use v1::helpers::deprecated::{self, DeprecationNotice}; use v1::helpers::light_fetch::{self, LightFetch}; use v1::traits::Eth; use v1::types::{ - RichBlock, Block, BlockTransactions, BlockNumber, LightBlockNumber, Bytes, - SyncStatus as RpcSyncStatus, SyncInfo as RpcSyncInfo, - Transaction, CallRequest, Index, Filter, Log, Receipt, Work, EthAccount, - H64 as RpcH64, H256 as RpcH256, H160 as RpcH160, U256 as RpcU256, - U64 as RpcU64, + RichBlock, Block, BlockTransactions, BlockNumber, LightBlockNumber, Bytes, SyncStatus as RpcSyncStatus, + SyncInfo as RpcSyncInfo, Transaction, CallRequest, Index, Filter, Log, Receipt, Work, EthAccount }; use v1::metadata::Metadata; @@ -251,7 +247,7 @@ where } } - fn author(&self) -> Result { + fn author(&self) -> Result { (self.accounts)() .first() .cloned() @@ -263,22 +259,19 @@ where Ok(false) } - fn chain_id(&self) -> Result> { - Ok(self.client.signing_chain_id().map(RpcU64::from)) + fn chain_id(&self) -> Result> { + Ok(self.client.signing_chain_id().map(U64::from)) } - fn hashrate(&self) -> Result { + fn hashrate(&self) -> Result { Ok(Default::default()) } - fn gas_price(&self) -> Result { - Ok(self.cache.lock().gas_price_corpus() - .and_then(|c| c.percentile(self.gas_price_percentile).cloned()) - .map(RpcU256::from) - .unwrap_or_else(Default::default)) + fn gas_price(&self) -> BoxFuture { + Box::new(self.fetcher().gas_price()) } - fn accounts(&self) -> Result> { + fn accounts(&self) -> Result> { self.deprecation_notice.print("eth_accounts", deprecated::msgs::ACCOUNTS); Ok((self.accounts)() @@ -287,20 +280,20 @@ where .collect()) } - fn block_number(&self) -> Result { + fn block_number(&self) -> Result { Ok(self.client.chain_info().best_block_number.into()) } - fn balance(&self, address: RpcH160, num: Option) -> BoxFuture { - Box::new(self.fetcher().account(address.into(), num.unwrap_or_default().to_block_id()) - .map(|acc| acc.map_or(0.into(), |a| a.balance).into())) + fn balance(&self, address: H160, num: Option) -> BoxFuture { + Box::new(self.fetcher().account(address, num.unwrap_or_default().to_block_id(), self.transaction_queue.clone()) + .map(|acc| acc.map_or(0.into(), |a| a.balance))) } - fn storage_at(&self, _address: RpcH160, _key: RpcU256, _num: Option) -> BoxFuture { + fn storage_at(&self, _address: H160, _key: U256, _num: Option) -> BoxFuture { Box::new(future::err(errors::unimplemented(None))) } - fn block_by_hash(&self, hash: RpcH256, include_txs: bool) -> BoxFuture> { + fn block_by_hash(&self, hash: H256, include_txs: bool) -> BoxFuture> { Box::new(self.rich_block(BlockId::Hash(hash.into()), include_txs).map(Some)) } @@ -308,12 +301,12 @@ where Box::new(self.rich_block(num.to_block_id(), include_txs).map(Some)) } - fn transaction_count(&self, address: RpcH160, num: Option) -> BoxFuture { - Box::new(self.fetcher().account(address.into(), num.unwrap_or_default().to_block_id()) - .map(|acc| acc.map_or(0.into(), |a| a.nonce).into())) + fn transaction_count(&self, address: H160, num: Option) -> BoxFuture { + Box::new(self.fetcher().account(address, num.unwrap_or_default().to_block_id(), self.transaction_queue.clone()) + .map(|acc| acc.map_or(0.into(), |a| a.nonce))) } - fn block_transaction_count_by_hash(&self, hash: RpcH256) -> BoxFuture> { + fn block_transaction_count_by_hash(&self, hash: H256) -> BoxFuture> { let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone()); Box::new(self.fetcher().header(BlockId::Hash(hash.into())).and_then(move |hdr| { @@ -329,7 +322,7 @@ where })) } - fn block_transaction_count_by_number(&self, num: BlockNumber) -> BoxFuture> { + fn block_transaction_count_by_number(&self, num: BlockNumber) -> BoxFuture> { let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone()); Box::new(self.fetcher().header(num.to_block_id()).and_then(move |hdr| { @@ -345,7 +338,7 @@ where })) } - fn block_uncles_count_by_hash(&self, hash: RpcH256) -> BoxFuture> { + fn block_uncles_count_by_hash(&self, hash: H256) -> BoxFuture> { let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone()); Box::new(self.fetcher().header(BlockId::Hash(hash.into())).and_then(move |hdr| { @@ -361,7 +354,7 @@ where })) } - fn block_uncles_count_by_number(&self, num: BlockNumber) -> BoxFuture> { + fn block_uncles_count_by_number(&self, num: BlockNumber) -> BoxFuture> { let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone()); Box::new(self.fetcher().header(num.to_block_id()).and_then(move |hdr| { @@ -377,11 +370,11 @@ where })) } - fn code_at(&self, address: RpcH160, num: Option) -> BoxFuture { + fn code_at(&self, address: H160, num: Option) -> BoxFuture { Box::new(self.fetcher().code(address.into(), num.unwrap_or_default().to_block_id()).map(Into::into)) } - fn send_raw_transaction(&self, raw: Bytes) -> Result { + fn send_raw_transaction(&self, raw: Bytes) -> Result { let best_header = self.client.best_block_header().decode().map_err(errors::decode)?; Rlp::new(&raw.into_vec()).as_val() @@ -400,12 +393,12 @@ where .map(Into::into) } - fn submit_transaction(&self, raw: Bytes) -> Result { + fn submit_transaction(&self, raw: Bytes) -> Result { self.send_raw_transaction(raw) } fn call(&self, req: CallRequest, num: Option) -> BoxFuture { - Box::new(self.fetcher().proved_read_only_execution(req, num).and_then(|res| { + Box::new(self.fetcher().proved_read_only_execution(req, num, self.transaction_queue.clone()).and_then(|res| { match res { Ok(exec) => Ok(exec.output.into()), Err(e) => Err(errors::execution(e)), @@ -413,9 +406,9 @@ where })) } - fn estimate_gas(&self, req: CallRequest, num: Option) -> BoxFuture { + fn estimate_gas(&self, req: CallRequest, num: Option) -> BoxFuture { // TODO: binary chop for more accurate estimates. - Box::new(self.fetcher().proved_read_only_execution(req, num).and_then(|res| { + Box::new(self.fetcher().proved_read_only_execution(req, num, self.transaction_queue.clone()).and_then(|res| { match res { Ok(exec) => Ok((exec.refunded + exec.gas_used).into()), Err(e) => Err(errors::execution(e)), @@ -423,7 +416,7 @@ where })) } - fn transaction_by_hash(&self, hash: RpcH256) -> BoxFuture> { + fn transaction_by_hash(&self, hash: H256) -> BoxFuture> { let hash = hash.into(); { @@ -438,7 +431,7 @@ where Box::new(self.fetcher().transaction_by_hash(hash).map(|x| x.map(|(tx, _)| tx))) } - fn transaction_by_block_hash_and_index(&self, hash: RpcH256, idx: Index) -> BoxFuture> { + fn transaction_by_block_hash_and_index(&self, hash: H256, idx: Index) -> BoxFuture> { Box::new(self.fetcher().block(BlockId::Hash(hash.into())).map(move |block| { light_fetch::extract_transaction_at_index(block, idx.value()) })) @@ -450,9 +443,9 @@ where })) } - fn transaction_receipt(&self, hash: RpcH256) -> BoxFuture> { + fn transaction_receipt(&self, hash: H256) -> BoxFuture> { let fetcher = self.fetcher(); - Box::new(fetcher.transaction_by_hash(hash.clone().into()).and_then(move |tx| { + Box::new(fetcher.transaction_by_hash(hash.into()).and_then(move |tx| { // the block hash included in the transaction object here has // already been checked for canonicality and whether it contains // the transaction. @@ -480,7 +473,7 @@ where })) } - fn uncle_by_block_hash_and_index(&self, hash: RpcH256, idx: Index) -> BoxFuture> { + fn uncle_by_block_hash_and_index(&self, hash: H256, idx: Index) -> BoxFuture> { let client = self.client.clone(); Box::new(self.fetcher().block(BlockId::Hash(hash.into())).map(move |block| { extract_uncle_at_index(block, idx, client) @@ -494,7 +487,7 @@ where })) } - fn proof(&self, _address: RpcH160, _values:Vec, _num: Option) -> BoxFuture { + fn proof(&self, _address: H160, _values:Vec, _num: Option) -> BoxFuture { Box::new(future::err(errors::unimplemented(None))) } @@ -528,11 +521,11 @@ where Err(errors::light_unimplemented(None)) } - fn submit_work(&self, _nonce: RpcH64, _pow_hash: RpcH256, _mix_hash: RpcH256) -> Result { + fn submit_work(&self, _nonce: H64, _pow_hash: H256, _mix_hash: H256) -> Result { Err(errors::light_unimplemented(None)) } - fn submit_hashrate(&self, _rate: RpcU256, _id: RpcH256) -> Result { + fn submit_hashrate(&self, _rate: U256, _id: H256) -> Result { Err(errors::light_unimplemented(None)) } } @@ -545,11 +538,11 @@ where { fn best_block_number(&self) -> u64 { self.client.chain_info().best_block_number } - fn block_hash(&self, id: BlockId) -> Option<::ethereum_types::H256> { + fn block_hash(&self, id: BlockId) -> Option { self.client.block_hash(id) } - fn pending_transaction_hashes(&self) -> BTreeSet<::ethereum_types::H256> { + fn pending_transaction_hashes(&self) -> BTreeSet { BTreeSet::new() } diff --git a/rpc/src/v1/impls/light/parity.rs b/rpc/src/v1/impls/light/parity.rs index 0d5b2d225..24dba420e 100644 --- a/rpc/src/v1/impls/light/parity.rs +++ b/rpc/src/v1/impls/light/parity.rs @@ -25,6 +25,7 @@ use ethkey::{crypto::ecies, Brain, Generator}; use ethstore::random_phrase; use sync::{LightSyncInfo, LightSyncProvider, LightNetworkDispatcher, ManageNetwork}; use updater::VersionInfo as UpdaterVersionInfo; +use ethereum_types::{H64, H160, H256, H512, U64, U256}; use ethcore_logger::RotatingLogger; use jsonrpc_core::{Result, BoxFuture}; @@ -36,7 +37,7 @@ use v1::helpers::light_fetch::{LightFetch, light_all_transactions}; use v1::metadata::Metadata; use v1::traits::Parity; use v1::types::{ - Bytes, U256, U64, H64, H160, H256, H512, CallRequest, + Bytes, CallRequest, Peers, Transaction, RpcSettings, Histogram, TransactionStats, LocalTransactionStatus, LightBlockNumber, ChainStatus, Receipt, diff --git a/rpc/src/v1/impls/light/parity_set.rs b/rpc/src/v1/impls/light/parity_set.rs index 1bd66dc68..f129f86b3 100644 --- a/rpc/src/v1/impls/light/parity_set.rs +++ b/rpc/src/v1/impls/light/parity_set.rs @@ -20,16 +20,17 @@ use std::io; use std::sync::Arc; -use sync::ManageNetwork; +use ethereum_types::{H160, H256, U256}; use fetch::{self, Fetch}; use hash::keccak_buffer; use light::client::LightChainClient; +use sync::ManageNetwork; use jsonrpc_core::{Result, BoxFuture}; use jsonrpc_core::futures::Future; use v1::helpers::errors; use v1::traits::ParitySet; -use v1::types::{Bytes, H160, H256, U256, ReleaseInfo, Transaction}; +use v1::types::{Bytes, ReleaseInfo, Transaction}; /// Parity-specific rpc interface for operations altering the settings. pub struct ParitySetClient { diff --git a/rpc/src/v1/impls/light/trace.rs b/rpc/src/v1/impls/light/trace.rs index 42f62e0c4..a560f980e 100644 --- a/rpc/src/v1/impls/light/trace.rs +++ b/rpc/src/v1/impls/light/trace.rs @@ -16,11 +16,13 @@ //! Traces api implementation. +use ethereum_types::H256; use jsonrpc_core::Result; use v1::Metadata; use v1::traits::Traces; use v1::helpers::errors; -use v1::types::{TraceFilter, LocalizedTrace, BlockNumber, Index, CallRequest, Bytes, TraceResults, TraceResultsWithTransactionHash, TraceOptions, H256}; +use v1::types::{TraceFilter, LocalizedTrace, BlockNumber, Index, CallRequest, Bytes, TraceResults, + TraceResultsWithTransactionHash, TraceOptions}; /// Traces api implementation. // TODO: all calling APIs should be possible w. proved remote TX execution. diff --git a/rpc/src/v1/impls/parity.rs b/rpc/src/v1/impls/parity.rs index 648b41069..d985f33f6 100644 --- a/rpc/src/v1/impls/parity.rs +++ b/rpc/src/v1/impls/parity.rs @@ -20,12 +20,12 @@ use std::str::FromStr; use std::collections::BTreeMap; use crypto::DEFAULT_MAC; +use ethereum_types::{Address, H64, H160, H256, H512, U64, U256}; use ethcore::client::{BlockChainClient, StateClient, Call}; use ethcore::miner::{self, MinerService}; use ethcore::snapshot::{SnapshotService, RestorationStatus}; use ethcore::state::StateInfo; use ethcore_logger::RotatingLogger; -use ethereum_types::Address; use ethkey::{crypto::ecies, Brain, Generator}; use ethstore::random_phrase; use jsonrpc_core::futures::future; @@ -41,7 +41,7 @@ use v1::helpers::external_signer::{SigningQueue, SignerService}; use v1::metadata::Metadata; use v1::traits::Parity; use v1::types::{ - Bytes, U256, H64, U64, H160, H256, H512, CallRequest, + Bytes, CallRequest, Peers, Transaction, RpcSettings, Histogram, TransactionStats, LocalTransactionStatus, BlockNumber, ConsensusCapability, VersionInfo, diff --git a/rpc/src/v1/impls/parity_accounts.rs b/rpc/src/v1/impls/parity_accounts.rs index 55f23dded..e52f8b7ac 100644 --- a/rpc/src/v1/impls/parity_accounts.rs +++ b/rpc/src/v1/impls/parity_accounts.rs @@ -20,8 +20,8 @@ use std::collections::{ btree_map::{BTreeMap, Entry}, HashSet, }; -use ethereum_types::Address; +use ethereum_types::{Address, H160, H256, H520}; use ethkey::{Brain, Generator, Secret}; use ethstore::KeyFile; use accounts::AccountProvider; @@ -29,10 +29,7 @@ use jsonrpc_core::Result; use v1::helpers::deprecated::{self, DeprecationNotice}; use v1::helpers::errors; use v1::traits::{ParityAccounts, ParityAccountsInfo}; -use v1::types::{ - H160 as RpcH160, H256 as RpcH256, H520 as RpcH520, Derive, DeriveHierarchical, DeriveHash, - ExtAccountInfo, AccountInfo, HwAccountInfo, -}; +use v1::types::{Derive, DeriveHierarchical, DeriveHash,ExtAccountInfo, AccountInfo, HwAccountInfo}; use ethkey::Password; /// Account management (personal) rpc implementation. @@ -58,7 +55,7 @@ impl ParityAccountsClient { } impl ParityAccountsInfo for ParityAccountsClient { - fn accounts_info(&self) -> Result> { + fn accounts_info(&self) -> Result> { self.deprecation_notice("parity_accountsInfo"); let dapp_accounts = self.accounts.accounts() @@ -72,18 +69,18 @@ impl ParityAccountsInfo for ParityAccountsClient { .into_iter() .chain(other.into_iter()) .filter(|&(ref a, _)| dapp_accounts.contains(a)) - .map(|(a, v)| (RpcH160::from(a), AccountInfo { name: v.name })) + .map(|(a, v)| (H160::from(a), AccountInfo { name: v.name })) .collect() ) } - fn hardware_accounts_info(&self) -> Result> { + fn hardware_accounts_info(&self) -> Result> { self.deprecation_notice("parity_hardwareAccountsInfo"); let info = self.accounts.hardware_accounts_info().map_err(|e| errors::account("Could not fetch account info.", e))?; Ok(info .into_iter() - .map(|(a, v)| (RpcH160::from(a), HwAccountInfo { name: v.name, manufacturer: v.meta })) + .map(|(a, v)| (H160::from(a), HwAccountInfo { name: v.name, manufacturer: v.meta })) .collect() ) } @@ -94,7 +91,7 @@ impl ParityAccountsInfo for ParityAccountsClient { self.accounts.locked_hardware_accounts().map_err(|e| errors::account("Error communicating with hardware wallet.", e)) } - fn default_account(&self) -> Result { + fn default_account(&self) -> Result { self.deprecation_notice("parity_defaultAccount"); Ok(self.accounts.default_account() @@ -105,9 +102,7 @@ impl ParityAccountsInfo for ParityAccountsClient { } impl ParityAccounts for ParityAccountsClient { - fn all_accounts_info(&self) -> Result> { - self.deprecation_notice("parity_allAccountsInfo"); - + fn all_accounts_info(&self) -> Result> { let info = self.accounts.accounts_info().map_err(|e| errors::account("Could not fetch account info.", e))?; let other = self.accounts.addresses_info(); @@ -120,7 +115,7 @@ impl ParityAccounts for ParityAccountsClient { uuid: v.uuid.map(|uuid| uuid.to_string()) })); - let mut accounts: BTreeMap = BTreeMap::new(); + let mut accounts: BTreeMap = BTreeMap::new(); for (address, account) in account_iter { match accounts.entry(address) { @@ -138,27 +133,24 @@ impl ParityAccounts for ParityAccountsClient { Ok(accounts) } - fn new_account_from_phrase(&self, phrase: String, pass: Password) -> Result { + fn new_account_from_phrase(&self, phrase: String, pass: Password) -> Result { self.deprecation_notice("parity_newAccountFromPhrase"); - let brain = Brain::new(phrase).generate().unwrap(); self.accounts.insert_account(brain.secret().clone(), &pass) .map(Into::into) .map_err(|e| errors::account("Could not create account.", e)) } - fn new_account_from_wallet(&self, json: String, pass: Password) -> Result { + fn new_account_from_wallet(&self, json: String, pass: Password) -> Result { self.deprecation_notice("parity_newAccountFromWallet"); - self.accounts.import_presale(json.as_bytes(), &pass) .or_else(|_| self.accounts.import_wallet(json.as_bytes(), &pass, true)) .map(Into::into) .map_err(|e| errors::account("Could not create account.", e)) } - fn new_account_from_secret(&self, secret: RpcH256, pass: Password) -> Result { + fn new_account_from_secret(&self, secret: H256, pass: Password) -> Result { self.deprecation_notice("parity_newAccountFromSecret"); - let secret = Secret::from_unsafe_slice(&secret.0) .map_err(|e| errors::account("Could not create account.", e))?; self.accounts.insert_account(secret, &pass) @@ -166,9 +158,8 @@ impl ParityAccounts for ParityAccountsClient { .map_err(|e| errors::account("Could not create account.", e)) } - fn test_password(&self, account: RpcH160, password: Password) -> Result { + fn test_password(&self, account: H160, password: Password) -> Result { self.deprecation_notice("parity_testPassword"); - let account: Address = account.into(); self.accounts @@ -176,9 +167,8 @@ impl ParityAccounts for ParityAccountsClient { .map_err(|e| errors::account("Could not fetch account info.", e)) } - fn change_password(&self, account: RpcH160, password: Password, new_password: Password) -> Result { + fn change_password(&self, account: H160, password: Password, new_password: Password) -> Result { self.deprecation_notice("parity_changePassword"); - let account: Address = account.into(); self.accounts .change_password(&account, password, new_password) @@ -186,9 +176,8 @@ impl ParityAccounts for ParityAccountsClient { .map_err(|e| errors::account("Could not fetch account info.", e)) } - fn kill_account(&self, account: RpcH160, password: Password) -> Result { + fn kill_account(&self, account: H160, password: Password) -> Result { self.deprecation_notice("parity_killAccount"); - let account: Address = account.into(); self.accounts .kill_account(&account, &password) @@ -196,18 +185,16 @@ impl ParityAccounts for ParityAccountsClient { .map_err(|e| errors::account("Could not delete account.", e)) } - fn remove_address(&self, addr: RpcH160) -> Result { + fn remove_address(&self, addr: H160) -> Result { self.deprecation_notice("parity_removeAddresss"); - let addr: Address = addr.into(); self.accounts.remove_address(addr); Ok(true) } - fn set_account_name(&self, addr: RpcH160, name: String) -> Result { + fn set_account_name(&self, addr: H160, name: String) -> Result { self.deprecation_notice("parity_setAccountName"); - let addr: Address = addr.into(); self.accounts.set_account_name(addr.clone(), name.clone()) @@ -215,9 +202,8 @@ impl ParityAccounts for ParityAccountsClient { Ok(true) } - fn set_account_meta(&self, addr: RpcH160, meta: String) -> Result { + fn set_account_meta(&self, addr: H160, meta: String) -> Result { self.deprecation_notice("parity_setAccountMeta"); - let addr: Address = addr.into(); self.accounts.set_account_meta(addr.clone(), meta.clone()) @@ -225,18 +211,16 @@ impl ParityAccounts for ParityAccountsClient { Ok(true) } - fn import_geth_accounts(&self, addresses: Vec) -> Result> { + fn import_geth_accounts(&self, addresses: Vec) -> Result> { self.deprecation_notice("parity_importGethAccounts"); - self.accounts .import_geth_accounts(into_vec(addresses), false) .map(into_vec) .map_err(|e| errors::account("Couldn't import Geth accounts", e)) } - fn geth_accounts(&self) -> Result> { + fn geth_accounts(&self) -> Result> { self.deprecation_notice("parity_listGethAccounts"); - Ok(into_vec(self.accounts.list_geth_accounts(false))) } @@ -292,9 +276,8 @@ impl ParityAccounts for ParityAccountsClient { .map(|_| true) } - fn change_vault(&self, address: RpcH160, new_vault: String) -> Result { + fn change_vault(&self, address: H160, new_vault: String) -> Result { self.deprecation_notice("parity_changeVault"); - self.accounts .change_vault(address.into(), &new_vault) .map_err(|e| errors::account("Could not change vault.", e)) @@ -318,9 +301,8 @@ impl ParityAccounts for ParityAccountsClient { .map(|_| true) } - fn derive_key_index(&self, addr: RpcH160, password: Password, derivation: DeriveHierarchical, save_as_account: bool) -> Result { + fn derive_key_index(&self, addr: H160, password: Password, derivation: DeriveHierarchical, save_as_account: bool) -> Result { self.deprecation_notice("parity_deriveAddressIndex"); - let addr: Address = addr.into(); self.accounts .derive_account( @@ -333,9 +315,8 @@ impl ParityAccounts for ParityAccountsClient { .map_err(|e| errors::account("Could not derive account.", e)) } - fn derive_key_hash(&self, addr: RpcH160, password: Password, derivation: DeriveHash, save_as_account: bool) -> Result { + fn derive_key_hash(&self, addr: H160, password: Password, derivation: DeriveHash, save_as_account: bool) -> Result { self.deprecation_notice("parity_deriveAddressHash"); - let addr: Address = addr.into(); self.accounts .derive_account( @@ -348,9 +329,8 @@ impl ParityAccounts for ParityAccountsClient { .map_err(|e| errors::account("Could not derive account.", e)) } - fn export_account(&self, addr: RpcH160, password: Password) -> Result { + fn export_account(&self, addr: H160, password: Password) -> Result { self.deprecation_notice("parity_exportAccount"); - let addr = addr.into(); self.accounts .export_account( @@ -361,9 +341,8 @@ impl ParityAccounts for ParityAccountsClient { .map_err(|e| errors::account("Could not export account.", e)) } - fn sign_message(&self, addr: RpcH160, password: Password, message: RpcH256) -> Result { + fn sign_message(&self, addr: H160, password: Password, message: H256) -> Result { self.deprecation_notice("parity_signMessage"); - self.accounts .sign( addr.into(), diff --git a/rpc/src/v1/impls/parity_set.rs b/rpc/src/v1/impls/parity_set.rs index 995b7988c..16ef8d543 100644 --- a/rpc/src/v1/impls/parity_set.rs +++ b/rpc/src/v1/impls/parity_set.rs @@ -21,7 +21,7 @@ use std::time::Duration; use ethcore::client::{BlockChainClient, Mode}; use ethcore::miner::{self, MinerService}; -use ethereum_types::H256 as EthH256; +use ethereum_types::{H160, H256, U256}; use ethkey; use fetch::{self, Fetch}; use hash::keccak_buffer; @@ -32,7 +32,7 @@ use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_core::futures::Future; use v1::helpers::errors; use v1::traits::ParitySet; -use v1::types::{Bytes, H160, H256, U256, ReleaseInfo, Transaction}; +use v1::types::{Bytes, ReleaseInfo, Transaction}; #[cfg(any(test, feature = "accounts"))] pub mod accounts { @@ -160,7 +160,6 @@ impl ParitySet for ParitySetClient where } fn set_engine_signer_secret(&self, secret: H256) -> Result { - let secret: EthH256 = secret.into(); let keypair = ethkey::KeyPair::from_secret(secret.into()).map_err(|e| errors::account("Invalid secret", e))?; self.miner.set_author(miner::Author::Sealer(ethcore::engines::signer::from_keypair(keypair))); Ok(true) diff --git a/rpc/src/v1/impls/personal.rs b/rpc/src/v1/impls/personal.rs index 92886cbe3..b6af1f81e 100644 --- a/rpc/src/v1/impls/personal.rs +++ b/rpc/src/v1/impls/personal.rs @@ -21,7 +21,7 @@ use std::time::Duration; use accounts::AccountProvider; use bytes::Bytes; use eip_712::{EIP712, hash_structured_data}; -use ethereum_types::{H520, U128, Address}; +use ethereum_types::{H160, H256, H520, U128, Address}; use ethkey::{public_to_address, recover, Signature}; use types::transaction::{PendingTransaction, SignedTransaction}; @@ -34,7 +34,6 @@ use v1::helpers::{errors, eip191}; use v1::metadata::Metadata; use v1::traits::Personal; use v1::types::{ - H160 as RpcH160, H256 as RpcH256, H520 as RpcH520, U128 as RpcU128, Bytes as RpcBytes, ConfirmationPayload as RpcConfirmationPayload, ConfirmationResponse as RpcConfirmationResponse, @@ -108,24 +107,21 @@ impl PersonalClient { impl Personal for PersonalClient { type Metadata = Metadata; - fn accounts(&self) -> Result> { + fn accounts(&self) -> Result> { self.deprecation_notice.print("personal_accounts", deprecated::msgs::ACCOUNTS); - let accounts = self.accounts.accounts().map_err(|e| errors::account("Could not fetch accounts.", e))?; - Ok(accounts.into_iter().map(Into::into).collect::>()) + Ok(accounts.into_iter().map(Into::into).collect::>()) } - fn new_account(&self, pass: String) -> Result { + fn new_account(&self, pass: String) -> Result { self.deprecation_notice.print("personal_newAccount", deprecated::msgs::ACCOUNTS); - self.accounts.new_account(&pass.into()) .map(Into::into) .map_err(|e| errors::account("Could not create account.", e)) } - fn unlock_account(&self, account: RpcH160, account_pass: String, duration: Option) -> Result { + fn unlock_account(&self, account: H160, account_pass: String, duration: Option) -> Result { self.deprecation_notice.print("personal_unlockAccount", deprecated::msgs::ACCOUNTS); - let account: Address = account.into(); let store = self.accounts.clone(); let duration = match duration { @@ -157,9 +153,8 @@ impl Personal for PersonalClient { } } - fn sign(&self, data: RpcBytes, account: RpcH160, password: String) -> BoxFuture { + fn sign(&self, data: RpcBytes, account: H160, password: String) -> BoxFuture { self.deprecation_notice.print("personal_sign", deprecated::msgs::ACCOUNTS); - let dispatcher = self.dispatcher.clone(); let accounts = Arc::new(dispatch::Signer::new(self.accounts.clone())) as _; @@ -177,9 +172,8 @@ impl Personal for PersonalClient { })) } - fn sign_191(&self, version: EIP191Version, data: Value, account: RpcH160, password: String) -> BoxFuture { + fn sign_191(&self, version: EIP191Version, data: Value, account: H160, password: String) -> BoxFuture { self.deprecation_notice.print("personal_sign191", deprecated::msgs::ACCOUNTS); - try_bf!(errors::require_experimental(self.allow_experimental_rpcs, "191")); let data = try_bf!(eip191::hash_message(version, data)); @@ -201,9 +195,8 @@ impl Personal for PersonalClient { ) } - fn sign_typed_data(&self, typed_data: EIP712, account: RpcH160, password: String) -> BoxFuture { + fn sign_typed_data(&self, typed_data: EIP712, account: H160, password: String) -> BoxFuture { self.deprecation_notice.print("personal_signTypedData", deprecated::msgs::ACCOUNTS); - try_bf!(errors::require_experimental(self.allow_experimental_rpcs, "712")); let data = match hash_structured_data(typed_data) { @@ -228,7 +221,7 @@ impl Personal for PersonalClient { ) } - fn ec_recover(&self, data: RpcBytes, signature: RpcH520) -> BoxFuture { + fn ec_recover(&self, data: RpcBytes, signature: H520) -> BoxFuture { let signature: H520 = signature.into(); let signature = Signature::from_electrum(&signature); let data: Bytes = data.into(); @@ -253,28 +246,25 @@ impl Personal for PersonalClient { .map(move |pending_tx| dispatcher.enrich(pending_tx.transaction))) } - fn send_transaction(&self, meta: Metadata, request: TransactionRequest, password: String) -> BoxFuture { + fn send_transaction(&self, meta: Metadata, request: TransactionRequest, password: String) -> BoxFuture { self.deprecation_notice.print("personal_sendTransaction", deprecated::msgs::ACCOUNTS); - let condition = request.condition.clone().map(Into::into); let dispatcher = self.dispatcher.clone(); Box::new( - self.do_sign_transaction(meta, request, password, move |signed: WithToken| { + self.do_sign_transaction(meta, request, password, move |signed: WithToken| { dispatcher.dispatch_transaction( PendingTransaction::new( signed.into_value(), condition ) ) - }).and_then(|hash| { - Ok(RpcH256::from(hash)) }) ) } - fn sign_and_send_transaction(&self, meta: Metadata, request: TransactionRequest, password: String) -> BoxFuture { + fn sign_and_send_transaction(&self, meta: Metadata, request: TransactionRequest, password: String) -> BoxFuture { self.deprecation_notice.print("personal_signAndSendTransaction", Some("use personal_sendTransaction instead.")); - + warn!("Using deprecated personal_signAndSendTransaction, use personal_sendTransaction instead."); self.send_transaction(meta, request, password) } } diff --git a/rpc/src/v1/impls/private.rs b/rpc/src/v1/impls/private.rs index e9c8c239c..f1cf99124 100644 --- a/rpc/src/v1/impls/private.rs +++ b/rpc/src/v1/impls/private.rs @@ -21,11 +21,11 @@ use std::sync::Arc; use rlp::Rlp; use ethcore_private_tx::Provider as PrivateTransactionManager; -use ethereum_types::Address; +use ethereum_types::{Address, H160, H256, U256}; use types::transaction::SignedTransaction; use jsonrpc_core::{Error}; -use v1::types::{Bytes, PrivateTransactionReceipt, H160, H256, TransactionRequest, U256, +use v1::types::{Bytes, PrivateTransactionReceipt, TransactionRequest, BlockNumber, PrivateTransactionReceiptAndTransaction, CallRequest, block_number_to_id}; use v1::traits::Private; use v1::metadata::Metadata; diff --git a/rpc/src/v1/impls/secretstore.rs b/rpc/src/v1/impls/secretstore.rs index 8eb1c3d11..b6526b85d 100644 --- a/rpc/src/v1/impls/secretstore.rs +++ b/rpc/src/v1/impls/secretstore.rs @@ -19,16 +19,17 @@ use std::collections::BTreeSet; use std::sync::Arc; -use crypto::DEFAULT_MAC; -use ethkey::Secret; use accounts::AccountProvider; +use crypto::DEFAULT_MAC; +use ethereum_types::{H160, H256, H512}; +use ethkey::Secret; use jsonrpc_core::Result; use v1::helpers::errors; use v1::helpers::secretstore::{generate_document_key, encrypt_document, decrypt_document, decrypt_document_with_shadow, ordered_servers_keccak}; use v1::traits::SecretStore; -use v1::types::{H160, H256, H512, Bytes, EncryptedDocumentKey}; +use v1::types::{Bytes, EncryptedDocumentKey}; use ethkey::Password; /// Parity implementation. diff --git a/rpc/src/v1/impls/signer.rs b/rpc/src/v1/impls/signer.rs index 152a16d4b..c4f4d3576 100644 --- a/rpc/src/v1/impls/signer.rs +++ b/rpc/src/v1/impls/signer.rs @@ -18,6 +18,7 @@ use std::sync::Arc; +use ethereum_types::U256; use ethkey; use parity_runtime::Executor; use parking_lot::Mutex; @@ -34,7 +35,7 @@ use v1::helpers::{errors, ConfirmationPayload, FilledTransactionRequest, Subscri use v1::helpers::external_signer::{SigningQueue, SignerService}; use v1::metadata::Metadata; use v1::traits::Signer; -use v1::types::{TransactionModification, ConfirmationRequest, ConfirmationResponse, ConfirmationResponseWithToken, U256, Bytes}; +use v1::types::{TransactionModification, ConfirmationRequest, ConfirmationResponse, ConfirmationResponseWithToken, Bytes}; /// Transactions confirmation (personal) rpc implementation. pub struct SignerClient { diff --git a/rpc/src/v1/impls/signing.rs b/rpc/src/v1/impls/signing.rs index 96d4059aa..12f890956 100644 --- a/rpc/src/v1/impls/signing.rs +++ b/rpc/src/v1/impls/signing.rs @@ -18,9 +18,10 @@ use std::sync::Arc; use transient_hashmap::TransientHashMap; -use ethereum_types::U256; use parking_lot::Mutex; +use ethereum_types::{H160, H256, H520, U256}; + use jsonrpc_core::{BoxFuture, Result, Error}; use jsonrpc_core::futures::{future, Future, Poll, Async}; use jsonrpc_core::futures::future::Either; @@ -36,7 +37,7 @@ use v1::helpers::external_signer::{ use v1::metadata::Metadata; use v1::traits::{EthSigning, ParitySigning}; use v1::types::{ - H160 as RpcH160, H256 as RpcH256, U256 as RpcU256, Bytes as RpcBytes, H520 as RpcH520, + Bytes as RpcBytes, Either as RpcEither, RichRawTransaction as RpcRichRawTransaction, TransactionRequest as RpcTransactionRequest, @@ -142,9 +143,8 @@ impl ParitySigning for SigningQueueClient { Box::new(self.dispatcher.fill_optional_fields(transaction.into(), default_account, true).map(Into::into)) } - fn post_sign(&self, meta: Metadata, address: RpcH160, data: RpcBytes) -> BoxFuture> { + fn post_sign(&self, meta: Metadata, address: H160, data: RpcBytes) -> BoxFuture> { self.deprecation_notice.print("parity_postSign", deprecated::msgs::ACCOUNTS); - let executor = self.executor.clone(); let confirmations = self.confirmations.clone(); @@ -160,9 +160,8 @@ impl ParitySigning for SigningQueueClient { })) } - fn post_transaction(&self, meta: Metadata, request: RpcTransactionRequest) -> BoxFuture> { + fn post_transaction(&self, meta: Metadata, request: RpcTransactionRequest) -> BoxFuture> { self.deprecation_notice.print("parity_postTransaction", deprecated::msgs::ACCOUNTS); - let executor = self.executor.clone(); let confirmations = self.confirmations.clone(); @@ -176,9 +175,8 @@ impl ParitySigning for SigningQueueClient { })) } - fn check_request(&self, id: RpcU256) -> Result> { + fn check_request(&self, id: U256) -> Result> { self.deprecation_notice.print("parity_checkRequest", deprecated::msgs::ACCOUNTS); - let id: U256 = id.into(); match self.confirmations.lock().get(&id) { None => Err(errors::request_not_found()), // Request info has been dropped, or even never been there @@ -187,9 +185,8 @@ impl ParitySigning for SigningQueueClient { } } - fn decrypt_message(&self, meta: Metadata, address: RpcH160, data: RpcBytes) -> BoxFuture { + fn decrypt_message(&self, meta: Metadata, address: H160, data: RpcBytes) -> BoxFuture { self.deprecation_notice.print("parity_decryptMessage", deprecated::msgs::ACCOUNTS); - let res = self.dispatch( RpcConfirmationPayload::Decrypt((address.clone(), data).into()), meta.origin, @@ -208,9 +205,8 @@ impl ParitySigning for SigningQueueClient { impl EthSigning for SigningQueueClient { type Metadata = Metadata; - fn sign(&self, meta: Metadata, address: RpcH160, data: RpcBytes) -> BoxFuture { + fn sign(&self, meta: Metadata, address: H160, data: RpcBytes) -> BoxFuture { self.deprecation_notice.print("eth_sign", deprecated::msgs::ACCOUNTS); - let res = self.dispatch( RpcConfirmationPayload::EthSignMessage((address.clone(), data).into()), meta.origin, @@ -224,9 +220,8 @@ impl EthSigning for SigningQueueClient { })) } - fn send_transaction(&self, meta: Metadata, request: RpcTransactionRequest) -> BoxFuture { + fn send_transaction(&self, meta: Metadata, request: RpcTransactionRequest) -> BoxFuture { self.deprecation_notice.print("eth_sendTransaction", deprecated::msgs::ACCOUNTS); - let res = self.dispatch( RpcConfirmationPayload::SendTransaction(request), meta.origin, diff --git a/rpc/src/v1/impls/signing_unsafe.rs b/rpc/src/v1/impls/signing_unsafe.rs index 59b8d5e9d..72a3a6fbf 100644 --- a/rpc/src/v1/impls/signing_unsafe.rs +++ b/rpc/src/v1/impls/signing_unsafe.rs @@ -18,8 +18,7 @@ use std::sync::Arc; -use ethereum_types::Address; - +use ethereum_types::{Address, H160, H256, H520, U256}; use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_core::futures::{future, Future}; use v1::helpers::{errors}; @@ -28,8 +27,7 @@ use v1::helpers::dispatch::{self, Dispatcher}; use v1::metadata::Metadata; use v1::traits::{EthSigning, ParitySigning}; use v1::types::{ - U256 as RpcU256, - H160 as RpcH160, H256 as RpcH256, H520 as RpcH520, Bytes as RpcBytes, + Bytes as RpcBytes, Either as RpcEither, RichRawTransaction as RpcRichRawTransaction, TransactionRequest as RpcTransactionRequest, @@ -70,9 +68,8 @@ impl EthSigning for SigningUnsafeClient { type Metadata = Metadata; - fn sign(&self, _: Metadata, address: RpcH160, data: RpcBytes) -> BoxFuture { + fn sign(&self, _: Metadata, address: H160, data: RpcBytes) -> BoxFuture { self.deprecation_notice.print("eth_sign", deprecated::msgs::ACCOUNTS); - Box::new(self.handle(RpcConfirmationPayload::EthSignMessage((address.clone(), data).into()), address.into()) .then(|res| match res { Ok(RpcConfirmationResponse::Signature(signature)) => Ok(signature), @@ -81,9 +78,8 @@ impl EthSigning for SigningUnsafeClient })) } - fn send_transaction(&self, _meta: Metadata, request: RpcTransactionRequest) -> BoxFuture { + fn send_transaction(&self, _meta: Metadata, request: RpcTransactionRequest) -> BoxFuture { self.deprecation_notice.print("eth_sendTransaction", deprecated::msgs::ACCOUNTS); - Box::new(self.handle(RpcConfirmationPayload::SendTransaction(request), self.accounts.default_account()) .then(|res| match res { Ok(RpcConfirmationResponse::SendTransaction(hash)) => Ok(hash), @@ -113,9 +109,8 @@ impl ParitySigning for SigningUnsafeClient { Box::new(self.dispatcher.fill_optional_fields(transaction.into(), default_account, true).map(Into::into)) } - fn decrypt_message(&self, _: Metadata, address: RpcH160, data: RpcBytes) -> BoxFuture { + fn decrypt_message(&self, _: Metadata, address: H160, data: RpcBytes) -> BoxFuture { self.deprecation_notice.print("parity_decryptMessage", deprecated::msgs::ACCOUNTS); - Box::new(self.handle(RpcConfirmationPayload::Decrypt((address.clone(), data).into()), address.into()) .then(|res| match res { Ok(RpcConfirmationResponse::Decrypt(data)) => Ok(data), @@ -124,17 +119,17 @@ impl ParitySigning for SigningUnsafeClient { })) } - fn post_sign(&self, _: Metadata, _: RpcH160, _: RpcBytes) -> BoxFuture> { + fn post_sign(&self, _: Metadata, _: H160, _: RpcBytes) -> BoxFuture> { // We don't support this in non-signer mode. Box::new(future::err(errors::signer_disabled())) } - fn post_transaction(&self, _: Metadata, _: RpcTransactionRequest) -> BoxFuture> { + fn post_transaction(&self, _: Metadata, _: RpcTransactionRequest) -> BoxFuture> { // We don't support this in non-signer mode. Box::new(future::err(errors::signer_disabled())) } - fn check_request(&self, _: RpcU256) -> Result> { + fn check_request(&self, _: U256) -> Result> { // We don't support this in non-signer mode. Err(errors::signer_disabled()) } diff --git a/rpc/src/v1/impls/traces.rs b/rpc/src/v1/impls/traces.rs index f2a5c83d4..d7428aad2 100644 --- a/rpc/src/v1/impls/traces.rs +++ b/rpc/src/v1/impls/traces.rs @@ -19,6 +19,7 @@ use std::sync::Arc; use ethcore::client::{BlockChainClient, CallAnalytics, TransactionId, TraceId, StateClient, StateInfo, Call, BlockId}; +use ethereum_types::H256; use rlp::Rlp; use types::transaction::SignedTransaction; @@ -26,7 +27,8 @@ use jsonrpc_core::Result; use v1::Metadata; use v1::traits::Traces; use v1::helpers::{errors, fake_sign}; -use v1::types::{TraceFilter, LocalizedTrace, BlockNumber, Index, CallRequest, Bytes, TraceResults, TraceResultsWithTransactionHash, TraceOptions, H256, block_number_to_id}; +use v1::types::{TraceFilter, LocalizedTrace, BlockNumber, Index, CallRequest, Bytes, TraceResults, + TraceResultsWithTransactionHash, TraceOptions, block_number_to_id}; fn to_call_analytics(flags: TraceOptions) -> CallAnalytics { CallAnalytics { diff --git a/rpc/src/v1/impls/web3.rs b/rpc/src/v1/impls/web3.rs index 3dfe2a665..e7bf9dd49 100644 --- a/rpc/src/v1/impls/web3.rs +++ b/rpc/src/v1/impls/web3.rs @@ -15,11 +15,12 @@ // along with Parity Ethereum. If not, see . //! Web3 rpc implementation. +use ethereum_types::H256; use hash::keccak; use jsonrpc_core::Result; use version::version; use v1::traits::Web3; -use v1::types::{H256, Bytes}; +use v1::types::Bytes; /// Web3 rpc implementation. pub struct Web3Client; diff --git a/rpc/src/v1/mod.rs b/rpc/src/v1/mod.rs index 67b25bffb..8b8afacdb 100644 --- a/rpc/src/v1/mod.rs +++ b/rpc/src/v1/mod.rs @@ -53,5 +53,5 @@ pub mod signer { #[cfg(any(test, feature = "accounts"))] pub use super::helpers::engine_signer::EngineSigner; pub use super::helpers::external_signer::{SignerService, ConfirmationsQueue}; - pub use super::types::{ConfirmationRequest, TransactionModification, U256, TransactionCondition}; + pub use super::types::{ConfirmationRequest, TransactionModification, TransactionCondition}; } diff --git a/rpc/src/v1/tests/eth.rs b/rpc/src/v1/tests/eth.rs index 56398add1..68710ae55 100644 --- a/rpc/src/v1/tests/eth.rs +++ b/rpc/src/v1/tests/eth.rs @@ -26,7 +26,7 @@ use ethcore::spec::{Genesis, Spec}; use ethcore::test_helpers; use ethcore::verification::VerifierType; use ethcore::verification::queue::kind::blocks::Unverified; -use ethereum_types::{H256, Address}; +use ethereum_types::{Address, H256, U256}; use ethjson::blockchain::BlockChain; use ethjson::spec::ForkSpec; use io::IoChannel; @@ -42,7 +42,6 @@ use v1::impls::{EthClient, EthClientOptions, SigningUnsafeClient}; use v1::metadata::Metadata; use v1::tests::helpers::{TestSnapshotService, TestSyncProvider, Config}; use v1::traits::{Eth, EthSigning}; -use v1::types::U256 as NU256; fn account_provider() -> Arc { Arc::new(AccountProvider::transient_provider()) @@ -459,7 +458,7 @@ fn verify_transaction_counts(name: String, chain: BlockChain) { "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": [ - "#.to_owned() + &::serde_json::to_string(&NU256::from(num)).unwrap() + r#" + "#.to_owned() + &::serde_json::to_string(&U256::from(num)).unwrap() + r#" ], "id": "# + format!("{}", *id).as_ref() + r#" }"#; diff --git a/rpc/src/v1/tests/mocked/personal.rs b/rpc/src/v1/tests/mocked/personal.rs index 771abe24e..a2d6b87ce 100644 --- a/rpc/src/v1/tests/mocked/personal.rs +++ b/rpc/src/v1/tests/mocked/personal.rs @@ -18,8 +18,8 @@ use std::sync::Arc; use std::str::FromStr; use bytes::ToPretty; -use ethereum_types::{U256, Address}; use accounts::AccountProvider; +use ethereum_types::{Address, H520, U256}; use ethcore::client::TestBlockChainClient; use jsonrpc_core::IoHandler; use parking_lot::Mutex; @@ -31,7 +31,7 @@ use v1::{PersonalClient, Personal, Metadata}; use v1::helpers::{nonce, eip191}; use v1::helpers::dispatch::{eth_data_hash, FullDispatcher}; use v1::tests::helpers::TestMinerService; -use v1::types::{EIP191Version, PresignedTransaction, H520}; +use v1::types::{EIP191Version, PresignedTransaction}; use rustc_hex::ToHex; use serde_json::to_value; use ethkey::Secret; @@ -156,7 +156,7 @@ fn sign() { let hash = eth_data_hash(data); let signature = H520(tester.accounts.sign(address, Some("password123".into()), hash).unwrap().into_electrum()); - let signature = format!("0x{:?}", signature); + let signature = format!("{:?}", signature); let response = r#"{"jsonrpc":"2.0","result":""#.to_owned() + &signature + r#"","id":1}"#; @@ -264,7 +264,7 @@ fn ec_recover() { let hash = eth_data_hash(data.clone()); let signature = H520(tester.accounts.sign(address, Some("password123".into()), hash).unwrap().into_electrum()); - let signature = format!("0x{:?}", signature); + let signature = format!("{:?}", signature); let request = r#"{ "jsonrpc": "2.0", diff --git a/rpc/src/v1/tests/mocked/secretstore.rs b/rpc/src/v1/tests/mocked/secretstore.rs index fa3cba58f..96e20d002 100644 --- a/rpc/src/v1/tests/mocked/secretstore.rs +++ b/rpc/src/v1/tests/mocked/secretstore.rs @@ -18,6 +18,7 @@ use std::sync::Arc; use crypto::DEFAULT_MAC; use accounts::AccountProvider; +use ethereum_types::H256; use ethkey::{KeyPair, Signature, verify_public}; use serde_json; @@ -26,7 +27,7 @@ use v1::metadata::Metadata; use v1::SecretStoreClient; use v1::traits::secretstore::SecretStore; use v1::helpers::secretstore::ordered_servers_keccak; -use v1::types::{H256, EncryptedDocumentKey}; +use v1::types::EncryptedDocumentKey; struct Dependencies { pub accounts: Arc, diff --git a/rpc/src/v1/tests/mocked/signer.rs b/rpc/src/v1/tests/mocked/signer.rs index dea1f1fb7..e22c5b8d2 100644 --- a/rpc/src/v1/tests/mocked/signer.rs +++ b/rpc/src/v1/tests/mocked/signer.rs @@ -16,7 +16,7 @@ use std::sync::Arc; use std::str::FromStr; -use ethereum_types::{U256, Address}; +use ethereum_types::{H520, U256, Address}; use bytes::ToPretty; use accounts::AccountProvider; @@ -31,7 +31,7 @@ use jsonrpc_core::IoHandler; use v1::{SignerClient, Signer, Origin}; use v1::metadata::Metadata; use v1::tests::helpers::TestMinerService; -use v1::types::{Bytes as RpcBytes, H520}; +use v1::types::Bytes as RpcBytes; use v1::helpers::{nonce, FilledTransactionRequest, ConfirmationPayload}; use v1::helpers::external_signer::{SigningQueue, SignerService}; use v1::helpers::dispatch::{self, FullDispatcher, eth_data_hash}; @@ -495,7 +495,7 @@ fn should_confirm_data_sign_with_signature() { let data_hash = eth_data_hash(vec![1, 2, 3, 4].into()); let signature = H520(tester.accounts.sign(address, Some("test".into()), data_hash).unwrap().into_electrum()); - let signature = format!("0x{:?}", signature); + let signature = format!("{:?}", signature); // when let request = r#"{ diff --git a/rpc/src/v1/tests/mocked/signing_unsafe.rs b/rpc/src/v1/tests/mocked/signing_unsafe.rs index 7e8203857..a91a85ea1 100644 --- a/rpc/src/v1/tests/mocked/signing_unsafe.rs +++ b/rpc/src/v1/tests/mocked/signing_unsafe.rs @@ -210,7 +210,7 @@ fn rpc_eth_send_transaction_with_bad_to() { "id": 1 }"#; - let response = r#"{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params: expected a hex-encoded hash with 0x prefix."},"id":1}"#; + let response = r#"{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params: prefix is missing."},"id":1}"#; assert_eq!(tester.io.handle_request_sync(&request), Some(response.into())); } diff --git a/rpc/src/v1/traits/eth.rs b/rpc/src/v1/traits/eth.rs index 0f0dc48a5..69a37ae52 100644 --- a/rpc/src/v1/traits/eth.rs +++ b/rpc/src/v1/traits/eth.rs @@ -17,10 +17,10 @@ //! Eth rpc interface. use jsonrpc_core::{Result, BoxFuture}; use jsonrpc_derive::rpc; +use ethereum_types::{H64, H160, H256, U64, U256}; use v1::types::{RichBlock, BlockNumber, Bytes, CallRequest, Filter, FilterChanges, Index, EthAccount}; use v1::types::{Log, Receipt, SyncStatus, Transaction, Work}; -use v1::types::{H64, H160, H256, U256, U64}; /// Eth rpc interface. #[rpc] @@ -56,7 +56,7 @@ pub trait Eth { /// Returns current gas_price. #[rpc(name = "eth_gasPrice")] - fn gas_price(&self) -> Result; + fn gas_price(&self) -> BoxFuture; /// Returns accounts list. #[rpc(name = "eth_accounts")] diff --git a/rpc/src/v1/traits/eth_signing.rs b/rpc/src/v1/traits/eth_signing.rs index c272a42e4..72e13ddab 100644 --- a/rpc/src/v1/traits/eth_signing.rs +++ b/rpc/src/v1/traits/eth_signing.rs @@ -19,7 +19,8 @@ use jsonrpc_core::BoxFuture; use jsonrpc_derive::rpc; -use v1::types::{Bytes, H160, H256, H520, TransactionRequest, RichRawTransaction}; +use ethereum_types::{H160, H256, H520}; +use v1::types::{Bytes, TransactionRequest, RichRawTransaction}; /// Signing methods implementation relying on unlocked accounts. #[rpc] diff --git a/rpc/src/v1/traits/parity.rs b/rpc/src/v1/traits/parity.rs index 4303af3d6..e3821355e 100644 --- a/rpc/src/v1/traits/parity.rs +++ b/rpc/src/v1/traits/parity.rs @@ -18,10 +18,11 @@ use std::collections::BTreeMap; +use ethereum_types::{H64, H160, H256, H512, U64, U256}; use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_derive::rpc; use v1::types::{ - H160, H256, H512, U256, U64, H64, Bytes, CallRequest, + Bytes, CallRequest, Peers, Transaction, RpcSettings, Histogram, RecoveredAccount, TransactionStats, LocalTransactionStatus, BlockNumber, ConsensusCapability, VersionInfo, diff --git a/rpc/src/v1/traits/parity_accounts.rs b/rpc/src/v1/traits/parity_accounts.rs index b17e4b8df..eaffac788 100644 --- a/rpc/src/v1/traits/parity_accounts.rs +++ b/rpc/src/v1/traits/parity_accounts.rs @@ -19,9 +19,10 @@ use std::collections::BTreeMap; use jsonrpc_core::Result; use jsonrpc_derive::rpc; +use ethereum_types::{H160, H256, H520}; use ethkey::Password; use ethstore::KeyFile; -use v1::types::{H160, H256, H520, DeriveHash, DeriveHierarchical, ExtAccountInfo}; +use v1::types::{DeriveHash, DeriveHierarchical, ExtAccountInfo}; use v1::types::{AccountInfo, HwAccountInfo}; /// Parity-specific read-only accounts rpc interface. diff --git a/rpc/src/v1/traits/parity_set.rs b/rpc/src/v1/traits/parity_set.rs index b2628f364..c7c233879 100644 --- a/rpc/src/v1/traits/parity_set.rs +++ b/rpc/src/v1/traits/parity_set.rs @@ -16,10 +16,11 @@ //! Parity-specific rpc interface for operations altering the settings. +use ethereum_types::{H160, H256, U256}; use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_derive::rpc; -use v1::types::{Bytes, H160, H256, U256, ReleaseInfo, Transaction}; +use v1::types::{Bytes, ReleaseInfo, Transaction}; /// Parity-specific rpc interface for operations altering the account-related settings. #[rpc] diff --git a/rpc/src/v1/traits/parity_signing.rs b/rpc/src/v1/traits/parity_signing.rs index 26495831a..acd9e8cd6 100644 --- a/rpc/src/v1/traits/parity_signing.rs +++ b/rpc/src/v1/traits/parity_signing.rs @@ -18,7 +18,8 @@ use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_derive::rpc; -use v1::types::{U256, H160, Bytes, ConfirmationResponse, TransactionRequest, Either}; +use ethereum_types::{H160, U256}; +use v1::types::{Bytes, ConfirmationResponse, TransactionRequest, Either}; /// Signing methods implementation. #[rpc] diff --git a/rpc/src/v1/traits/personal.rs b/rpc/src/v1/traits/personal.rs index 25412f664..e3632731f 100644 --- a/rpc/src/v1/traits/personal.rs +++ b/rpc/src/v1/traits/personal.rs @@ -16,10 +16,11 @@ //! Personal rpc interface. use eip_712::EIP712; +use ethereum_types::{H160, H256, H520, U128}; use jsonrpc_core::types::Value; use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_derive::rpc; -use v1::types::{Bytes, U128, H160, H256, H520, TransactionRequest, RichRawTransaction as RpcRichRawTransaction, EIP191Version}; +use v1::types::{Bytes, TransactionRequest, RichRawTransaction as RpcRichRawTransaction, EIP191Version}; /// Personal rpc interface. Safe (read-only) functions. #[rpc] @@ -70,5 +71,4 @@ pub trait Personal { /// @deprecated alias for `personal_sendTransaction`. #[rpc(meta, name = "personal_signAndSendTransaction")] fn sign_and_send_transaction(&self, Self::Metadata, TransactionRequest, String) -> BoxFuture; - } diff --git a/rpc/src/v1/traits/private.rs b/rpc/src/v1/traits/private.rs index b7b871df0..732e3914b 100644 --- a/rpc/src/v1/traits/private.rs +++ b/rpc/src/v1/traits/private.rs @@ -16,10 +16,11 @@ //! SecretStore-specific rpc interface. +use ethereum_types::{H160, H256, U256}; use jsonrpc_core::Error; use jsonrpc_derive::rpc; -use v1::types::{Bytes, PrivateTransactionReceipt, H160, H256, U256, BlockNumber, +use v1::types::{Bytes, PrivateTransactionReceipt, BlockNumber, PrivateTransactionReceiptAndTransaction, CallRequest}; /// Private transaction management RPC interface. diff --git a/rpc/src/v1/traits/secretstore.rs b/rpc/src/v1/traits/secretstore.rs index 8ff1c0e99..6883753b4 100644 --- a/rpc/src/v1/traits/secretstore.rs +++ b/rpc/src/v1/traits/secretstore.rs @@ -17,11 +17,12 @@ //! SecretStore-specific rpc interface. use std::collections::BTreeSet; + use jsonrpc_core::Result; use jsonrpc_derive::rpc; +use ethereum_types::{H160, H256, H512}; use ethkey::Password; - -use v1::types::{H160, H256, H512, Bytes, EncryptedDocumentKey}; +use v1::types::{Bytes, EncryptedDocumentKey}; /// Parity-specific rpc interface. #[rpc] diff --git a/rpc/src/v1/traits/signer.rs b/rpc/src/v1/traits/signer.rs index 675808a98..b5653eba6 100644 --- a/rpc/src/v1/traits/signer.rs +++ b/rpc/src/v1/traits/signer.rs @@ -15,11 +15,13 @@ // along with Parity Ethereum. If not, see . //! Parity Signer-related rpc interface. + +use ethereum_types::U256; use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; use jsonrpc_derive::rpc; -use v1::types::{U256, Bytes, TransactionModification, ConfirmationRequest, ConfirmationResponse, ConfirmationResponseWithToken}; +use v1::types::{Bytes, TransactionModification, ConfirmationRequest, ConfirmationResponse, ConfirmationResponseWithToken}; /// Signer extension for confirmations rpc interface. #[rpc] diff --git a/rpc/src/v1/traits/traces.rs b/rpc/src/v1/traits/traces.rs index 3ac4964bd..5308ed4c6 100644 --- a/rpc/src/v1/traits/traces.rs +++ b/rpc/src/v1/traits/traces.rs @@ -16,9 +16,11 @@ //! Traces specific rpc interface. +use ethereum_types::H256; use jsonrpc_core::Result; use jsonrpc_derive::rpc; -use v1::types::{TraceFilter, LocalizedTrace, BlockNumber, Index, CallRequest, Bytes, TraceResults, TraceResultsWithTransactionHash, H256, TraceOptions}; +use v1::types::{TraceFilter, LocalizedTrace, BlockNumber, Index, CallRequest, Bytes, TraceResults, + TraceResultsWithTransactionHash, TraceOptions}; /// Traces specific rpc interface. #[rpc] diff --git a/rpc/src/v1/traits/web3.rs b/rpc/src/v1/traits/web3.rs index 69d74756e..dd464ee1c 100644 --- a/rpc/src/v1/traits/web3.rs +++ b/rpc/src/v1/traits/web3.rs @@ -15,10 +15,11 @@ // along with Parity Ethereum. If not, see . //! Web3 rpc interface. +use ethereum_types::H256; use jsonrpc_core::Result; use jsonrpc_derive::rpc; -use v1::types::{H256, Bytes}; +use v1::types::Bytes; /// Web3 rpc interface. #[rpc] diff --git a/rpc/src/v1/types/account_info.rs b/rpc/src/v1/types/account_info.rs index a35537b02..6d7585f87 100644 --- a/rpc/src/v1/types/account_info.rs +++ b/rpc/src/v1/types/account_info.rs @@ -16,8 +16,8 @@ //! Return types for RPC calls -use ethereum_types::{Public, Address}; -use v1::types::{H160, H256, U256, Bytes}; +use ethereum_types::{Public, Address, H160, H256, U256}; +use v1::types::Bytes; /// Account information. #[derive(Debug, Default, Clone, PartialEq, Serialize)] diff --git a/rpc/src/v1/types/block.rs b/rpc/src/v1/types/block.rs index b3a6018f6..6e23647a0 100644 --- a/rpc/src/v1/types/block.rs +++ b/rpc/src/v1/types/block.rs @@ -17,11 +17,11 @@ use std::ops::Deref; use std::collections::BTreeMap; +use ethereum_types::{H160, H256, U256, Bloom as H2048}; use serde::ser::Error; use serde::{Serialize, Serializer}; use types::encoded::Header as EthHeader; - -use v1::types::{Bytes, Transaction, H160, H256, H2048, U256}; +use v1::types::{Bytes, Transaction}; /// Block Transactions #[derive(Debug)] @@ -205,8 +205,9 @@ impl Serialize for Rich { #[cfg(test)] mod tests { use std::collections::BTreeMap; + use ethereum_types::{H64, H160, H256, U256, Bloom as H2048}; use serde_json; - use v1::types::{Transaction, H64, H160, H256, H2048, Bytes, U256}; + use v1::types::{Transaction, Bytes}; use super::{Block, RichBlock, BlockTransactions, Header, RichHeader}; #[test] @@ -248,8 +249,8 @@ mod tests { let rich_block = RichBlock { inner: block, extra_info: map![ - "mixHash".into() => format!("0x{:?}", H256::default()), - "nonce".into() => format!("0x{:?}", H64::default()) + "mixHash".into() => format!("{:?}", H256::default()), + "nonce".into() => format!("{:?}", H64::default()) ], }; let serialized_rich_block = serde_json::to_string(&rich_block).unwrap(); @@ -286,8 +287,8 @@ mod tests { let rich_block = RichBlock { inner: block, extra_info: map![ - "mixHash".into() => format!("0x{:?}", H256::default()), - "nonce".into() => format!("0x{:?}", H64::default()) + "mixHash".into() => format!("{:?}", H256::default()), + "nonce".into() => format!("{:?}", H64::default()) ], }; let serialized_rich_block = serde_json::to_string(&rich_block).unwrap(); @@ -321,8 +322,8 @@ mod tests { let rich_header = RichHeader { inner: header, extra_info: map![ - "mixHash".into() => format!("0x{:?}", H256::default()), - "nonce".into() => format!("0x{:?}", H64::default()) + "mixHash".into() => format!("{:?}", H256::default()), + "nonce".into() => format!("{:?}", H64::default()) ], }; let serialized_rich_header = serde_json::to_string(&rich_header).unwrap(); diff --git a/rpc/src/v1/types/call_request.rs b/rpc/src/v1/types/call_request.rs index c26573150..d75e4b1a2 100644 --- a/rpc/src/v1/types/call_request.rs +++ b/rpc/src/v1/types/call_request.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +use ethereum_types::{H160, U256}; use v1::helpers::CallRequest as Request; -use v1::types::{Bytes, H160, U256}; +use v1::types::Bytes; /// Call request #[derive(Debug, Default, PartialEq, Deserialize)] @@ -57,7 +58,7 @@ mod tests { use std::str::FromStr; use rustc_hex::FromHex; use serde_json; - use v1::types::{U256, H160}; + use ethereum_types::{U256, H160}; use super::CallRequest; #[test] diff --git a/rpc/src/v1/types/confirmations.rs b/rpc/src/v1/types/confirmations.rs index 2a62e2cfa..1534fbcea 100644 --- a/rpc/src/v1/types/confirmations.rs +++ b/rpc/src/v1/types/confirmations.rs @@ -21,7 +21,8 @@ use serde::{Serialize, Serializer}; use ansi_term::Colour; use bytes::ToPretty; -use v1::types::{U256, TransactionRequest, RichRawTransaction, H160, H256, H520, Bytes, TransactionCondition, Origin}; +use ethereum_types::{H160, H256, H520, U256}; +use v1::types::{TransactionRequest, RichRawTransaction, Bytes, TransactionCondition, Origin}; use v1::helpers; use ethkey::Password; @@ -281,8 +282,9 @@ impl Serialize for Either where #[cfg(test)] mod tests { use std::str::FromStr; + use ethereum_types::{H256, U256}; use serde_json; - use v1::types::{U256, H256, TransactionCondition}; + use v1::types::TransactionCondition; use v1::helpers; use super::*; diff --git a/rpc/src/v1/types/consensus_status.rs b/rpc/src/v1/types/consensus_status.rs index 15047ed05..a5a5c9de8 100644 --- a/rpc/src/v1/types/consensus_status.rs +++ b/rpc/src/v1/types/consensus_status.rs @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +use ethereum_types::{H160, H256}; use semver; -use v1::types::{H160, H256}; use updater::{self, CapState}; /// Capability info diff --git a/rpc/src/v1/types/derivation.rs b/rpc/src/v1/types/derivation.rs index 4c2f66512..1f2764d9f 100644 --- a/rpc/src/v1/types/derivation.rs +++ b/rpc/src/v1/types/derivation.rs @@ -18,10 +18,9 @@ use std::fmt; use serde::{Deserialize, Deserializer}; use serde::de::{Error, Visitor}; +use ethereum_types::H256; use ethstore; -use super::hash::H256; - /// Type of derivation pub enum DerivationType { /// Soft - allow proof of parent diff --git a/rpc/src/v1/types/eip191.rs b/rpc/src/v1/types/eip191.rs index 16b8536bf..fe3aab4c5 100644 --- a/rpc/src/v1/types/eip191.rs +++ b/rpc/src/v1/types/eip191.rs @@ -15,9 +15,11 @@ // along with Parity Ethereum. If not, see . //! EIP-191 specific types + +use ethereum_types::H160; use serde::{Deserialize, Deserializer}; use serde::de; -use v1::types::{H160, Bytes}; +use v1::types::Bytes; /// EIP-191 version specifier #[derive(Debug)] diff --git a/rpc/src/v1/types/eth_types.rs b/rpc/src/v1/types/eth_types.rs new file mode 100644 index 000000000..606e75924 --- /dev/null +++ b/rpc/src/v1/types/eth_types.rs @@ -0,0 +1,84 @@ +use ethereum_types::{H256, U256}; +use serde_json; + +type Res = Result; + +#[test] +fn should_serialize_u256() { + let serialized1 = serde_json::to_string(&U256::from(0)).unwrap(); + let serialized2 = serde_json::to_string(&U256::from(1)).unwrap(); + let serialized3 = serde_json::to_string(&U256::from(16)).unwrap(); + let serialized4 = serde_json::to_string(&U256::from(256)).unwrap(); + + assert_eq!(serialized1, r#""0x0""#); + assert_eq!(serialized2, r#""0x1""#); + assert_eq!(serialized3, r#""0x10""#); + assert_eq!(serialized4, r#""0x100""#); +} + +#[test] +fn should_serialize_h256() { + let serialized1 = serde_json::to_string(&H256::from(0)).unwrap(); + let serialized2 = serde_json::to_string(&H256::from(1)).unwrap(); + let serialized3 = serde_json::to_string(&H256::from(16)).unwrap(); + let serialized4 = serde_json::to_string(&H256::from(256)).unwrap(); + + assert_eq!(serialized1, r#""0x0000000000000000000000000000000000000000000000000000000000000000""#); + assert_eq!(serialized2, r#""0x0000000000000000000000000000000000000000000000000000000000000001""#); + assert_eq!(serialized3, r#""0x0000000000000000000000000000000000000000000000000000000000000010""#); + assert_eq!(serialized4, r#""0x0000000000000000000000000000000000000000000000000000000000000100""#); +} + +#[test] +fn should_fail_to_deserialize_decimals() { + let deserialized0: Res = serde_json::from_str(r#""∀∂""#); + let deserialized1: Res = serde_json::from_str(r#""""#); + let deserialized2: Res = serde_json::from_str(r#""0""#); + let deserialized3: Res = serde_json::from_str(r#""10""#); + let deserialized4: Res = serde_json::from_str(r#""1000000""#); + let deserialized5: Res = serde_json::from_str(r#""1000000000000000000""#); + let deserialized6: Res = serde_json::from_str(r#""0x""#); + + assert!(deserialized0.is_err()); + assert!(deserialized1.is_err()); + assert!(deserialized2.is_err()); + assert!(deserialized3.is_err()); + assert!(deserialized4.is_err()); + assert!(deserialized5.is_err()); + assert!(deserialized6.is_err(), "Quantities should represent zero as 0x0"); +} + +#[test] +fn should_fail_to_deserialize_bad_hex_strings() { + let deserialized1: Result = serde_json::from_str(r#""0""#); + let deserialized2: Result = serde_json::from_str(r#""0x""#); + let deserialized3: Result = serde_json::from_str(r#""0x∀∂0000000000000000000000000000000000000000000000000000000000""#); + + assert!(deserialized1.is_err(), "hex string should start with 0x"); + assert!(deserialized2.is_err(), "0x-prefixed hex string of length 64"); + assert!(deserialized3.is_err(), "hex string should only contain hex chars"); +} + +#[test] +fn should_deserialize_u256() { + let deserialized1: U256 = serde_json::from_str(r#""0x0""#).unwrap(); + let deserialized2: U256 = serde_json::from_str(r#""0x1""#).unwrap(); + let deserialized3: U256 = serde_json::from_str(r#""0x01""#).unwrap(); + let deserialized4: U256 = serde_json::from_str(r#""0x100""#).unwrap(); + + assert_eq!(deserialized1, 0.into()); + assert_eq!(deserialized2, 1.into()); + assert_eq!(deserialized3, 1.into()); + assert_eq!(deserialized4, 256.into()); +} + +#[test] +fn should_deserialize_h256() { + let deserialized1: H256 = serde_json::from_str(r#""0x0000000000000000000000000000000000000000000000000000000000000000""#).unwrap(); + let deserialized2: H256 = serde_json::from_str(r#""0x0000000000000000000000000000000000000000000000000000000000000001""#).unwrap(); + let deserialized3: H256 = serde_json::from_str(r#""0x0000000000000000000000000000000000000000000000000000000000000100""#).unwrap(); + + assert_eq!(deserialized1, 0.into()); + assert_eq!(deserialized2, 1.into()); + assert_eq!(deserialized3, 256.into()); +} diff --git a/rpc/src/v1/types/filter.rs b/rpc/src/v1/types/filter.rs index dfcf78acf..c6708da57 100644 --- a/rpc/src/v1/types/filter.rs +++ b/rpc/src/v1/types/filter.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +use ethereum_types::{H160, H256}; use jsonrpc_core::{Error as RpcError}; use serde::de::{Error, DeserializeOwned}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; @@ -21,7 +22,7 @@ use serde_json::{Value, from_value}; use types::filter::Filter as EthFilter; use types::ids::BlockId; -use v1::types::{BlockNumber, H160, H256, Log}; +use v1::types::{BlockNumber, Log}; use v1::helpers::errors::invalid_params; /// Variadic value diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs deleted file mode 100644 index 6cdaccf43..000000000 --- a/rpc/src/v1/types/hash.rs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2015-2019 Parity Technologies (UK) Ltd. -// This file is part of Parity Ethereum. - -// Parity Ethereum is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity Ethereum is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity Ethereum. If not, see . - -use std::fmt; -use std::str::FromStr; -use std::cmp::Ordering; -use std::hash::{Hash, Hasher}; -use serde; -use rustc_hex::{ToHex, FromHex}; -use ethereum_types::{H64 as Eth64, H160 as Eth160, H256 as Eth256, H520 as Eth520, H512 as Eth512, Bloom as Eth2048}; - -macro_rules! impl_hash { - ($name: ident, $other: ident, $size: expr) => { - /// Hash serialization - pub struct $name(pub [u8; $size]); - - impl Eq for $name { } - - impl Default for $name { - fn default() -> Self { - $name([0; $size]) - } - } - - impl fmt::Debug for $name { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.0.to_hex()) - } - } - - impl fmt::Display for $name { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let hex = self.0.to_hex(); - write!(f, "{}..{}", &hex[0..2], &hex[$size-2..$size]) - } - } - - impl From for $name where $other: From { - fn from(o: T) -> Self { - $name($other::from(o).0) - } - } - - impl FromStr for $name { - type Err = <$other as FromStr>::Err; - - fn from_str(s: &str) -> Result { - $other::from_str(s).map(|x| $name(x.0)) - } - } - - impl Into<$other> for $name { - fn into(self) -> $other { - $other(self.0) - } - } - - impl PartialEq for $name { - fn eq(&self, other: &Self) -> bool { - let self_ref: &[u8] = &self.0; - let other_ref: &[u8] = &other.0; - self_ref == other_ref - } - } - - impl PartialOrd for $name { - fn partial_cmp(&self, other: &Self) -> Option { - let self_ref: &[u8] = &self.0; - let other_ref: &[u8] = &other.0; - self_ref.partial_cmp(other_ref) - } - } - - impl Ord for $name { - fn cmp(&self, other: &Self) -> Ordering { - let self_ref: &[u8] = &self.0; - let other_ref: &[u8] = &other.0; - self_ref.cmp(other_ref) - } - } - - impl Hash for $name { - fn hash(&self, state: &mut H) where H: Hasher { - let self_ref: &[u8] = &self.0; - Hash::hash(self_ref, state) - } - } - - impl Clone for $name { - fn clone(&self) -> Self { - let mut r = [0; $size]; - r.copy_from_slice(&self.0); - $name(r) - } - } - - impl serde::Serialize for $name { - fn serialize(&self, serializer: S) -> Result - where S: serde::Serializer { - let mut hex = "0x".to_owned(); - hex.push_str(&self.0.to_hex()); - serializer.serialize_str(&hex) - } - } - - impl<'a> serde::Deserialize<'a> for $name { - fn deserialize(deserializer: D) -> Result<$name, D::Error> where D: serde::Deserializer<'a> { - struct HashVisitor; - - impl<'b> serde::de::Visitor<'b> for HashVisitor { - type Value = $name; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "a 0x-prefixed, padded, hex-encoded hash with length {}", $size * 2) - } - - fn visit_str(self, value: &str) -> Result where E: serde::de::Error { - - if value.len() < 2 || !value.starts_with("0x") { - return Err(E::custom("expected a hex-encoded hash with 0x prefix")); - } - if value.len() != 2 + $size * 2 { - return Err(E::invalid_length(value.len() - 2, &self)); - } - - match value[2..].from_hex() { - Ok(ref v) => { - let mut result = [0u8; $size]; - result.copy_from_slice(v); - Ok($name(result)) - }, - Err(e) => Err(E::custom(format!("invalid hex value: {:?}", e))), - } - } - - fn visit_string(self, value: String) -> Result where E: serde::de::Error { - self.visit_str(value.as_ref()) - } - } - - deserializer.deserialize_any(HashVisitor) - } - } - } -} - -impl_hash!(H64, Eth64, 8); -impl_hash!(H160, Eth160, 20); -impl_hash!(H256, Eth256, 32); -impl_hash!(H512, Eth512, 64); -impl_hash!(H520, Eth520, 65); -impl_hash!(H2048, Eth2048, 256); diff --git a/rpc/src/v1/types/histogram.rs b/rpc/src/v1/types/histogram.rs index 5b7ab1bb6..d7f14c514 100644 --- a/rpc/src/v1/types/histogram.rs +++ b/rpc/src/v1/types/histogram.rs @@ -16,7 +16,7 @@ //! Gas prices histogram. -use v1::types::U256; +use ethereum_types::U256; /// Values of RPC settings. #[derive(Serialize, Deserialize)] diff --git a/rpc/src/v1/types/log.rs b/rpc/src/v1/types/log.rs index dd8f3d31c..3dcc8fb29 100644 --- a/rpc/src/v1/types/log.rs +++ b/rpc/src/v1/types/log.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . +use ethereum_types::{H160, H256, U256}; use types::log_entry::{LocalizedLogEntry, LogEntry}; -use v1::types::{Bytes, H160, H256, U256}; +use v1::types::Bytes; /// Log #[derive(Debug, Serialize, PartialEq, Eq, Hash, Clone)] @@ -87,7 +88,8 @@ impl From for Log { mod tests { use serde_json; use std::str::FromStr; - use v1::types::{Log, H160, H256, U256}; + use v1::types::Log; + use ethereum_types::{H160, H256, U256}; #[test] fn log_serialization() { diff --git a/rpc/src/v1/types/mod.rs b/rpc/src/v1/types/mod.rs index 9859bc909..a41f49fab 100644 --- a/rpc/src/v1/types/mod.rs +++ b/rpc/src/v1/types/mod.rs @@ -16,6 +16,9 @@ //! RPC types +#[cfg(test)] +mod eth_types; + mod account_info; mod block; mod block_number; @@ -25,7 +28,6 @@ mod confirmations; mod consensus_status; mod derivation; mod filter; -mod hash; mod histogram; mod index; mod log; @@ -40,7 +42,6 @@ mod trace_filter; mod transaction; mod transaction_request; mod transaction_condition; -mod uint; mod work; mod private_receipt; mod eip191; @@ -60,7 +61,6 @@ pub use self::confirmations::{ pub use self::consensus_status::*; pub use self::derivation::{DeriveHash, DeriveHierarchical, Derive}; pub use self::filter::{Filter, FilterChanges}; -pub use self::hash::{H64, H160, H256, H512, H520, H2048}; pub use self::histogram::Histogram; pub use self::index::Index; pub use self::log::Log; @@ -78,7 +78,6 @@ pub use self::trace_filter::TraceFilter; pub use self::transaction::{Transaction, RichRawTransaction, LocalTransactionStatus}; pub use self::transaction_request::TransactionRequest; pub use self::transaction_condition::TransactionCondition; -pub use self::uint::{U128, U256, U64}; pub use self::work::Work; pub use self::private_receipt::{PrivateTransactionReceipt, PrivateTransactionReceiptAndTransaction}; diff --git a/rpc/src/v1/types/private_receipt.rs b/rpc/src/v1/types/private_receipt.rs index e6170314f..fd0eae067 100644 --- a/rpc/src/v1/types/private_receipt.rs +++ b/rpc/src/v1/types/private_receipt.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . -use v1::types::{H160, H256, TransactionRequest}; use ethcore_private_tx::{Receipt as EthPrivateReceipt}; +use ethereum_types::{H160, H256}; +use v1::types::TransactionRequest; /// Receipt #[derive(Debug, Serialize)] diff --git a/rpc/src/v1/types/provenance.rs b/rpc/src/v1/types/provenance.rs index 2d9301b49..dcdd2408f 100644 --- a/rpc/src/v1/types/provenance.rs +++ b/rpc/src/v1/types/provenance.rs @@ -17,7 +17,7 @@ //! Request Provenance use std::fmt; -use v1::types::H256; +use ethereum_types::H256; /// RPC request origin #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/rpc/src/v1/types/pubsub.rs b/rpc/src/v1/types/pubsub.rs index 179ee0e5c..c526a2b37 100644 --- a/rpc/src/v1/types/pubsub.rs +++ b/rpc/src/v1/types/pubsub.rs @@ -16,10 +16,11 @@ //! Pub-Sub types. +use ethereum_types::H256; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::Error; use serde_json::{Value, from_value}; -use v1::types::{RichHeader, Filter, Log, H256}; +use v1::types::{RichHeader, Filter, Log}; /// Subscription result. #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/rpc/src/v1/types/receipt.rs b/rpc/src/v1/types/receipt.rs index f57c988ff..f440c8f48 100644 --- a/rpc/src/v1/types/receipt.rs +++ b/rpc/src/v1/types/receipt.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . -use v1::types::{Log, H160, H256, H2048, U256, U64}; +use ethereum_types::{H160, H256, U64, U256, Bloom as H2048}; +use v1::types::Log; use types::receipt::{Receipt as EthReceipt, RichReceipt, LocalizedReceipt, TransactionOutcome}; /// Receipt diff --git a/rpc/src/v1/types/secretstore.rs b/rpc/src/v1/types/secretstore.rs index 0de3aaac6..ef76ec5b4 100644 --- a/rpc/src/v1/types/secretstore.rs +++ b/rpc/src/v1/types/secretstore.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . -use v1::types::{Bytes, H512}; +use ethereum_types::H512; +use v1::types::Bytes; /// Encrypted document key. #[derive(Default, Debug, Serialize, PartialEq)] @@ -22,7 +23,7 @@ use v1::types::{Bytes, H512}; pub struct EncryptedDocumentKey { /// Common encryption point. Pass this to Secret Store 'Document key storing session' pub common_point: H512, - /// Ecnrypted point. Pass this to Secret Store 'Document key storing session'. + /// Encrypted point. Pass this to Secret Store 'Document key storing session'. pub encrypted_point: H512, /// Document key itself, encrypted with passed account public. Pass this to 'secretstore_encrypt'. pub encrypted_key: Bytes, diff --git a/rpc/src/v1/types/sync.rs b/rpc/src/v1/types/sync.rs index e51c853ad..10094742c 100644 --- a/rpc/src/v1/types/sync.rs +++ b/rpc/src/v1/types/sync.rs @@ -16,9 +16,10 @@ use network::client_version::ClientVersion; use std::collections::BTreeMap; + +use ethereum_types::{U256, H512}; use sync::{self, PeerInfo as SyncPeerInfo, TransactionStats as SyncTransactionStats}; use serde::{Serialize, Serializer}; -use v1::types::{U256, H512}; /// Sync info #[derive(Default, Debug, Serialize, PartialEq)] diff --git a/rpc/src/v1/types/trace.rs b/rpc/src/v1/types/trace.rs index 209523d3f..715ffe62c 100644 --- a/rpc/src/v1/types/trace.rs +++ b/rpc/src/v1/types/trace.rs @@ -19,14 +19,14 @@ use std::collections::BTreeMap; use ethcore::client::Executed; use ethcore::trace as et; use ethcore::trace::{FlatTrace, LocalizedTrace as EthLocalizedTrace, trace, TraceError}; -use ethereum_types::H256 as EthH256; +use ethereum_types::{H160, H256, U256}; use serde::ser::SerializeStruct; use serde::{Serialize, Serializer}; use types::account_diff; use types::state_diff; use vm; -use v1::types::{Bytes, H160, H256, U256}; +use v1::types::Bytes; #[derive(Debug, Serialize)] /// A diff of some chunk of memory. @@ -639,8 +639,8 @@ pub struct TraceResultsWithTransactionHash { pub transaction_hash: H256, } -impl From<(EthH256, Executed)> for TraceResultsWithTransactionHash { - fn from(t: (EthH256, Executed)) -> Self { +impl From<(H256, Executed)> for TraceResultsWithTransactionHash { + fn from(t: (H256, Executed)) -> Self { TraceResultsWithTransactionHash { output: t.1.output.into(), trace: t.1.trace.into_iter().map(Into::into).collect(), diff --git a/rpc/src/v1/types/trace_filter.rs b/rpc/src/v1/types/trace_filter.rs index d5ef60f47..a455c3d1c 100644 --- a/rpc/src/v1/types/trace_filter.rs +++ b/rpc/src/v1/types/trace_filter.rs @@ -18,7 +18,8 @@ use ethcore::client::BlockId; use ethcore::client; -use v1::types::{BlockNumber, H160}; +use ethereum_types::H160; +use v1::types::BlockNumber; /// Trace filter #[derive(Debug, PartialEq, Deserialize)] diff --git a/rpc/src/v1/types/transaction.rs b/rpc/src/v1/types/transaction.rs index dc7d6b5a1..72b591a89 100644 --- a/rpc/src/v1/types/transaction.rs +++ b/rpc/src/v1/types/transaction.rs @@ -19,9 +19,10 @@ use std::sync::Arc; use serde::{Serialize, Serializer}; use serde::ser::SerializeStruct; use ethcore::{contract_address, CreateContractAddress}; +use ethereum_types::{H160, H256, H512, U64, U256}; use miner; use types::transaction::{LocalizedTransaction, Action, PendingTransaction, SignedTransaction}; -use v1::types::{Bytes, H160, H256, U256, H512, U64, TransactionCondition}; +use v1::types::{Bytes, TransactionCondition}; /// Transaction #[derive(Debug, Default, Clone, PartialEq, Serialize)] diff --git a/rpc/src/v1/types/transaction_request.rs b/rpc/src/v1/types/transaction_request.rs index e7a2126b4..a4698cafa 100644 --- a/rpc/src/v1/types/transaction_request.rs +++ b/rpc/src/v1/types/transaction_request.rs @@ -16,7 +16,8 @@ //! `TransactionRequest` type -use v1::types::{Bytes, H160, U256, TransactionCondition}; +use ethereum_types::{H160, U256}; +use v1::types::{Bytes, TransactionCondition}; use v1::helpers; use ansi_term::Colour; @@ -137,7 +138,8 @@ mod tests { use std::str::FromStr; use rustc_hex::FromHex; use serde_json; - use v1::types::{U256, H160, TransactionCondition}; + use v1::types::TransactionCondition; + use ethereum_types::{H160, U256}; use super::*; #[test] diff --git a/rpc/src/v1/types/uint.rs b/rpc/src/v1/types/uint.rs deleted file mode 100644 index 3c5801c07..000000000 --- a/rpc/src/v1/types/uint.rs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2015-2019 Parity Technologies (UK) Ltd. -// This file is part of Parity Ethereum. - -// Parity Ethereum is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity Ethereum is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity Ethereum. If not, see . - -use std::str::FromStr; -use std::fmt; -use serde; -use ethereum_types::{U256 as EthU256, U128 as EthU128}; - -macro_rules! impl_uint { - ($name: ident, $other: ident, $size: expr) => { - /// Uint serialization. - #[derive(Debug, Default, Clone, Copy, PartialEq, Hash)] - pub struct $name($other); - - impl Eq for $name { } - - impl From for $name where $other: From { - fn from(o: T) -> Self { - $name($other::from(o)) - } - } - - impl FromStr for $name { - type Err = <$other as FromStr>::Err; - - fn from_str(s: &str) -> Result { - $other::from_str(s).map($name) - } - } - - impl Into<$other> for $name { - fn into(self) -> $other { - self.0 - } - } - - impl fmt::Display for $name { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.0) - } - } - - impl fmt::LowerHex for $name { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::LowerHex::fmt(&self.0, f) - } - } - - impl<'a> serde::Deserialize<'a> for $name { - fn deserialize(deserializer: D) -> Result<$name, D::Error> - where D: serde::Deserializer<'a> { - struct UintVisitor; - - impl<'b> serde::de::Visitor<'b> for UintVisitor { - type Value = $name; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "a 0x-prefixed, hex-encoded number of length {}", $size*16) - } - - fn visit_str(self, value: &str) -> Result where E: serde::de::Error { - if value.len() < 2 || !value.starts_with("0x") { - return Err(E::custom("expected a hex-encoded numbers with 0x prefix")) - } - - // 0x + len - if value.len() > 2 + $size * 16 { - return Err(E::invalid_length(value.len() - 2, &self)); - } - - $other::from_str(&value[2..]).map($name).map_err(|e| E::custom(&format!("invalid hex value: {:?}", e))) - } - - fn visit_string(self, value: String) -> Result where E: serde::de::Error { - self.visit_str(&value) - } - } - - deserializer.deserialize_any(UintVisitor) - } - } - - } -} - -impl_uint!(U128, EthU128, 2); -impl_uint!(U256, EthU256, 4); -impl_uint!(U64, u64, 1); - -impl serde::Serialize for U128 { - fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { - serializer.serialize_str(&format!("{:#x}", self)) - } -} - -impl serde::Serialize for U256 { - fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { - serializer.serialize_str(&format!("{:#x}", self)) - } -} - -impl serde::Serialize for U64 { - fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { - serializer.serialize_str(&format!("{:#x}", self)) - } -} - -#[cfg(test)] -mod tests { - use super::U256; - use serde_json; - - type Res = Result; - - #[test] - fn should_serialize_u256() { - let serialized1 = serde_json::to_string(&U256(0.into())).unwrap(); - let serialized2 = serde_json::to_string(&U256(1.into())).unwrap(); - let serialized3 = serde_json::to_string(&U256(16.into())).unwrap(); - let serialized4 = serde_json::to_string(&U256(256.into())).unwrap(); - - assert_eq!(serialized1, r#""0x0""#); - assert_eq!(serialized2, r#""0x1""#); - assert_eq!(serialized3, r#""0x10""#); - assert_eq!(serialized4, r#""0x100""#); - } - - #[test] - fn should_fail_to_deserialize_decimals() { - let deserialized0: Res = serde_json::from_str(r#""∀∂""#); - let deserialized1: Res = serde_json::from_str(r#""""#); - let deserialized2: Res = serde_json::from_str(r#""0""#); - let deserialized3: Res = serde_json::from_str(r#""10""#); - let deserialized4: Res = serde_json::from_str(r#""1000000""#); - let deserialized5: Res = serde_json::from_str(r#""1000000000000000000""#); - - assert!(deserialized0.is_err()); - assert!(deserialized1.is_err()); - assert!(deserialized2.is_err()); - assert!(deserialized3.is_err()); - assert!(deserialized4.is_err()); - assert!(deserialized5.is_err()); - } - - #[test] - fn should_deserialize_u256() { - let deserialized1: U256 = serde_json::from_str(r#""0x""#).unwrap(); - let deserialized2: U256 = serde_json::from_str(r#""0x0""#).unwrap(); - let deserialized3: U256 = serde_json::from_str(r#""0x1""#).unwrap(); - let deserialized4: U256 = serde_json::from_str(r#""0x01""#).unwrap(); - let deserialized5: U256 = serde_json::from_str(r#""0x100""#).unwrap(); - - assert_eq!(deserialized1, U256(0.into())); - assert_eq!(deserialized2, U256(0.into())); - assert_eq!(deserialized3, U256(1.into())); - assert_eq!(deserialized4, U256(1.into())); - assert_eq!(deserialized5, U256(256.into())); - } -} diff --git a/rpc/src/v1/types/work.rs b/rpc/src/v1/types/work.rs index b7c312162..ed6c7c8e9 100644 --- a/rpc/src/v1/types/work.rs +++ b/rpc/src/v1/types/work.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . -use super::{H256, U256}; +use ethereum_types::{H256, U256}; use serde::{Serialize, Serializer};