From 69b36a70415b1888da91628bf82eca316bbfdcbd Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 8 May 2019 16:26:30 +0200 Subject: [PATCH 01/90] cargo upgrade "ethereum-types" --all --allow-prerelease --- Cargo.lock | 193 ++++++++++++++++++----- Cargo.toml | 2 +- accounts/Cargo.toml | 2 +- accounts/ethkey/Cargo.toml | 2 +- accounts/ethstore/Cargo.toml | 2 +- accounts/fake-hardware-wallet/Cargo.toml | 2 +- accounts/hw/Cargo.toml | 2 +- cli-signer/Cargo.toml | 2 +- cli-signer/rpc-client/Cargo.toml | 2 +- ethash/Cargo.toml | 2 +- ethcore/Cargo.toml | 2 +- ethcore/blockchain/Cargo.toml | 2 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 2 +- ethcore/evm/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 2 +- ethcore/node-filter/Cargo.toml | 2 +- ethcore/private-tx/Cargo.toml | 2 +- ethcore/service/Cargo.toml | 2 +- ethcore/sync/Cargo.toml | 2 +- ethcore/types/Cargo.toml | 2 +- ethcore/vm/Cargo.toml | 2 +- ethcore/wasm/Cargo.toml | 2 +- ethcore/wasm/run/Cargo.toml | 2 +- evmbin/Cargo.toml | 2 +- ipfs/Cargo.toml | 2 +- json/Cargo.toml | 2 +- miner/Cargo.toml | 2 +- miner/stratum/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- secret-store/Cargo.toml | 2 +- updater/Cargo.toml | 2 +- updater/hash-fetch/Cargo.toml | 2 +- util/EIP-712/Cargo.toml | 2 +- util/dir/Cargo.toml | 2 +- util/fastmap/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 2 +- util/keccak-hasher/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 2 +- util/network/Cargo.toml | 2 +- util/patricia-trie-ethereum/Cargo.toml | 2 +- util/triehash-ethereum/Cargo.toml | 2 +- whisper/Cargo.toml | 2 +- 43 files changed, 193 insertions(+), 84 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5578689eb04..f50f2449314 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -261,7 +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)", + "ethereum-types 0.5.3-beta.1 (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", @@ -300,7 +300,7 @@ dependencies = [ name = "common-types" version = "0.1.0" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -542,7 +542,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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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", ] @@ -569,7 +569,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -676,7 +676,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.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.6 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -699,6 +699,18 @@ dependencies = [ "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethbloom" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crunchy 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.3.2 (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)", +] + [[package]] name = "ethcore" version = "1.12.0" @@ -724,7 +736,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-stratum 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "evm 0.1.0", @@ -780,7 +792,7 @@ name = "ethcore-accounts" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-hardware-wallet 0.0.1", @@ -802,7 +814,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -832,7 +844,7 @@ name = "ethcore-call-contract" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -841,7 +853,7 @@ name = "ethcore-db" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -879,7 +891,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -938,7 +950,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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -967,7 +979,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -991,7 +1003,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -1031,7 +1043,7 @@ dependencies = [ "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "fetch 0.1.0", @@ -1070,7 +1082,7 @@ dependencies = [ "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -1108,7 +1120,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1121,7 +1133,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -1144,7 +1156,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", "ethcore-private-tx 1.0.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fastmap 0.1.0", @@ -1180,6 +1192,19 @@ dependencies = [ "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethereum-types" +version = "0.5.3-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ethbloom 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "primitive-types 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ethereum-types-serialize" version = "0.2.2" @@ -1192,7 +1217,7 @@ dependencies = [ name = "ethjson" version = "0.1.0" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1206,7 +1231,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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", @@ -1240,7 +1265,7 @@ name = "ethstore" version = "0.2.1" dependencies = [ "dir 0.1.2", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1284,7 +1309,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1305,7 +1330,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -1362,7 +1387,7 @@ dependencies = [ name = "fake-hardware-wallet" version = "0.0.1" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", ] @@ -1375,7 +1400,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fastmap" version = "0.1.0" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1412,6 +1437,18 @@ dependencies = [ "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fixed-hash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fixedbitset" version = "0.1.9" @@ -1548,7 +1585,7 @@ dependencies = [ name = "hardware-wallet" version = "1.12.0" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -1728,6 +1765,31 @@ dependencies = [ "xmltree 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "impl-codec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "impl-rlp" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "impl-serde" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "indexmap" version = "1.0.2" @@ -1828,7 +1890,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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -1985,7 +2047,7 @@ dependencies = [ name = "keccak-hasher" version = "0.1.1" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -2348,7 +2410,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2498,6 +2560,15 @@ dependencies = [ "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parity-codec" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parity-crypto" version = "0.3.0" @@ -2548,7 +2619,7 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-service 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-fetch 0.0.1", @@ -2604,7 +2675,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -2626,7 +2697,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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -2695,7 +2766,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.1", @@ -2742,7 +2813,7 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -2809,7 +2880,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2852,7 +2923,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -2951,7 +3022,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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", @@ -3097,6 +3168,18 @@ dependencies = [ "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "primitive-types" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "proc-macro2" version = "0.4.20" @@ -3124,7 +3207,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3662,6 +3745,11 @@ name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "static_assertions" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "stats" version = "0.1.0" @@ -4150,7 +4238,7 @@ dependencies = [ name = "triehash-ethereum" version = "0.2.0" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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)", ] @@ -4186,6 +4274,17 @@ dependencies = [ "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "uint" +version = "0.7.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)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unexpected" version = "0.1.0" @@ -4323,7 +4422,7 @@ name = "vm" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4374,7 +4473,7 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.3-beta.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4579,7 +4678,9 @@ 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 ethbloom 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "779ebef70385607b3d547ac506e07d882c516663d0f326156efcd14a96a85a0a" "checksum ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e742184dc63a01c8ea0637369f8faa27c40f537949908a237f95c05e68d2c96" +"checksum ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)" = "896dd9df9d3b28bcb9bbb79ec7c6bc11e590d2c5b5d06dcfba658ff90e9b845b" "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" @@ -4587,6 +4688,7 @@ dependencies = [ "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" +"checksum fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" @@ -4618,6 +4720,9 @@ dependencies = [ "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" "checksum igd 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a254e265e8810deb357a9de757f784787ec415d056ededf410c0aa460afee9e" +"checksum impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b" +"checksum impl-rlp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc1023f8632c284e03d9d055721c66c0c19abf5fe34af297a5c69f78d65a5fd" +"checksum impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5158079de9d4158e0ce1de3ae0bd7be03904efc40b3d7dd8b8c301cbf6b52b56" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "26746cbc2e680af687e88d717f20ff90079bd10fc984ad57d277cd0e37309fa5" "checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" @@ -4694,6 +4799,7 @@ dependencies = [ "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" +"checksum parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dcb43c05fb71c03b4ea7327bf15694da1e0f23f19d5b1e95bab6c6d74097e336" "checksum parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b9db194dfbcfe3b398d63d765437a5c7232d59906e203055f0e993f6458ff1" "checksum parity-daemonize 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "69b1910b2793ff52713fca0a4ee92544ebec59ccd218ea74560be6f947b4ca77" "checksum parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5962540f99d3895d9addf535f37ab1397886bc2c68e59efd040ef458e5f8c3f7" @@ -4724,6 +4830,7 @@ dependencies = [ "checksum primal-check 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1" "checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" "checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" +"checksum primitive-types 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99d5a5fe9d93ddb394e2fb3fc49d0e31acb475fd45a30eeb8f3e76b767ecb7e1" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" "checksum protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "52fbc45bf6709565e44ef31847eb7407b3c3c80af811ee884a04da071dcca12b" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" @@ -4789,6 +4896,7 @@ dependencies = [ "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" @@ -4842,6 +4950,7 @@ dependencies = [ "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" "checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" +"checksum uint 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91bb295c2c53c54742a6b8acb705114f6dfdf3c42becdb146a662cb77fcc0d02" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" diff --git a/Cargo.toml b/Cargo.toml index 2851bc97c99..d87e0760f97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ ethcore-network = { path = "util/network" } ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-service = { path = "ethcore/service" } ethcore-sync = { path = "ethcore/sync" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } node-filter = { path = "ethcore/node-filter" } diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index 072593cd104..89250df44bd 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -24,5 +24,5 @@ hardware-wallet = { path = "hw" } fake-hardware-wallet = { path = "fake-hardware-wallet" } [dev-dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" tempdir = "0.3" diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index ec784bd11d7..9f4273bcbea 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -8,7 +8,7 @@ byteorder = "1.0" edit-distance = "2.0" parity-crypto = "0.3.0" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" lazy_static = "1.0" log = "0.4" memzero = { path = "../../util/memzero" } diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 4563a803276..86d003e5bf5 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -17,7 +17,7 @@ time = "0.1.34" itertools = "0.5" parking_lot = "0.7" parity-crypto = "0.3.0" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" dir = { path = "../../util/dir" } smallvec = "0.6" parity-wordlist = "1.0" diff --git a/accounts/fake-hardware-wallet/Cargo.toml b/accounts/fake-hardware-wallet/Cargo.toml index 5e20d8a6d31..72983eeddf6 100644 --- a/accounts/fake-hardware-wallet/Cargo.toml +++ b/accounts/fake-hardware-wallet/Cargo.toml @@ -6,5 +6,5 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethkey = { path = "../../accounts/ethkey" } diff --git a/accounts/hw/Cargo.toml b/accounts/hw/Cargo.toml index ae7f0a655c5..4852e24b76d 100644 --- a/accounts/hw/Cargo.toml +++ b/accounts/hw/Cargo.toml @@ -14,7 +14,7 @@ hidapi = { git = "https://github.com/paritytech/hidapi-rs" } libusb = { git = "https://github.com/paritytech/libusb-rs" } trezor-sys = { git = "https://github.com/paritytech/trezor-sys" } ethkey = { path = "../ethkey" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" semver = "0.9" [dev-dependencies] diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index 11dd06107e2..44b442da12b 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -7,7 +7,7 @@ name = "cli-signer" version = "1.4.0" [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" 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 53ec983391e..7ea10f8a417 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -7,7 +7,7 @@ name = "parity-rpc-client" version = "1.4.0" [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" futures = "0.1" log = "0.4" serde = "1.0" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index 929895aca78..67e697ed6ce 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1.0" either = "1.0.0" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" keccak-hash = "0.1" log = "0.4" memmap = "0.6" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index e8f158ba421..ac0f095bb48 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -26,7 +26,7 @@ ethcore-db = { path = "./db" } ethcore-io = { path = "../util/io" } ethcore-miner = { path = "../miner" } ethcore-stratum = { path = "../miner/stratum", optional = true } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } evm = { path = "evm" } diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index a2636975705..7ec3ad2b1b2 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -12,7 +12,7 @@ ansi_term = "0.10" blooms-db = { path = "../../util/blooms-db" } common-types = { path = "../types" } ethcore-db = { path = "../db" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" heapsize = "0.4" itertools = "0.5" kvdb = "0.1" diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index 068434a1dec..3ccc013d135 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -7,5 +7,5 @@ edition = "2018" [dependencies] types = { path = "../types", package = "common-types" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" bytes = { version = "0.1", package = "parity-bytes" } diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index 53ec9f7b881..5ce01d79c63 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] common-types = { path = "../types" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" heapsize = "0.4" kvdb = "0.1" parking_lot = "0.7" diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index e40c7485f9a..44835596424 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] bit-set = "0.4" parity-bytes = "0.1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" heapsize = "0.4" lazy_static = "1.0" log = "0.4" diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index e53d29a4666..5061fed258b 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../types" } ethcore = { path = ".."} ethcore-db = { path = "../db" } ethcore-blockchain = { path = "../blockchain" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" memory-db = "0.11.0" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index bd184685259..2a4ec678b5d 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] ethcore = { path = ".."} ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" log = "0.4" parking_lot = "0.7" ethabi = "6.0" diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 2ce127a8b7a..3575f1bcb13 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -15,7 +15,7 @@ ethcore = { path = ".." } ethcore-call-contract = { path = "../call-contract" } ethcore-io = { path = "../../util/io" } ethcore-miner = { path = "../../miner" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } fetch = { path = "../../util/fetch" } diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index 7db0ad2770b..ec656d83d61 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -11,7 +11,7 @@ ethcore-blockchain = { path = "../blockchain" } ethcore-io = { path = "../../util/io" } ethcore-private-tx = { path = "../private-tx" } ethcore-sync = { path = "../sync" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" kvdb = "0.1" log = "0.4" trace-time = "0.1" diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 3cbb5b98398..995a9a562b8 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -15,7 +15,7 @@ ethcore-io = { path = "../../util/io" } ethcore-light = { path = "../light" } ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethkey = { path = "../../accounts/ethkey" } ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index e3f9bd1db63..725d8f8bba0 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -5,7 +5,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 19b84a6ecc2..d2723649c69 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" parity-bytes = "0.1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" diff --git a/ethcore/wasm/Cargo.toml b/ethcore/wasm/Cargo.toml index 02aa978d7b6..4b32f99af44 100644 --- a/ethcore/wasm/Cargo.toml +++ b/ethcore/wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" log = "0.4" parity-wasm = "0.31" libc = "0.2" diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml index 9260d1eee83..c7679d1135b 100644 --- a/ethcore/wasm/run/Cargo.toml +++ b/ethcore/wasm/run/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] serde = "1" serde_json = "1" serde_derive = "1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethjson = { path = "../../../json" } vm = { path = "../../vm" } wasm = { path = "../" } diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index 95b532366cd..5bd8b280e48 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../ethcore/types" } docopt = "1.0" env_logger = "0.5" ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethjson = { path = "../json" } evm = { path = "../ethcore/evm" } panic_hook = { path = "../util/panic-hook" } diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 23dc8d68987..848060382fd 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } parity-bytes = "0.1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" jsonrpc-core = "10.0.1" jsonrpc-http-server = "10.0.1" rlp = { version = "0.3.0", features = ["ethereum"] } diff --git a/json/Cargo.toml b/json/Cargo.toml index 2a6d8c7f36b..f0db7ae6a9f 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" rustc-hex = "1.0" serde = "1.0" serde_json = "1.0" diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 4a017653ba4..5baabd4aeae 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -21,7 +21,7 @@ ethabi = "6.0" ethabi-derive = "6.0" ethabi-contract = "6.0" ethcore-call-contract = { path = "../ethcore/call-contract" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" futures = "0.1" heapsize = "0.4" keccak-hash = "0.1" diff --git a/miner/stratum/Cargo.toml b/miner/stratum/Cargo.toml index a7e13ef681c..d9a3c72e4dd 100644 --- a/miner/stratum/Cargo.toml +++ b/miner/stratum/Cargo.toml @@ -6,7 +6,7 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" keccak-hash = "0.1" jsonrpc-core = "10.0.1" jsonrpc-tcp-server = "10.0.1" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 33559a55954..af55a1c8072 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -44,7 +44,7 @@ ethcore-miner = { path = "../miner" } ethcore-network = { path = "../util/network" } ethcore-private-tx = { path = "../ethcore/private-tx" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" fastmap = { path = "../util/fastmap" } parity-bytes = "0.1" parity-crypto = "0.3.0" diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index edf329706d0..3eba8712982 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -15,7 +15,7 @@ ethcore = { path = "../ethcore" } ethcore-accounts = { path = "../accounts", optional = true} ethcore-call-contract = { path = "../ethcore/call-contract" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethkey = { path = "../accounts/ethkey" } futures = "0.1" hyper = { version = "0.12", default-features = false } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index dd3417f880d..28000a780e5 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -12,7 +12,7 @@ ethabi-contract = "6.0" ethabi-derive = "6.0" ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" keccak-hash = "0.1" lazy_static = "1.0" log = "0.4" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index 1c5477c06eb..66c0554f7b6 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -15,7 +15,7 @@ rand = "0.4" rustc-hex = "1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" parity-runtime = { path = "../../util/runtime" } keccak-hash = "0.1" registrar = { path = "../../util/registrar" } diff --git a/util/EIP-712/Cargo.toml b/util/EIP-712/Cargo.toml index baf0bfc89bc..c7577bb99d2 100644 --- a/util/EIP-712/Cargo.toml +++ b/util/EIP-712/Cargo.toml @@ -16,7 +16,7 @@ serde = "1.0" serde_json = "1.0" ethabi = "6.0" keccak-hash = "0.1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" failure = "0.1" itertools = "0.7" lazy_static = "1.1" diff --git a/util/dir/Cargo.toml b/util/dir/Cargo.toml index 836eb3ecc6d..860f3f80147 100644 --- a/util/dir/Cargo.toml +++ b/util/dir/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] license = "GPL3" [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" journaldb = { path = "../journaldb" } app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } home = "0.3" diff --git a/util/fastmap/Cargo.toml b/util/fastmap/Cargo.toml index 371eebe9761..45eaed652a5 100644 --- a/util/fastmap/Cargo.toml +++ b/util/fastmap/Cargo.toml @@ -6,5 +6,5 @@ description = "Specialized version of `HashMap` with H256 keys and fast hashing license = "GPL-3.0" [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" plain_hasher = "0.2" diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 045b42d6628..9f12669eae0 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL3" [dependencies] parity-bytes = "0.1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" hash-db = "0.11.0" heapsize = "0.4" keccak-hasher = { path = "../keccak-hasher" } diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index edeecda8331..f59359295b9 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -6,7 +6,7 @@ description = "Keccak-256 implementation of the Hasher trait" license = "GPL-3.0" [dependencies] -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" tiny-keccak = "1.4.2" hash-db = "0.11.0" plain_hasher = "0.2" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index 8bf402e206e..ddf5a05f637 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -23,7 +23,7 @@ ethcore-io = { path = "../io", features = ["mio"] } parity-bytes = "0.1" parity-crypto = "0.3.0" ethcore-network = { path = "../network" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethkey = { path = "../../accounts/ethkey" } rlp = { version = "0.3.0", features = ["ethereum"] } parity-path = "0.1" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index b7077f7aea6..b3d412dea9e 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] error-chain = { version = "0.12", default-features = false } parity-crypto = "0.3.0" ethcore-io = { path = "../io" } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethkey = { path = "../../accounts/ethkey" } ipnetwork = "0.12.6" lazy_static = "1.0" diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index 8cb8664a5ed..c1cd2d68a67 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -11,7 +11,7 @@ keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } hash-db = "0.11.0" rlp = "0.3.0" parity-bytes = "0.1" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" elastic-array = "0.10" [dev-dependencies] diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index 5b636429753..9c03d6529ce 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -7,5 +7,5 @@ license = "GPL-3.0" [dependencies] triehash = { version = "0.4.0", features = ["ethereum"] } -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" keccak-hasher = { path = "../keccak-hasher" } diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index 97aa8f23ac3..d2251768eed 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -7,7 +7,7 @@ description = "Whisper Protocol implementation for Parity" [dependencies] bitflags = "0.9" byteorder = "1.0.0" -ethereum-types = "0.4" +ethereum-types = "0.5.3-beta.1" ethcore-network = { path = "../util/network" } parity-crypto = "0.3.0" ethkey = { path = "../accounts/ethkey" } From cad3e1735d2bdbe7c976dd4ac5559be41231acd8 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 8 May 2019 17:05:36 +0200 Subject: [PATCH 02/90] [ethash] fix compilation errors --- ethash/src/lib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ethash/src/lib.rs b/ethash/src/lib.rs index e40c08920cf..a42b59bd8c9 100644 --- a/ethash/src/lib.rs +++ b/ethash/src/lib.rs @@ -52,14 +52,14 @@ mod progpow; pub use cache::{NodeCacheBuilder, OptimizeFor}; pub use compute::{ProofOfWork, quick_get_difficulty, slow_hash_block_number}; use compute::Light; -use ethereum_types::{U256, U512}; +use ethereum_types::{BigEndianHash, U256, U512}; use keccak::H256; use parking_lot::Mutex; pub use seed_compute::SeedHashCompute; pub use shared::ETHASH_EPOCH_LENGTH; use std::mem; use std::path::{Path, PathBuf}; - +use std::convert::TryFrom; use std::sync::Arc; struct LightCache { @@ -161,12 +161,12 @@ impl EthashManager { /// Convert an Ethash boundary to its original difficulty. Basically just `f(x) = 2^256 / x`. pub fn boundary_to_difficulty(boundary: ðereum_types::H256) -> U256 { - difficulty_to_boundary_aux(&**boundary) + difficulty_to_boundary_aux(&boundary.into_uint()) } /// Convert an Ethash difficulty to the target boundary. Basically just `f(x) = 2^256 / x`. pub fn difficulty_to_boundary(difficulty: &U256) -> ethereum_types::H256 { - difficulty_to_boundary_aux(difficulty).into() + BigEndianHash::from_uint(&difficulty_to_boundary_aux(difficulty)) } fn difficulty_to_boundary_aux>(difficulty: T) -> ethereum_types::U256 { @@ -177,8 +177,9 @@ fn difficulty_to_boundary_aux>(difficulty: T) -> ethereum_types::U if difficulty == U512::one() { U256::max_value() } else { - // difficulty > 1, so result should never overflow 256 bits - U256::from((U512::one() << 256) / difficulty) + const PROOF: &str = "difficulty > 1, so result should never overflow 256 bits; qed"; + // TODO: ok() is a hacky workaround for `primitive_types::Error` not being `std::fmt::Debug` + U256::try_from((U512::one() << 256) / difficulty).ok().expect(PROOF) } } From 68916b9ca15a56900b5fc4f15fb6796a2a4bc7b8 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 10 May 2019 19:43:50 +0200 Subject: [PATCH 03/90] [ethkey] fix compilation errors --- accounts/ethkey/src/brain_prefix.rs | 2 +- accounts/ethkey/src/crypto.rs | 10 +++--- accounts/ethkey/src/extended.rs | 49 +++++++++++++++-------------- accounts/ethkey/src/keypair.rs | 15 +++++---- accounts/ethkey/src/math.rs | 6 ++-- accounts/ethkey/src/prefix.rs | 2 +- accounts/ethkey/src/secret.rs | 2 +- accounts/ethkey/src/signature.rs | 41 ++++++++++++++++++------ 8 files changed, 74 insertions(+), 53 deletions(-) diff --git a/accounts/ethkey/src/brain_prefix.rs b/accounts/ethkey/src/brain_prefix.rs index ba0d8129615..e6c5cb74bca 100644 --- a/accounts/ethkey/src/brain_prefix.rs +++ b/accounts/ethkey/src/brain_prefix.rs @@ -47,7 +47,7 @@ impl Generator for BrainPrefix { for _ in 0..self.iterations { let phrase = wordlist::random_phrase(self.no_of_words); let keypair = Brain::new(phrase.clone()).generate().unwrap(); - if keypair.address().starts_with(&self.prefix) { + if keypair.address().as_ref().starts_with(&self.prefix) { self.last_phrase = phrase; return Ok(keypair) } diff --git a/accounts/ethkey/src/crypto.rs b/accounts/ethkey/src/crypto.rs index ec883dcb6d9..c2da84ecb87 100644 --- a/accounts/ethkey/src/crypto.rs +++ b/accounts/ethkey/src/crypto.rs @@ -57,7 +57,7 @@ pub mod ecdh { }; let publ = key::PublicKey::from_slice(context, &pdata)?; - let sec = key::SecretKey::from_slice(context, &secret)?; + let sec = key::SecretKey::from_slice(context, secret.as_bytes())?; let shared = ecdh::SharedSecret::new_raw(context, &publ, &sec); Secret::from_unsafe_slice(&shared[0..32]) @@ -89,12 +89,12 @@ pub mod ecies { msg[0] = 0x04u8; { let msgd = &mut msg[1..]; - msgd[0..64].copy_from_slice(r.public()); + msgd[0..64].copy_from_slice(r.public().as_bytes()); let iv = H128::random(); - msgd[64..80].copy_from_slice(&iv); + msgd[64..80].copy_from_slice(iv.as_bytes()); { let cipher = &mut msgd[(64 + 16)..(64 + 16 + plain.len())]; - aes::encrypt_128_ctr(ekey, &iv, plain, cipher)?; + aes::encrypt_128_ctr(ekey, iv.as_bytes(), plain, cipher)?; } let mut hmac = hmac::Signer::with(&mkey); { @@ -156,7 +156,7 @@ pub mod ecies { let mut hasher = digest::Hasher::sha256(); let ctrs = [(ctr >> 24) as u8, (ctr >> 16) as u8, (ctr >> 8) as u8, ctr as u8]; hasher.update(&ctrs); - hasher.update(secret); + hasher.update(secret.as_bytes()); hasher.update(s1); let d = hasher.finish(); &mut dest[written..(written + 32)].copy_from_slice(&d); diff --git a/accounts/ethkey/src/extended.rs b/accounts/ethkey/src/extended.rs index 7d02271ebbd..9f382f89ed8 100644 --- a/accounts/ethkey/src/extended.rs +++ b/accounts/ethkey/src/extended.rs @@ -64,7 +64,7 @@ impl Label for H256 { fn len() -> usize { 32 } fn store(&self, target: &mut [u8]) { - self.copy_to(&mut target[0..32]); + (&mut target[0..32]).copy_from_slice(self.as_bytes()); } } @@ -180,7 +180,7 @@ impl ExtendedKeyPair { pub fn with_seed(seed: &[u8]) -> Result { let (master_key, chain_code) = derivation::seed_pair(seed); Ok(ExtendedKeyPair::with_secret( - Secret::from_unsafe_slice(&*master_key).map_err(|_| DerivationError::InvalidSeed)?, + Secret::from_unsafe_slice(master_key.as_bytes()).map_err(|_| DerivationError::InvalidSeed)?, chain_code, )) } @@ -208,12 +208,13 @@ impl ExtendedKeyPair { // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki mod derivation { use parity_crypto::hmac; - use ethereum_types::{U256, U512, H512, H256}; + use ethereum_types::{BigEndianHash, U256, U512, H512, H256}; use secp256k1::key::{SecretKey, PublicKey}; use SECP256K1; use keccak; use math::curve_order; use super::{Label, Derivation}; + use std::convert::TryInto; #[derive(Debug)] pub enum Error { @@ -237,18 +238,18 @@ mod derivation { } fn hmac_pair(data: &[u8], private_key: H256, chain_code: H256) -> (H256, H256) { - let private: U256 = private_key.into(); + let private: U256 = private_key.into_uint(); // produces 512-bit derived hmac (I) - let skey = hmac::SigKey::sha512(&*chain_code); + let skey = hmac::SigKey::sha512(chain_code.as_bytes()); let i_512 = hmac::sign(&skey, &data[..]); // left most 256 bits are later added to original private key - let hmac_key: U256 = H256::from_slice(&i_512[0..32]).into(); + let hmac_key: U256 = H256::from_slice(&i_512[0..32]).into_uint(); // right most 256 bits are new chain code for later derivations - let next_chain_code = H256::from(&i_512[32..64]); + let next_chain_code = H256::from_slice(&i_512[32..64]); - let child_key = private_add(hmac_key, private).into(); + let child_key = BigEndianHash::from_uint(&private_add(hmac_key, private)); (child_key, next_chain_code) } @@ -257,7 +258,7 @@ mod derivation { fn private_soft(private_key: H256, chain_code: H256, index: T) -> (H256, H256) where T: Label { let mut data = vec![0u8; 33 + T::len()]; - let sec_private = SecretKey::from_slice(&SECP256K1, &*private_key) + let sec_private = SecretKey::from_slice(&SECP256K1, private_key.as_bytes()) .expect("Caller should provide valid private key"); let sec_public = PublicKey::from_secret_key(&SECP256K1, &sec_private) .expect("Caller should provide valid private key"); @@ -276,7 +277,7 @@ mod derivation { // corresponding public keys of the original and derived private keys fn private_hard(private_key: H256, chain_code: H256, index: T) -> (H256, H256) where T: Label { let mut data: Vec = vec![0u8; 33 + T::len()]; - let private: U256 = private_key.into(); + let private: U256 = private_key.into_uint(); // 0x00 (padding) -- private_key -- index // 0 -- 1..33 -- 33..end @@ -293,9 +294,9 @@ mod derivation { // todo: surely can be optimized fn modulo(u1: U512, u2: U256) -> U256 { - let dv = u1 / U512::from(u2); - let md = u1 - (dv * U512::from(u2)); - md.into() + let m = u1 % U512::from(u2); + // TODO: remove ok() + m.try_into().ok().expect("U512 modulo U256 should fit into U256; qed") } pub fn public(public_key: H512, chain_code: H256, derivation: Derivation) -> Result<(H512, H256), Error> where T: Label { @@ -306,7 +307,7 @@ mod derivation { let mut public_sec_raw = [0u8; 65]; public_sec_raw[0] = 4; - public_sec_raw[1..65].copy_from_slice(&*public_key); + public_sec_raw[1..65].copy_from_slice(public_key.as_bytes()); let public_sec = PublicKey::from_slice(&SECP256K1, &public_sec_raw).map_err(|_| Error::InvalidPoint)?; let public_serialized = public_sec.serialize_vec(&SECP256K1, true); @@ -317,15 +318,15 @@ mod derivation { index.store(&mut data[33..(33 + T::len())]); // HMAC512SHA produces [derived private(256); new chain code(256)] - let skey = hmac::SigKey::sha512(&*chain_code); + let skey = hmac::SigKey::sha512(chain_code.as_bytes()); let i_512 = hmac::sign(&skey, &data[..]); - let new_private = H256::from(&i_512[0..32]); - let new_chain_code = H256::from(&i_512[32..64]); + let new_private = H256::from_slice(&i_512[0..32]); + let new_chain_code = H256::from_slice(&i_512[32..64]); // Generated private key can (extremely rarely) be out of secp256k1 key field - if curve_order() <= new_private.clone().into() { return Err(Error::MissingIndex); } - let new_private_sec = SecretKey::from_slice(&SECP256K1, &*new_private) + if curve_order() <= new_private.into_uint() { return Err(Error::MissingIndex); } + let new_private_sec = SecretKey::from_slice(&SECP256K1, new_private.as_bytes()) .expect("Private key belongs to the field [0..CURVE_ORDER) (checked above); So initializing can never fail; qed"); let mut new_public = PublicKey::from_secret_key(&SECP256K1, &new_private_sec) .expect("Valid private key produces valid public key"); @@ -337,7 +338,7 @@ mod derivation { let serialized = new_public.serialize_vec(&SECP256K1, false); Ok(( - H512::from(&serialized[1..65]), + H512::from_slice(&serialized[1..65]), new_chain_code, )) } @@ -348,18 +349,18 @@ mod derivation { pub fn chain_code(secret: H256) -> H256 { // 10,000 rounds of sha3 - let mut running_sha3 = sha3(&*secret); - for _ in 0..99999 { running_sha3 = sha3(&*running_sha3); } + let mut running_sha3 = sha3(secret.as_bytes()); + for _ in 0..99999 { running_sha3 = sha3(running_sha3.as_bytes()); } running_sha3 } pub fn point(secret: H256) -> Result { - let sec = SecretKey::from_slice(&SECP256K1, &*secret) + let sec = SecretKey::from_slice(&SECP256K1, secret.as_bytes()) .map_err(|_| Error::InvalidPoint)?; let public_sec = PublicKey::from_secret_key(&SECP256K1, &sec) .map_err(|_| Error::InvalidPoint)?; let serialized = public_sec.serialize_vec(&SECP256K1, false); - Ok(H512::from(&serialized[1..65])) + Ok(H512::from_slice(&serialized[1..65])) } pub fn seed_pair(seed: &[u8]) -> (H256, H256) { diff --git a/accounts/ethkey/src/keypair.rs b/accounts/ethkey/src/keypair.rs index 2919f0cfb79..714e6c85da4 100644 --- a/accounts/ethkey/src/keypair.rs +++ b/accounts/ethkey/src/keypair.rs @@ -16,14 +16,13 @@ use std::fmt; use secp256k1::key; -use rustc_hex::ToHex; -use keccak::Keccak256; use super::{Secret, Public, Address, SECP256K1, Error}; +use parity_crypto::Keccak256 as _; pub fn public_to_address(public: &Public) -> Address { let hash = public.keccak256(); let mut result = Address::default(); - result.copy_from_slice(&hash[12..]); + result.as_bytes_mut().copy_from_slice(&hash[12..]); result } @@ -36,9 +35,9 @@ pub struct KeyPair { impl fmt::Display for KeyPair { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - writeln!(f, "secret: {}", self.secret.to_hex())?; - writeln!(f, "public: {}", self.public.to_hex())?; - write!(f, "address: {}", self.address().to_hex()) + writeln!(f, "secret: {:x}", self.secret)?; + writeln!(f, "public: {:x}", self.public)?; + write!(f, "address: {:x}", self.address()) } } @@ -51,7 +50,7 @@ impl KeyPair { let serialized = pub_key.serialize_vec(context, false); let mut public = Public::default(); - public.copy_from_slice(&serialized[1..65]); + public.as_bytes_mut().copy_from_slice(&serialized[1..65]); let keypair = KeyPair { secret: secret, @@ -70,7 +69,7 @@ impl KeyPair { let serialized = publ.serialize_vec(context, false); let secret = Secret::from(sec); let mut public = Public::default(); - public.copy_from_slice(&serialized[1..65]); + public.as_bytes_mut().copy_from_slice(&serialized[1..65]); KeyPair { secret: secret, diff --git a/accounts/ethkey/src/math.rs b/accounts/ethkey/src/math.rs index 8c3fe650df6..5025efeb654 100644 --- a/accounts/ethkey/src/math.rs +++ b/accounts/ethkey/src/math.rs @@ -17,7 +17,7 @@ use super::{SECP256K1, Public, Secret, Error}; use secp256k1::key; use secp256k1::constants::{GENERATOR_X, GENERATOR_Y, CURVE_ORDER}; -use ethereum_types::{U256, H256}; +use ethereum_types::{BigEndianHash as _, U256, H256}; /// Whether the public key is valid. pub fn public_is_valid(public: &Public) -> bool { @@ -78,7 +78,7 @@ pub fn generation_point() -> Public { /// Return secp256k1 elliptic curve order pub fn curve_order() -> U256 { - H256::from_slice(&CURVE_ORDER).into() + H256::from_slice(&CURVE_ORDER).into_uint() } fn to_secp256k1_public(public: &Public) -> Result { @@ -93,7 +93,7 @@ fn to_secp256k1_public(public: &Public) -> Result { fn set_public(public: &mut Public, key_public: &key::PublicKey) { let key_public_serialized = key_public.serialize_vec(&SECP256K1, false); - public.copy_from_slice(&key_public_serialized[1..65]); + public.as_bytes_mut().copy_from_slice(&key_public_serialized[1..65]); } #[cfg(test)] diff --git a/accounts/ethkey/src/prefix.rs b/accounts/ethkey/src/prefix.rs index 6695e93c50e..fe4f1692f60 100644 --- a/accounts/ethkey/src/prefix.rs +++ b/accounts/ethkey/src/prefix.rs @@ -37,7 +37,7 @@ impl Generator for Prefix { fn generate(&mut self) -> Result { for _ in 0..self.iterations { let keypair = Random.generate()?; - if keypair.address().starts_with(&self.prefix) { + if keypair.address().as_ref().starts_with(&self.prefix) { return Ok(keypair) } } diff --git a/accounts/ethkey/src/secret.rs b/accounts/ethkey/src/secret.rs index 84e849cabc5..56197188170 100644 --- a/accounts/ethkey/src/secret.rs +++ b/accounts/ethkey/src/secret.rs @@ -60,7 +60,7 @@ impl Secret { return None } let mut h = H256::default(); - h.copy_from_slice(&key[0..32]); + h.as_bytes_mut().copy_from_slice(&key[0..32]); Some(Secret { inner: Memzero::from(h) }) } diff --git a/accounts/ethkey/src/signature.rs b/accounts/ethkey/src/signature.rs index cc712df6904..f99d6f5e581 100644 --- a/accounts/ethkey/src/signature.rs +++ b/accounts/ethkey/src/signature.rs @@ -68,24 +68,44 @@ impl Signature { /// Create a signature object from the sig. pub fn from_rsv(r: &H256, s: &H256, v: u8) -> Self { let mut sig = [0u8; 65]; - sig[0..32].copy_from_slice(&r); - sig[32..64].copy_from_slice(&s); + sig[0..32].copy_from_slice(r.as_ref()); + sig[32..64].copy_from_slice(s.as_ref()); sig[64] = v; Signature(sig) } /// Check if this is a "low" signature. pub fn is_low_s(&self) -> bool { - H256::from_slice(self.s()) <= "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0".into() + // "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" + const MASK: H256 = H256([ + 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D, + 0xDF, 0xE9, 0x2F, 0x46, 0x68, 0x1B, 0x20, 0xA0, + ]); + H256::from_slice(self.s()) <= MASK } /// Check if each component of the signature is in range. pub fn is_valid(&self) -> bool { + // "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141" + const MASK: H256 = H256([ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b, + 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41, + ]); + const ONE: H256 = H256([ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + ]); + let r = H256::from_slice(self.r()); + let s = H256::from_slice(self.s()); self.v() <= 1 && - H256::from_slice(self.r()) < "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141".into() && - H256::from_slice(self.r()) >= 1.into() && - H256::from_slice(self.s()) < "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141".into() && - H256::from_slice(self.s()) >= 1.into() + r < MASK && r >= ONE && + s < MASK && s >= ONE } } @@ -190,7 +210,7 @@ impl DerefMut for Signature { pub fn sign(secret: &Secret, message: &Message) -> Result { let context = &SECP256K1; - let sec = SecretKey::from_slice(context, &secret)?; + let sec = SecretKey::from_slice(context, secret.as_ref())?; let s = context.sign_recoverable(&SecpMessage::from_slice(&message[..])?, &sec)?; let (rec_id, data) = s.serialize_compact(context); let mut data_arr = [0; 65]; @@ -208,7 +228,8 @@ pub fn verify_public(public: &Public, signature: &Signature, message: &Message) let pdata: [u8; 65] = { let mut temp = [4u8; 65]; - temp[1..65].copy_from_slice(&**public); + // TODO(review): verify byte order, why was it &**public before? + temp[1..65].copy_from_slice(public.as_bytes()); temp }; @@ -233,7 +254,7 @@ pub fn recover(signature: &Signature, message: &Message) -> Result Date: Fri, 10 May 2019 20:01:53 +0200 Subject: [PATCH 04/90] [journaldb] fix compilation errors --- util/journaldb/src/archivedb.rs | 12 ++++++------ util/journaldb/src/earlymergedb.rs | 24 ++++++++++++++---------- util/journaldb/src/overlaydb.rs | 6 +++--- util/journaldb/src/overlayrecentdb.rs | 16 +++++++++------- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/util/journaldb/src/archivedb.rs b/util/journaldb/src/archivedb.rs index a068919a780..6dd1504eb4f 100644 --- a/util/journaldb/src/archivedb.rs +++ b/util/journaldb/src/archivedb.rs @@ -60,7 +60,7 @@ impl ArchiveDB { } fn payload(&self, key: &H256) -> Option { - self.backing.get(self.column, key).expect("Low-level database error. Some issue with your hard disk?") + self.backing.get(self.column, key.as_bytes()).expect("Low-level database error. Some issue with your hard disk?") } } @@ -138,7 +138,7 @@ impl JournalDB for ArchiveDB { for i in self.overlay.drain() { let (key, (value, rc)) = i; if rc > 0 { - batch.put(self.column, &key, &value); + batch.put(self.column, key.as_bytes(), &value); inserts += 1; } if rc < 0 { @@ -166,18 +166,18 @@ impl JournalDB for ArchiveDB { for i in self.overlay.drain() { let (key, (value, rc)) = i; if rc > 0 { - if self.backing.get(self.column, &key)?.is_some() { + if self.backing.get(self.column, key.as_bytes())?.is_some() { return Err(error_key_already_exists(&key)); } - batch.put(self.column, &key, &value); + batch.put(self.column, key.as_bytes(), &value); inserts += 1; } if rc < 0 { assert!(rc == -1); - if self.backing.get(self.column, &key)?.is_none() { + if self.backing.get(self.column, key.as_bytes())?.is_none() { return Err(error_negatively_reference_hash(&key)); } - batch.delete(self.column, &key); + batch.delete(self.column, key.as_bytes()); deletes += 1; } } diff --git a/util/journaldb/src/earlymergedb.rs b/util/journaldb/src/earlymergedb.rs index 2a55200c496..19be462f6b5 100644 --- a/util/journaldb/src/earlymergedb.rs +++ b/util/journaldb/src/earlymergedb.rs @@ -129,7 +129,8 @@ impl EarlyMergeDB { } fn morph_key(key: &H256, index: u8) -> Bytes { - let mut ret = (&**key).to_owned(); + // TODO(review): verify byte order + let mut ret = key.as_bytes().to_owned(); ret.push(index); ret } @@ -152,7 +153,8 @@ impl EarlyMergeDB { }, Entry::Vacant(entry) => { // this is the first entry for this node in the journal. - let in_archive = backing.get(col, h).expect("Low-level database error. Some issue with your hard disk?").is_some(); + let in_archive = backing.get(col, h.as_bytes()) + .expect("Low-level database error. Some issue with your hard disk?").is_some(); if in_archive { // already in the backing DB. start counting, and remember it was already in. Self::set_already_in(batch, col, h); @@ -162,7 +164,7 @@ impl EarlyMergeDB { //Self::reset_already_in(&h); assert!(!Self::is_already_in(backing, col, h)); trace!(target: "jdb.fine", " insert({}): New to queue, not in DB: Inserting into queue and DB", h); - batch.put(col, h, d); + batch.put(col, h.as_bytes(), d); } entry.insert(RefInfo { queue_refs: 1, @@ -227,7 +229,7 @@ impl EarlyMergeDB { }, (1, false) => { entry.remove(); - batch.delete(col, h); + batch.delete(col, h.as_bytes()); trace!(target: "jdb.fine", " remove({}): Not in archive, only 1 ref in queue: Removing from queue and DB", h); }, _ => panic!("Invalid value in refs: {:?}", entry.get()), @@ -236,7 +238,7 @@ impl EarlyMergeDB { Entry::Vacant(_entry) => { // Gets removed when moving from 1 to 0 additional refs. Should never be here at 0 additional refs. //assert!(!Self::is_already_in(db, &h)); - batch.delete(col, h); + batch.delete(col, h.as_bytes()); trace!(target: "jdb.fine", " remove({}): Not in queue - MUST BE IN ARCHIVE: Removing from DB", h); }, } @@ -258,7 +260,9 @@ impl EarlyMergeDB { } fn payload(&self, key: &H256) -> Option { - self.backing.get(self.column, key).expect("Low-level database error. Some issue with your hard disk?") + self.backing + .get(self.column, key.as_bytes()) + .expect("Low-level database error. Some issue with your hard disk?") } fn read_refs(db: &KeyValueDB, col: Option) -> (Option, HashMap) { @@ -499,16 +503,16 @@ impl JournalDB for EarlyMergeDB { match rc { 0 => {} 1 => { - if self.backing.get(self.column, &key)?.is_some() { + if self.backing.get(self.column, key.as_bytes())?.is_some() { return Err(error_key_already_exists(&key)); } - batch.put(self.column, &key, &value) + batch.put(self.column, key.as_bytes(), &value) } -1 => { - if self.backing.get(self.column, &key)?.is_none() { + if self.backing.get(self.column, key.as_bytes())?.is_none() { return Err(error_negatively_reference_hash(&key)); } - batch.delete(self.column, &key) + batch.delete(self.column, key.as_bytes()) } _ => panic!("Attempted to inject invalid state."), } diff --git a/util/journaldb/src/overlaydb.rs b/util/journaldb/src/overlaydb.rs index 757a92e6219..2e7dc34ca3a 100644 --- a/util/journaldb/src/overlaydb.rs +++ b/util/journaldb/src/overlaydb.rs @@ -138,7 +138,7 @@ impl OverlayDB { /// Get the refs and value of the given key. fn payload(&self, key: &H256) -> Option { - self.backing.get(self.column, key) + self.backing.get(self.column, key.as_bytes()) .expect("Low-level database error. Some issue with your hard disk?") .map(|ref d| decode(d).expect("decoding db value failed") ) } @@ -146,10 +146,10 @@ impl OverlayDB { /// Put the refs and value of the given key, possibly deleting it from the db. fn put_payload_in_batch(&self, batch: &mut DBTransaction, key: &H256, payload: &Payload) -> bool { if payload.count > 0 { - batch.put(self.column, key, &encode(payload)); + batch.put(self.column, key.as_bytes(), &encode(payload)); false } else { - batch.delete(self.column, key); + batch.delete(self.column, key.as_bytes()); true } } diff --git a/util/journaldb/src/overlayrecentdb.rs b/util/journaldb/src/overlayrecentdb.rs index a48e59d91f3..6487dffda6b 100644 --- a/util/journaldb/src/overlayrecentdb.rs +++ b/util/journaldb/src/overlayrecentdb.rs @@ -176,7 +176,9 @@ impl OverlayRecentDB { } fn payload(&self, key: &H256) -> Option { - self.backing.get(self.column, key).expect("Low-level database error. Some issue with your hard disk?") + self.backing + .get(self.column, key.as_bytes()) + .expect("Low-level database error. Some issue with your hard disk?") } fn read_overlay(db: &KeyValueDB, col: Option) -> JournalOverlay { @@ -238,7 +240,7 @@ impl OverlayRecentDB { #[inline] fn to_short_key(key: &H256) -> H256 { - let mut k = H256::new(); + let mut k = H256::zero(); k[0..DB_PREFIX_LEN].copy_from_slice(&key[0..DB_PREFIX_LEN]); k } @@ -403,7 +405,7 @@ impl JournalDB for OverlayRecentDB { // apply canon inserts first for (k, v) in canon_insertions { - batch.put(self.column, &k, &v); + batch.put(self.column, k.as_bytes(), &v); journal_overlay.pending_overlay.insert(to_short_key(&k), v); } // update the overlay @@ -415,7 +417,7 @@ impl JournalDB for OverlayRecentDB { // apply canon deletions for k in canon_deletions { if !journal_overlay.backing_overlay.contains(&to_short_key(&k)) { - batch.delete(self.column, &k); + batch.delete(self.column, k.as_bytes()); } } } @@ -441,13 +443,13 @@ impl JournalDB for OverlayRecentDB { match rc { 0 => {} _ if rc > 0 => { - batch.put(self.column, &key, &value) + batch.put(self.column, key.as_bytes(), &value) } -1 => { - if cfg!(debug_assertions) && self.backing.get(self.column, &key)?.is_none() { + if cfg!(debug_assertions) && self.backing.get(self.column, key.as_bytes())?.is_none() { return Err(error_negatively_reference_hash(&key)); } - batch.delete(self.column, &key) + batch.delete(self.column, key.as_bytes()) } _ => panic!("Attempted to inject invalid state ({})", rc), } From fdd6da420e54acb209bbf68d13bc5f60c3f93352 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 10 May 2019 20:09:05 +0200 Subject: [PATCH 05/90] [dir] fix compilation errors --- util/dir/src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/util/dir/src/lib.rs b/util/dir/src/lib.rs index fa7882cdd3e..90384777dc3 100644 --- a/util/dir/src/lib.rs +++ b/util/dir/src/lib.rs @@ -157,7 +157,12 @@ impl DatabaseDirectories { /// Base DB directory for the given fork. // TODO: remove in 1.7 pub fn legacy_fork_path(&self) -> PathBuf { - Path::new(&self.legacy_path).join(format!("{:x}{}", H64::from(self.genesis_hash), self.fork_name.as_ref().map(|f| format!("-{}", f)).unwrap_or_default())) + let gh = H64::from_slice(&self.genesis_hash.as_bytes()[..8]); + Path::new(&self.legacy_path).join(format!( + "{:x}{}", + gh, + self.fork_name.as_ref().map(|f| format!("-{}", f)).unwrap_or_default() + )) } /// Spec root directory for the given fork. @@ -172,7 +177,9 @@ impl DatabaseDirectories { /// DB root path, named after genesis hash pub fn db_root_path(&self) -> PathBuf { - self.spec_root_path().join("db").join(format!("{:x}", H64::from(self.genesis_hash))) + // TODO(review): verify + let gh = H64::from_slice(&self.genesis_hash.as_bytes()[..8]); + self.spec_root_path().join("db").join(format!("{:x}", gh)) } /// DB path From f889d7b09d722b8b75816f2f4eba2d6359166f29 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 13 May 2019 14:19:16 +0200 Subject: [PATCH 06/90] [ethabi] update to 0.7 --- Cargo.toml | 2 +- accounts/Cargo.toml | 2 +- accounts/ethkey/Cargo.toml | 2 +- accounts/ethstore/Cargo.toml | 2 +- accounts/fake-hardware-wallet/Cargo.toml | 2 +- accounts/hw/Cargo.toml | 2 +- cli-signer/Cargo.toml | 2 +- cli-signer/rpc-client/Cargo.toml | 2 +- ethash/Cargo.toml | 2 +- ethcore/Cargo.toml | 8 ++++---- ethcore/blockchain/Cargo.toml | 2 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 2 +- ethcore/evm/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 2 +- ethcore/node-filter/Cargo.toml | 8 ++++---- ethcore/private-tx/Cargo.toml | 8 ++++---- ethcore/service/Cargo.toml | 2 +- ethcore/sync/Cargo.toml | 2 +- ethcore/types/Cargo.toml | 2 +- ethcore/vm/Cargo.toml | 2 +- ethcore/wasm/Cargo.toml | 2 +- ethcore/wasm/run/Cargo.toml | 2 +- evmbin/Cargo.toml | 2 +- ipfs/Cargo.toml | 2 +- json/Cargo.toml | 2 +- miner/Cargo.toml | 8 ++++---- miner/stratum/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- secret-store/Cargo.toml | 8 ++++---- updater/Cargo.toml | 8 ++++---- updater/hash-fetch/Cargo.toml | 8 ++++---- util/EIP-712/Cargo.toml | 4 ++-- util/dir/Cargo.toml | 2 +- util/fastmap/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 2 +- util/keccak-hasher/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 2 +- util/network/Cargo.toml | 2 +- util/patricia-trie-ethereum/Cargo.toml | 2 +- util/registrar/Cargo.toml | 6 +++--- util/triehash-ethereum/Cargo.toml | 2 +- whisper/Cargo.toml | 2 +- 43 files changed, 67 insertions(+), 67 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d87e0760f97..e0ee58bf017 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ ethcore-network = { path = "util/network" } ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-service = { path = "ethcore/service" } ethcore-sync = { path = "ethcore/sync" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } node-filter = { path = "ethcore/node-filter" } diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index 89250df44bd..b9c0995ee94 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -24,5 +24,5 @@ hardware-wallet = { path = "hw" } fake-hardware-wallet = { path = "fake-hardware-wallet" } [dev-dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" tempdir = "0.3" diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index 9f4273bcbea..1100a80d13c 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -8,7 +8,7 @@ byteorder = "1.0" edit-distance = "2.0" parity-crypto = "0.3.0" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" lazy_static = "1.0" log = "0.4" memzero = { path = "../../util/memzero" } diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 86d003e5bf5..7e532bb265c 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -17,7 +17,7 @@ time = "0.1.34" itertools = "0.5" parking_lot = "0.7" parity-crypto = "0.3.0" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" dir = { path = "../../util/dir" } smallvec = "0.6" parity-wordlist = "1.0" diff --git a/accounts/fake-hardware-wallet/Cargo.toml b/accounts/fake-hardware-wallet/Cargo.toml index 72983eeddf6..432fc826820 100644 --- a/accounts/fake-hardware-wallet/Cargo.toml +++ b/accounts/fake-hardware-wallet/Cargo.toml @@ -6,5 +6,5 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethkey = { path = "../../accounts/ethkey" } diff --git a/accounts/hw/Cargo.toml b/accounts/hw/Cargo.toml index 4852e24b76d..844f48e98f9 100644 --- a/accounts/hw/Cargo.toml +++ b/accounts/hw/Cargo.toml @@ -14,7 +14,7 @@ hidapi = { git = "https://github.com/paritytech/hidapi-rs" } libusb = { git = "https://github.com/paritytech/libusb-rs" } trezor-sys = { git = "https://github.com/paritytech/trezor-sys" } ethkey = { path = "../ethkey" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" semver = "0.9" [dev-dependencies] diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index 44b442da12b..ce621062657 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -7,7 +7,7 @@ name = "cli-signer" version = "1.4.0" [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" 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 7ea10f8a417..2a5262738f5 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -7,7 +7,7 @@ name = "parity-rpc-client" version = "1.4.0" [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" futures = "0.1" log = "0.4" serde = "1.0" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index 67e697ed6ce..e42fe9b558f 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1.0" either = "1.0.0" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" keccak-hash = "0.1" log = "0.4" memmap = "0.6" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index ac0f095bb48..fe1ab726173 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -15,9 +15,9 @@ common-types = { path = "types" } crossbeam = "0.4" derive_more = "0.14.0" env_logger = { version = "0.5", optional = true } -ethabi = "6.0" -ethabi-contract = "6.0" -ethabi-derive = "6.0" +ethabi = "7.0.0" +ethabi-contract = "7.0.0" +ethabi-derive = "7.0.0" ethash = { path = "../ethash" } ethcore-blockchain = { path = "./blockchain" } ethcore-bloom-journal = { path = "../util/bloom" } @@ -26,7 +26,7 @@ ethcore-db = { path = "./db" } ethcore-io = { path = "../util/io" } ethcore-miner = { path = "../miner" } ethcore-stratum = { path = "../miner/stratum", optional = true } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } evm = { path = "evm" } diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index 7ec3ad2b1b2..c809ba1d484 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -12,7 +12,7 @@ ansi_term = "0.10" blooms-db = { path = "../../util/blooms-db" } common-types = { path = "../types" } ethcore-db = { path = "../db" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" heapsize = "0.4" itertools = "0.5" kvdb = "0.1" diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index 3ccc013d135..e91b143012b 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -7,5 +7,5 @@ edition = "2018" [dependencies] types = { path = "../types", package = "common-types" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" bytes = { version = "0.1", package = "parity-bytes" } diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index 5ce01d79c63..459c582c1a1 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] common-types = { path = "../types" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" heapsize = "0.4" kvdb = "0.1" parking_lot = "0.7" diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 44835596424..b47193cc5ba 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] bit-set = "0.4" parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" heapsize = "0.4" lazy_static = "1.0" log = "0.4" diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 5061fed258b..ff675e08748 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../types" } ethcore = { path = ".."} ethcore-db = { path = "../db" } ethcore-blockchain = { path = "../blockchain" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" memory-db = "0.11.0" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index 2a4ec678b5d..b4855d92606 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -10,12 +10,12 @@ authors = ["Parity Technologies "] ethcore = { path = ".."} ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" log = "0.4" parking_lot = "0.7" -ethabi = "6.0" -ethabi-derive = "6.0" -ethabi-contract = "6.0" +ethabi = "7.0.0" +ethabi-derive = "7.0.0" +ethabi-contract = "7.0.0" lru-cache = "0.1" [dev-dependencies] diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 3575f1bcb13..c1f27852c0e 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -8,14 +8,14 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../types" } derive_more = "0.14.0" -ethabi = "6.0" -ethabi-contract = "6.0" -ethabi-derive = "6.0" +ethabi = "7.0.0" +ethabi-contract = "7.0.0" +ethabi-derive = "7.0.0" ethcore = { path = ".." } ethcore-call-contract = { path = "../call-contract" } ethcore-io = { path = "../../util/io" } ethcore-miner = { path = "../../miner" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } fetch = { path = "../../util/fetch" } diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index ec656d83d61..ad4c9b15416 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -11,7 +11,7 @@ ethcore-blockchain = { path = "../blockchain" } ethcore-io = { path = "../../util/io" } ethcore-private-tx = { path = "../private-tx" } ethcore-sync = { path = "../sync" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" kvdb = "0.1" log = "0.4" trace-time = "0.1" diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 995a9a562b8..69cf7ad2494 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -15,7 +15,7 @@ ethcore-io = { path = "../../util/io" } ethcore-light = { path = "../light" } ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethkey = { path = "../../accounts/ethkey" } ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index 725d8f8bba0..ded641f8738 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -5,7 +5,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index d2723649c69..81b34989285 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" diff --git a/ethcore/wasm/Cargo.toml b/ethcore/wasm/Cargo.toml index 4b32f99af44..d2c6d80d91d 100644 --- a/ethcore/wasm/Cargo.toml +++ b/ethcore/wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" log = "0.4" parity-wasm = "0.31" libc = "0.2" diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml index c7679d1135b..b77b9507c09 100644 --- a/ethcore/wasm/run/Cargo.toml +++ b/ethcore/wasm/run/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] serde = "1" serde_json = "1" serde_derive = "1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethjson = { path = "../../../json" } vm = { path = "../../vm" } wasm = { path = "../" } diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index 5bd8b280e48..bcc6bdff1b5 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../ethcore/types" } docopt = "1.0" env_logger = "0.5" ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethjson = { path = "../json" } evm = { path = "../ethcore/evm" } panic_hook = { path = "../util/panic-hook" } diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 848060382fd..61d3fa90831 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" jsonrpc-core = "10.0.1" jsonrpc-http-server = "10.0.1" rlp = { version = "0.3.0", features = ["ethereum"] } diff --git a/json/Cargo.toml b/json/Cargo.toml index f0db7ae6a9f..54451c8dd87 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" rustc-hex = "1.0" serde = "1.0" serde_json = "1.0" diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 5baabd4aeae..26502259e52 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -17,11 +17,11 @@ url = { version = "1", optional = true } ansi_term = "0.10" common-types = { path = "../ethcore/types" } error-chain = "0.12" -ethabi = "6.0" -ethabi-derive = "6.0" -ethabi-contract = "6.0" +ethabi = "7.0.0" +ethabi-derive = "7.0.0" +ethabi-contract = "7.0.0" ethcore-call-contract = { path = "../ethcore/call-contract" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" futures = "0.1" heapsize = "0.4" keccak-hash = "0.1" diff --git a/miner/stratum/Cargo.toml b/miner/stratum/Cargo.toml index d9a3c72e4dd..0a5402ebb72 100644 --- a/miner/stratum/Cargo.toml +++ b/miner/stratum/Cargo.toml @@ -6,7 +6,7 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" keccak-hash = "0.1" jsonrpc-core = "10.0.1" jsonrpc-tcp-server = "10.0.1" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index af55a1c8072..eed0f2aca65 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -44,7 +44,7 @@ ethcore-miner = { path = "../miner" } ethcore-network = { path = "../util/network" } ethcore-private-tx = { path = "../ethcore/private-tx" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" fastmap = { path = "../util/fastmap" } parity-bytes = "0.1" parity-crypto = "0.3.0" diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index 3eba8712982..90eba3d972d 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -8,14 +8,14 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" common-types = { path = "../ethcore/types" } -ethabi = "6.0" -ethabi-contract = "6.0" -ethabi-derive = "6.0" +ethabi = "7.0.0" +ethabi-contract = "7.0.0" +ethabi-derive = "7.0.0" ethcore = { path = "../ethcore" } ethcore-accounts = { path = "../accounts", optional = true} ethcore-call-contract = { path = "../ethcore/call-contract" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethkey = { path = "../accounts/ethkey" } futures = "0.1" hyper = { version = "0.12", default-features = false } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index 28000a780e5..177cca061eb 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -7,12 +7,12 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../ethcore/types" } -ethabi = "6.0" -ethabi-contract = "6.0" -ethabi-derive = "6.0" +ethabi = "7.0.0" +ethabi-contract = "7.0.0" +ethabi-derive = "7.0.0" ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" keccak-hash = "0.1" lazy_static = "1.0" log = "0.4" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index 66c0554f7b6..a43c4ebe71c 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -15,14 +15,14 @@ rand = "0.4" rustc-hex = "1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" parity-runtime = { path = "../../util/runtime" } keccak-hash = "0.1" registrar = { path = "../../util/registrar" } -ethabi = "6.0" -ethabi-derive = "6.0" -ethabi-contract = "6.0" +ethabi = "7.0.0" +ethabi-derive = "7.0.0" +ethabi-contract = "7.0.0" [dev-dependencies] parking_lot = "0.7" diff --git a/util/EIP-712/Cargo.toml b/util/EIP-712/Cargo.toml index c7577bb99d2..fea6c84ee88 100644 --- a/util/EIP-712/Cargo.toml +++ b/util/EIP-712/Cargo.toml @@ -14,9 +14,9 @@ edition = "2018" serde_derive = "1.0" serde = "1.0" serde_json = "1.0" -ethabi = "6.0" +ethabi = "7.0.0" keccak-hash = "0.1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" failure = "0.1" itertools = "0.7" lazy_static = "1.1" diff --git a/util/dir/Cargo.toml b/util/dir/Cargo.toml index 860f3f80147..ca1026d37c0 100644 --- a/util/dir/Cargo.toml +++ b/util/dir/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] license = "GPL3" [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" journaldb = { path = "../journaldb" } app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } home = "0.3" diff --git a/util/fastmap/Cargo.toml b/util/fastmap/Cargo.toml index 45eaed652a5..adbba68646b 100644 --- a/util/fastmap/Cargo.toml +++ b/util/fastmap/Cargo.toml @@ -6,5 +6,5 @@ description = "Specialized version of `HashMap` with H256 keys and fast hashing license = "GPL-3.0" [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" plain_hasher = "0.2" diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 9f12669eae0..152dbad511f 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL3" [dependencies] parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" hash-db = "0.11.0" heapsize = "0.4" keccak-hasher = { path = "../keccak-hasher" } diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index f59359295b9..69904fd4098 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -6,7 +6,7 @@ description = "Keccak-256 implementation of the Hasher trait" license = "GPL-3.0" [dependencies] -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" tiny-keccak = "1.4.2" hash-db = "0.11.0" plain_hasher = "0.2" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index ddf5a05f637..df3fdcc064a 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -23,7 +23,7 @@ ethcore-io = { path = "../io", features = ["mio"] } parity-bytes = "0.1" parity-crypto = "0.3.0" ethcore-network = { path = "../network" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethkey = { path = "../../accounts/ethkey" } rlp = { version = "0.3.0", features = ["ethereum"] } parity-path = "0.1" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index b3d412dea9e..e282184dc5d 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] error-chain = { version = "0.12", default-features = false } parity-crypto = "0.3.0" ethcore-io = { path = "../io" } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethkey = { path = "../../accounts/ethkey" } ipnetwork = "0.12.6" lazy_static = "1.0" diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index c1cd2d68a67..25d605a4e79 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -11,7 +11,7 @@ keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } hash-db = "0.11.0" rlp = "0.3.0" parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" elastic-array = "0.10" [dev-dependencies] diff --git a/util/registrar/Cargo.toml b/util/registrar/Cargo.toml index 6f526af28c8..f0614718ee3 100644 --- a/util/registrar/Cargo.toml +++ b/util/registrar/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] [dependencies] futures = "0.1" -ethabi = "6.0" -ethabi-derive = "6.0" -ethabi-contract = "6.0" +ethabi = "7.0.0" +ethabi-derive = "7.0.0" +ethabi-contract = "7.0.0" keccak-hash = "0.1" diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index 9c03d6529ce..c6039832dcb 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -7,5 +7,5 @@ license = "GPL-3.0" [dependencies] triehash = { version = "0.4.0", features = ["ethereum"] } -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" keccak-hasher = { path = "../keccak-hasher" } diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index d2251768eed..3b917bed242 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -7,7 +7,7 @@ description = "Whisper Protocol implementation for Parity" [dependencies] bitflags = "0.9" byteorder = "1.0.0" -ethereum-types = "0.5.3-beta.1" +ethereum-types = "0.5.3-beta.2" ethcore-network = { path = "../util/network" } parity-crypto = "0.3.0" ethkey = { path = "../accounts/ethkey" } From 2a28200594289d52ef8ab7142217208b686ec434 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 14 May 2019 15:41:50 +0200 Subject: [PATCH 07/90] wip --- Cargo.lock | 287 +++++++++++------------ Cargo.toml | 6 +- accounts/Cargo.toml | 2 +- accounts/ethkey/Cargo.toml | 7 +- accounts/ethkey/src/random.rs | 2 +- accounts/ethstore/Cargo.toml | 2 +- accounts/fake-hardware-wallet/Cargo.toml | 2 +- accounts/hw/Cargo.toml | 2 +- accounts/hw/src/trezor.rs | 4 +- cli-signer/Cargo.toml | 2 +- cli-signer/rpc-client/Cargo.toml | 2 +- ethash/Cargo.toml | 2 +- ethcore/Cargo.toml | 2 +- ethcore/blockchain/Cargo.toml | 2 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 2 +- ethcore/evm/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 2 +- ethcore/node-filter/Cargo.toml | 2 +- ethcore/private-tx/Cargo.toml | 2 +- ethcore/service/Cargo.toml | 2 +- ethcore/sync/Cargo.toml | 2 +- ethcore/types/Cargo.toml | 2 +- ethcore/vm/Cargo.toml | 2 +- ethcore/wasm/Cargo.toml | 2 +- ethcore/wasm/run/Cargo.toml | 2 +- evmbin/Cargo.toml | 2 +- ipfs/Cargo.toml | 2 +- json/Cargo.toml | 2 +- miner/Cargo.toml | 2 +- miner/stratum/Cargo.toml | 2 +- miner/stratum/src/lib.rs | 3 +- rpc/Cargo.toml | 2 +- secret-store/Cargo.toml | 2 +- updater/Cargo.toml | 2 +- updater/hash-fetch/Cargo.toml | 2 +- updater/hash-fetch/src/client.rs | 5 +- util/EIP-712/Cargo.toml | 2 +- util/dir/Cargo.toml | 2 +- util/fastmap/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 2 +- util/keccak-hasher/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 2 +- util/network/Cargo.toml | 2 +- util/patricia-trie-ethereum/Cargo.toml | 2 +- util/triehash-ethereum/Cargo.toml | 2 +- whisper/Cargo.toml | 5 +- whisper/src/lib.rs | 1 + whisper/src/message.rs | 11 +- whisper/src/rpc/crypto.rs | 4 +- whisper/src/rpc/filter.rs | 10 +- whisper/src/rpc/key_store.rs | 4 +- whisper/src/rpc/mod.rs | 2 +- whisper/src/rpc/types.rs | 7 +- 54 files changed, 220 insertions(+), 216 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f50f2449314..cf8a9d199b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -261,7 +261,7 @@ dependencies = [ name = "cli-signer" version = "1.4.0" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.12.0", "parity-rpc-client 1.4.0", @@ -300,13 +300,13 @@ dependencies = [ name = "common-types" version = "0.1.0" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "ethkey 0.3.0", "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)", "parity-bytes 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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "unexpected 0.1.0", @@ -542,7 +542,7 @@ name = "dir" version = "0.1.2" dependencies = [ "app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", ] @@ -568,8 +568,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "eip-712" version = "0.1.0" dependencies = [ - "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -630,21 +630,21 @@ dependencies = [ [[package]] name = "eth-secp256k1" version = "0.5.7" -source = "git+https://github.com/paritytech/rust-secp256k1#ccc06e7480148b723eb44ac56cf4d20eec380b6f" +source = "git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6#754a66081379e7098076253d664d1dc8f50e5e5e" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethabi" -version = "6.1.0" +version = "7.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)", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "rustc-hex 2.0.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)", @@ -654,15 +654,15 @@ dependencies = [ [[package]] name = "ethabi-contract" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ethabi-derive" -version = "6.0.2" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.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)", @@ -676,7 +676,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "keccak-hash 0.1.2 (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)", @@ -701,13 +701,12 @@ dependencies = [ [[package]] name = "ethbloom" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.6.3" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ "crunchy 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.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", + "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -724,9 +723,9 @@ dependencies = [ "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "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)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethcore-accounts 0.1.0", "ethcore-blockchain 0.1.0", @@ -736,7 +735,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-stratum 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "ethkey 0.3.0", "evm 0.1.0", @@ -768,7 +767,7 @@ dependencies = [ "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)", - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -792,7 +791,7 @@ name = "ethcore-accounts" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-hardware-wallet 0.0.1", @@ -814,7 +813,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -825,7 +824,7 @@ dependencies = [ "parity-bytes 0.1.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 0.3.0 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -844,7 +843,7 @@ name = "ethcore-call-contract" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -853,11 +852,11 @@ name = "ethcore-db" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", ] @@ -891,7 +890,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -910,7 +909,7 @@ dependencies = [ "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 0.3.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "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)", @@ -945,12 +944,12 @@ dependencies = [ "common-types 0.1.0", "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)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethcore-call-contract 0.1.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "fetch 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", @@ -962,7 +961,7 @@ dependencies = [ "parity-runtime 0.1.0", "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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "rustc-hex 1.0.0 (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)", @@ -979,14 +978,14 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ipnetwork 0.12.8 (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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "semver 0.9.0 (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)", @@ -1003,7 +1002,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -1018,7 +1017,7 @@ dependencies = [ "parity-snappy 0.1.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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1036,14 +1035,14 @@ 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)", - "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)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "ethkey 0.3.0", "fetch 0.1.0", @@ -1056,7 +1055,7 @@ dependencies = [ "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 0.3.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1075,14 +1074,14 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "env_logger 0.5.13 (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)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -1120,7 +1119,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1133,7 +1132,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -1156,7 +1155,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", "ethcore-private-tx 1.0.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ethstore 0.2.1", "fastmap 0.1.0", @@ -1173,7 +1172,7 @@ dependencies = [ "parity-runtime 0.1.0", "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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "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)", "triehash-ethereum 0.2.0", @@ -1194,15 +1193,15 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.5.3-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.5.2" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ - "ethbloom 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-rlp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "primitive-types 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethbloom 0.6.3 (git+https://github.com/ordian/parity-common)", + "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", + "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", + "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", + "primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)", + "uint 0.7.0 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -1217,7 +1216,7 @@ dependencies = [ name = "ethjson" version = "0.1.0" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "rustc-hex 1.0.0 (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)", @@ -1230,15 +1229,15 @@ version = "0.3.0" 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", + "rand 0.6.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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1265,7 +1264,7 @@ name = "ethstore" version = "0.2.1" dependencies = [ "dir 0.1.2", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1309,7 +1308,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1330,7 +1329,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -1387,7 +1386,7 @@ dependencies = [ name = "fake-hardware-wallet" version = "0.0.1" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", ] @@ -1400,7 +1399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fastmap" version = "0.1.0" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1440,7 +1439,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1585,7 +1584,7 @@ dependencies = [ name = "hardware-wallet" version = "1.12.0" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -1768,7 +1767,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1776,17 +1775,16 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", ] [[package]] name = "impl-serde" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.2.0" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1890,7 +1888,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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -1902,7 +1900,7 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -2047,7 +2045,7 @@ dependencies = [ name = "keccak-hasher" version = "0.1.1" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -2403,14 +2401,14 @@ dependencies = [ name = "node-filter" version = "1.12.0" 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)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-io 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "kvdb-memorydb 0.1.0 (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.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2619,7 +2617,7 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-service 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-fetch 0.0.1", @@ -2653,7 +2651,7 @@ dependencies = [ "pretty_assertions 0.1.2 (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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2672,10 +2670,10 @@ dependencies = [ name = "parity-hash-fetch" version = "1.12.0" 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "fake-fetch 0.0.1", "fetch 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2697,12 +2695,12 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", "parity-bytes 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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2716,7 +2714,7 @@ 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)", "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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2766,7 +2764,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.1", @@ -2794,7 +2792,7 @@ dependencies = [ "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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2813,7 +2811,7 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -2875,12 +2873,12 @@ name = "parity-updater" version = "1.12.0" dependencies = [ "common-types 0.1.0", - "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)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "keccak-hash 0.1.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)", @@ -2901,7 +2899,7 @@ name = "parity-version" version = "2.6.0" dependencies = [ "parity-bytes 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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "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.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2923,7 +2921,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", @@ -2934,8 +2932,9 @@ dependencies = [ "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.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)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -3022,14 +3021,14 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", "keccak-hasher 0.1.1", "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)", - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3170,14 +3169,14 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.2.4" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ - "fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-rlp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", + "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", + "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", + "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", + "uint 0.7.0 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -3207,7 +3206,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3290,7 +3289,7 @@ dependencies = [ "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3344,7 +3343,7 @@ dependencies = [ [[package]] name = "rand_xorshift" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3428,9 +3427,9 @@ dependencies = [ name = "registrar" version = "0.0.1" 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)", + "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", ] @@ -3476,7 +3475,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3489,7 +3488,7 @@ version = "0.1.0" dependencies = [ "elastic-array 0.10.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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -3498,7 +3497,7 @@ version = "0.1.0" 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)", - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4231,14 +4230,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", ] [[package]] name = "triehash-ethereum" version = "0.2.0" dependencies = [ - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "keccak-hasher 0.1.1", "triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4277,7 +4276,7 @@ dependencies = [ [[package]] name = "uint" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4422,13 +4421,13 @@ name = "vm" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "keccak-hash 0.1.2 (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)", + "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4473,7 +4472,7 @@ 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.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "libc 0.2.48 (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)", @@ -4673,14 +4672,14 @@ dependencies = [ "checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" -"checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)" = "" -"checksum ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8eb362fde43ed0b50b258bb0c72b72b3dccfd29f8de9506295eaf9251c49ca31" -"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 eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6)" = "" +"checksum ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be9a03ff8f3d495d9b73d59fd166acc91d0fd81779911b0b8b4c87b6024a670a" +"checksum ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b51f33d0b3998b4330d6b5a4b1b02a03d3c96b5de44d563929e232f4a30ba7e2" +"checksum ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ae5f5517ad9270a91ea7c86487a4872ded693f5d039b4d3da210237980ddd3bf" "checksum ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a93a43ce2e9f09071449da36bfa7a1b20b950ee344b6904ff23de493b03b386" -"checksum ethbloom 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "779ebef70385607b3d547ac506e07d882c516663d0f326156efcd14a96a85a0a" +"checksum ethbloom 0.6.3 (git+https://github.com/ordian/parity-common)" = "" "checksum ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e742184dc63a01c8ea0637369f8faa27c40f537949908a237f95c05e68d2c96" -"checksum ethereum-types 0.5.3-beta.1 (registry+https://github.com/rust-lang/crates.io-index)" = "896dd9df9d3b28bcb9bbb79ec7c6bc11e590d2c5b5d06dcfba658ff90e9b845b" +"checksum ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)" = "" "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" @@ -4688,7 +4687,7 @@ dependencies = [ "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" -"checksum fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" +"checksum fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)" = "" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" @@ -4720,9 +4719,9 @@ dependencies = [ "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" "checksum igd 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a254e265e8810deb357a9de757f784787ec415d056ededf410c0aa460afee9e" -"checksum impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b" -"checksum impl-rlp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc1023f8632c284e03d9d055721c66c0c19abf5fe34af297a5c69f78d65a5fd" -"checksum impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5158079de9d4158e0ce1de3ae0bd7be03904efc40b3d7dd8b8c301cbf6b52b56" +"checksum impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)" = "" +"checksum impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)" = "" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "26746cbc2e680af687e88d717f20ff90079bd10fc984ad57d277cd0e37309fa5" "checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" @@ -4830,7 +4829,7 @@ dependencies = [ "checksum primal-check 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1" "checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" "checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" -"checksum primitive-types 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99d5a5fe9d93ddb394e2fb3fc49d0e31acb475fd45a30eeb8f3e76b767ecb7e1" +"checksum primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)" = "" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" "checksum protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "52fbc45bf6709565e44ef31847eb7407b3c3c80af811ee884a04da071dcca12b" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" @@ -4848,7 +4847,7 @@ dependencies = [ "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" "checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" -"checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "df7a791f788cb4c516f0e091301a29c2b71ef680db5e644a7d68835c8ae6dbfa" "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" @@ -4861,7 +4860,7 @@ dependencies = [ "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "be5386a5f59e5f5bcaea38b50ad26c09e3918a0abc0610640b3be5cfd85d6894" "checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" -"checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" +"checksum rlp 0.3.0 (git+https://github.com/ordian/parity-common)" = "" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" "checksum rprompt 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1601f32bc5858aae3cbfa1c645c96c4d820cc5c16be0194f089560c00b6eb625" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" @@ -4950,7 +4949,7 @@ dependencies = [ "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" "checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" -"checksum uint 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91bb295c2c53c54742a6b8acb705114f6dfdf3c42becdb146a662cb77fcc0d02" +"checksum uint 0.7.0 (git+https://github.com/ordian/parity-common)" = "" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" diff --git a/Cargo.toml b/Cargo.toml index e0ee58bf017..fcd1a8c3ddc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ ethcore-network = { path = "util/network" } ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-service = { path = "ethcore/service" } ethcore-sync = { path = "ethcore/sync" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } node-filter = { path = "ethcore/node-filter" } @@ -144,3 +144,7 @@ members = [ [patch.crates-io] heapsize = { git = "https://github.com/cheme/heapsize.git", branch = "ec-macfix" } +ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethbloom = { git = "https://github.com/ordian/parity-common" } +rlp = { git = "https://github.com/ordian/parity-common" } +primitive-types = { git = "https://github.com/ordian/parity-common" } diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index b9c0995ee94..2aeb5ea549c 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -24,5 +24,5 @@ hardware-wallet = { path = "hw" } fake-hardware-wallet = { path = "fake-hardware-wallet" } [dev-dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" tempdir = "0.3" diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index 1100a80d13c..dd764bf71bb 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -7,14 +7,15 @@ authors = ["Parity Technologies "] byteorder = "1.0" edit-distance = "2.0" parity-crypto = "0.3.0" -eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } -ethereum-types = "0.5.3-beta.2" +# TODO: use master branch after we switch to rand 0.6 +eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", branch = "rand-0.6" } +ethereum-types = "0.5.2" lazy_static = "1.0" log = "0.4" memzero = { path = "../../util/memzero" } parity-wordlist = "1.2" quick-error = "1.2.2" -rand = "0.4" +rand = "0.6" rustc-hex = "1.0" serde = "1.0" serde_derive = "1.0" diff --git a/accounts/ethkey/src/random.rs b/accounts/ethkey/src/random.rs index 1966cb361b6..39f72eb0cdf 100644 --- a/accounts/ethkey/src/random.rs +++ b/accounts/ethkey/src/random.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 rand::os::OsRng; +use rand::rngs::OsRng; use super::{Generator, KeyPair, SECP256K1}; /// Randomly generates new keypair, instantiating the RNG each time. diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 7e532bb265c..d14798396f0 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -17,7 +17,7 @@ time = "0.1.34" itertools = "0.5" parking_lot = "0.7" parity-crypto = "0.3.0" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" dir = { path = "../../util/dir" } smallvec = "0.6" parity-wordlist = "1.0" diff --git a/accounts/fake-hardware-wallet/Cargo.toml b/accounts/fake-hardware-wallet/Cargo.toml index 432fc826820..ac98a159f0c 100644 --- a/accounts/fake-hardware-wallet/Cargo.toml +++ b/accounts/fake-hardware-wallet/Cargo.toml @@ -6,5 +6,5 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethkey = { path = "../../accounts/ethkey" } diff --git a/accounts/hw/Cargo.toml b/accounts/hw/Cargo.toml index 844f48e98f9..7344425c037 100644 --- a/accounts/hw/Cargo.toml +++ b/accounts/hw/Cargo.toml @@ -14,7 +14,7 @@ hidapi = { git = "https://github.com/paritytech/hidapi-rs" } libusb = { git = "https://github.com/paritytech/libusb-rs" } trezor-sys = { git = "https://github.com/paritytech/trezor-sys" } ethkey = { path = "../ethkey" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" semver = "0.9" [dev-dependencies] diff --git a/accounts/hw/src/trezor.rs b/accounts/hw/src/trezor.rs index b20123ed8b3..310cc09ba57 100644 --- a/accounts/hw/src/trezor.rs +++ b/accounts/hw/src/trezor.rs @@ -289,7 +289,7 @@ impl<'a> Wallet<'a> for Manager { message.set_value(self.u256_to_be_vec(&t_info.value)); if let Some(addr) = t_info.to { - message.set_to(addr.to_vec()) + message.set_to(addr.as_bytes().to_vec()) } let first_chunk_length = min(t_info.data.len(), 1024); let chunk = &t_info.data[0..first_chunk_length]; @@ -398,7 +398,7 @@ impl<'a> Wallet<'a> for Manager { match resp_type { MessageType::MessageType_EthereumAddress => { let response: EthereumAddress = protobuf::core::parse_from_bytes(&bytes)?; - Ok(Some(From::from(response.get_address()))) + Ok(Some(Address::from_slice(response.get_address()))) } _ => Ok(None), } diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index ce621062657..274db62e608 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -7,7 +7,7 @@ name = "cli-signer" version = "1.4.0" [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" 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 2a5262738f5..61a16b5e535 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -7,7 +7,7 @@ name = "parity-rpc-client" version = "1.4.0" [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" futures = "0.1" log = "0.4" serde = "1.0" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index e42fe9b558f..684c94e3368 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1.0" either = "1.0.0" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" keccak-hash = "0.1" log = "0.4" memmap = "0.6" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index fe1ab726173..17c76aaae45 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -26,7 +26,7 @@ ethcore-db = { path = "./db" } ethcore-io = { path = "../util/io" } ethcore-miner = { path = "../miner" } ethcore-stratum = { path = "../miner/stratum", optional = true } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } evm = { path = "evm" } diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index c809ba1d484..ed32fda003a 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -12,7 +12,7 @@ ansi_term = "0.10" blooms-db = { path = "../../util/blooms-db" } common-types = { path = "../types" } ethcore-db = { path = "../db" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" heapsize = "0.4" itertools = "0.5" kvdb = "0.1" diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index e91b143012b..46615e9a024 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -7,5 +7,5 @@ edition = "2018" [dependencies] types = { path = "../types", package = "common-types" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" bytes = { version = "0.1", package = "parity-bytes" } diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index 459c582c1a1..c2203b1cd7f 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] common-types = { path = "../types" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" heapsize = "0.4" kvdb = "0.1" parking_lot = "0.7" diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index b47193cc5ba..64b78ea4a0e 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] bit-set = "0.4" parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" heapsize = "0.4" lazy_static = "1.0" log = "0.4" diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index ff675e08748..3546c172043 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../types" } ethcore = { path = ".."} ethcore-db = { path = "../db" } ethcore-blockchain = { path = "../blockchain" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" memory-db = "0.11.0" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index b4855d92606..2c962de1e74 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] ethcore = { path = ".."} ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" log = "0.4" parking_lot = "0.7" ethabi = "7.0.0" diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index c1f27852c0e..50aac2726b5 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -15,7 +15,7 @@ ethcore = { path = ".." } ethcore-call-contract = { path = "../call-contract" } ethcore-io = { path = "../../util/io" } ethcore-miner = { path = "../../miner" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } fetch = { path = "../../util/fetch" } diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index ad4c9b15416..985c27eb3be 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -11,7 +11,7 @@ ethcore-blockchain = { path = "../blockchain" } ethcore-io = { path = "../../util/io" } ethcore-private-tx = { path = "../private-tx" } ethcore-sync = { path = "../sync" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" kvdb = "0.1" log = "0.4" trace-time = "0.1" diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 69cf7ad2494..f0e75b98dbc 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -15,7 +15,7 @@ ethcore-io = { path = "../../util/io" } ethcore-light = { path = "../light" } ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethkey = { path = "../../accounts/ethkey" } ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index ded641f8738..2bd5605f9bf 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -5,7 +5,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 81b34989285..75b3875a0ac 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" diff --git a/ethcore/wasm/Cargo.toml b/ethcore/wasm/Cargo.toml index d2c6d80d91d..60c69925e66 100644 --- a/ethcore/wasm/Cargo.toml +++ b/ethcore/wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" log = "0.4" parity-wasm = "0.31" libc = "0.2" diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml index b77b9507c09..b20235e83b4 100644 --- a/ethcore/wasm/run/Cargo.toml +++ b/ethcore/wasm/run/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] serde = "1" serde_json = "1" serde_derive = "1" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethjson = { path = "../../../json" } vm = { path = "../../vm" } wasm = { path = "../" } diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index bcc6bdff1b5..2d7dccce0f8 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../ethcore/types" } docopt = "1.0" env_logger = "0.5" ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethjson = { path = "../json" } evm = { path = "../ethcore/evm" } panic_hook = { path = "../util/panic-hook" } diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 61d3fa90831..1ca1305712a 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" jsonrpc-core = "10.0.1" jsonrpc-http-server = "10.0.1" rlp = { version = "0.3.0", features = ["ethereum"] } diff --git a/json/Cargo.toml b/json/Cargo.toml index 54451c8dd87..e442039910a 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" rustc-hex = "1.0" serde = "1.0" serde_json = "1.0" diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 26502259e52..10e831ee62e 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -21,7 +21,7 @@ ethabi = "7.0.0" ethabi-derive = "7.0.0" ethabi-contract = "7.0.0" ethcore-call-contract = { path = "../ethcore/call-contract" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" futures = "0.1" heapsize = "0.4" keccak-hash = "0.1" diff --git a/miner/stratum/Cargo.toml b/miner/stratum/Cargo.toml index 0a5402ebb72..520ce9f8954 100644 --- a/miner/stratum/Cargo.toml +++ b/miner/stratum/Cargo.toml @@ -6,7 +6,7 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" keccak-hash = "0.1" jsonrpc-core = "10.0.1" jsonrpc-tcp-server = "10.0.1" diff --git a/miner/stratum/src/lib.rs b/miner/stratum/src/lib.rs index 5ee0296dacf..465d71e71eb 100644 --- a/miner/stratum/src/lib.rs +++ b/miner/stratum/src/lib.rs @@ -163,7 +163,8 @@ impl StratumImpl { params.parse::<(String, String)>().map(|(worker_id, secret)|{ if let Some(valid_secret) = self.secret { let hash = keccak(secret); - if hash != valid_secret { + // TODO: update keccak-hash dep + if hash.0 != valid_secret.0 { return to_value(&false); } } diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index eed0f2aca65..353a9e637f2 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -44,7 +44,7 @@ ethcore-miner = { path = "../miner" } ethcore-network = { path = "../util/network" } ethcore-private-tx = { path = "../ethcore/private-tx" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" fastmap = { path = "../util/fastmap" } parity-bytes = "0.1" parity-crypto = "0.3.0" diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index 90eba3d972d..c9fafeb2bf3 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -15,7 +15,7 @@ ethcore = { path = "../ethcore" } ethcore-accounts = { path = "../accounts", optional = true} ethcore-call-contract = { path = "../ethcore/call-contract" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethkey = { path = "../accounts/ethkey" } futures = "0.1" hyper = { version = "0.12", default-features = false } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index 177cca061eb..4ac1ed49add 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -12,7 +12,7 @@ ethabi-contract = "7.0.0" ethabi-derive = "7.0.0" ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" keccak-hash = "0.1" lazy_static = "1.0" log = "0.4" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index a43c4ebe71c..3f822d7f468 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -15,7 +15,7 @@ rand = "0.4" rustc-hex = "1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" parity-runtime = { path = "../../util/runtime" } keccak-hash = "0.1" registrar = { path = "../../util/registrar" } diff --git a/updater/hash-fetch/src/client.rs b/updater/hash-fetch/src/client.rs index 513b02f2568..d208ff8d4dc 100644 --- a/updater/hash-fetch/src/client.rs +++ b/updater/hash-fetch/src/client.rs @@ -99,8 +99,9 @@ fn validate_hash(path: PathBuf, hash: H256, body: fetch::BodyReader) -> Result

"] license = "GPL3" [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" journaldb = { path = "../journaldb" } app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } home = "0.3" diff --git a/util/fastmap/Cargo.toml b/util/fastmap/Cargo.toml index adbba68646b..54831ce3a10 100644 --- a/util/fastmap/Cargo.toml +++ b/util/fastmap/Cargo.toml @@ -6,5 +6,5 @@ description = "Specialized version of `HashMap` with H256 keys and fast hashing license = "GPL-3.0" [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" plain_hasher = "0.2" diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 152dbad511f..eee589e2a3f 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL3" [dependencies] parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" hash-db = "0.11.0" heapsize = "0.4" keccak-hasher = { path = "../keccak-hasher" } diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index 69904fd4098..8572df536e1 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -6,7 +6,7 @@ description = "Keccak-256 implementation of the Hasher trait" license = "GPL-3.0" [dependencies] -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" tiny-keccak = "1.4.2" hash-db = "0.11.0" plain_hasher = "0.2" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index df3fdcc064a..74a81e45a35 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -23,7 +23,7 @@ ethcore-io = { path = "../io", features = ["mio"] } parity-bytes = "0.1" parity-crypto = "0.3.0" ethcore-network = { path = "../network" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethkey = { path = "../../accounts/ethkey" } rlp = { version = "0.3.0", features = ["ethereum"] } parity-path = "0.1" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index e282184dc5d..1f121916e03 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] error-chain = { version = "0.12", default-features = false } parity-crypto = "0.3.0" ethcore-io = { path = "../io" } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethkey = { path = "../../accounts/ethkey" } ipnetwork = "0.12.6" lazy_static = "1.0" diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index 25d605a4e79..84f40beb815 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -11,7 +11,7 @@ keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } hash-db = "0.11.0" rlp = "0.3.0" parity-bytes = "0.1" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" elastic-array = "0.10" [dev-dependencies] diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index c6039832dcb..0e0a593afc7 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -7,5 +7,5 @@ license = "GPL-3.0" [dependencies] triehash = { version = "0.4.0", features = ["ethereum"] } -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" keccak-hasher = { path = "../keccak-hasher" } diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index 3b917bed242..777cc1611ab 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -7,7 +7,7 @@ description = "Whisper Protocol implementation for Parity" [dependencies] bitflags = "0.9" byteorder = "1.0.0" -ethereum-types = "0.5.3-beta.2" +ethereum-types = "0.5.2" ethcore-network = { path = "../util/network" } parity-crypto = "0.3.0" ethkey = { path = "../accounts/ethkey" } @@ -16,7 +16,8 @@ log = "0.4" memzero = { path = "../util/memzero" } ordered-float = "0.5" parking_lot = "0.7" -rand = "0.4" +rand = "0.6" +rand_xorshift = "0.1.1" rlp = { version = "0.3.0", features = ["ethereum"] } serde = "1.0" serde_derive = "1.0" diff --git a/whisper/src/lib.rs b/whisper/src/lib.rs index cdc88780d4d..fdc7ee3bdc0 100644 --- a/whisper/src/lib.rs +++ b/whisper/src/lib.rs @@ -29,6 +29,7 @@ extern crate memzero; extern crate ordered_float; extern crate parking_lot; extern crate rand; +extern crate rand_xorshift; extern crate rlp; extern crate serde; extern crate slab; diff --git a/whisper/src/message.rs b/whisper/src/message.rs index c10d39700f2..94d780c1313 100644 --- a/whisper/src/message.rs +++ b/whisper/src/message.rs @@ -35,8 +35,8 @@ pub fn work_factor_proved(size: u64, ttl: u64, hash: H256) -> f64 { assert!(size != 0 && ttl != 0); let leading_zeros = { - let leading_bytes = hash.iter().take_while(|&&x| x == 0).count(); - let remaining_leading_bits = hash.get(leading_bytes).map_or(0, |byte| byte.leading_zeros() as usize); + let leading_bytes = hash.as_ref().iter().take_while(|&&x| x == 0).count(); + let remaining_leading_bits = hash.as_ref().get(leading_bytes).map_or(0, |byte| byte.leading_zeros() as usize); (leading_bytes * 8) + remaining_leading_bits }; let spacetime = size as f64 * ttl as f64; @@ -70,7 +70,7 @@ impl Topic { } debug_assert!(idx <= 511); - bloom[idx / 8] |= 1 << (7 - idx % 8); + bloom.as_bytes_mut()[idx / 8] |= 1 << (7 - idx % 8); } } @@ -258,13 +258,14 @@ impl Message { /// Panics if TTL is 0. pub fn create(params: CreateParams) -> Result { use byteorder::{BigEndian, ByteOrder}; - use rand::{Rng, SeedableRng, XorShiftRng}; + use rand::{Rng, SeedableRng}; + use rand_xorshift::XorShiftRng; if params.topics.is_empty() { return Err(Error::EmptyTopics) } let mut rng = { let mut thread_rng = ::rand::thread_rng(); - XorShiftRng::from_seed(thread_rng.gen::<[u32; 4]>()) + XorShiftRng::from_seed(thread_rng.gen()) }; assert!(params.ttl > 0); diff --git a/whisper/src/rpc/crypto.rs b/whisper/src/rpc/crypto.rs index 89116345313..2db9ba8ae44 100644 --- a/whisper/src/rpc/crypto.rs +++ b/whisper/src/rpc/crypto.rs @@ -165,8 +165,8 @@ impl DecryptionInstance { if ciphertext.len() < num_topics * 32 { return None } - let mut salted_topic = H256::new(); - salted_topic.copy_from_slice(&ciphertext[(known_index * 32)..][..32]); + let mut salted_topic = H256::zero(); + salted_topic.as_bytes_mut().copy_from_slice(&ciphertext[(known_index * 32)..][..32]); let key = Memzero::from((salted_topic ^ known_topic).0); let offset = num_topics * 32; Decryptor::aes_256_gcm(&*key).ok()? diff --git a/whisper/src/rpc/filter.rs b/whisper/src/rpc/filter.rs index 46cefd61e00..a58f16f9c85 100644 --- a/whisper/src/rpc/filter.rs +++ b/whisper/src/rpc/filter.rs @@ -23,7 +23,6 @@ use ethereum_types::{H256, H512}; use ethkey::Public; use jsonrpc_pubsub::typed::{Subscriber, Sink}; use parking_lot::{Mutex, RwLock}; -use rand::{Rng, OsRng}; use message::{Message, Topic}; use super::{key_store::KeyStore, types::{self, FilterItem, HexEncode}}; @@ -107,10 +106,7 @@ impl Manager { pub fn insert_polled(&self, filter: Filter) -> Result { let buffer = Arc::new(Mutex::new(Vec::new())); let entry = FilterEntry::Poll(Arc::new(filter), buffer); - let id = OsRng::new() - .map_err(|_| "unable to acquire secure randomness")? - .gen(); - + let id = H256::random(); self.filters.write().insert(id, entry); Ok(id) } @@ -120,9 +116,7 @@ impl Manager { pub fn insert_subscription(&self, filter: Filter, sub: Subscriber) -> Result<(), &'static str> { - let id: H256 = OsRng::new() - .map_err(|_| "unable to acquire secure randomness")? - .gen(); + let id = H256::random(); sub.assign_id(::jsonrpc_pubsub::SubscriptionId::String(format!("{:x}", id))) .map(move |sink| { diff --git a/whisper/src/rpc/key_store.rs b/whisper/src/rpc/key_store.rs index 081a8b374d6..687eab48ad7 100644 --- a/whisper/src/rpc/key_store.rs +++ b/whisper/src/rpc/key_store.rs @@ -24,7 +24,7 @@ use std::collections::HashMap; use ethereum_types::H256; use ethkey::{KeyPair, Public, Secret}; use memzero::Memzero; -use rand::{Rng, OsRng}; +use rand::{Rng, rngs::OsRng}; use rpc::crypto::{AES_KEY_LEN, EncryptionInstance, DecryptionInstance}; @@ -105,7 +105,7 @@ impl KeyStore { /// Import a key, generating a random identity for it. pub fn insert(&mut self, key: Key) -> H256 { - let id = self.rng().gen(); + let id = H256::random_using(self.rng()); self.identities.insert(id, key); id diff --git a/whisper/src/rpc/mod.rs b/whisper/src/rpc/mod.rs index 03d98b51ff8..a5ed05da73b 100644 --- a/whisper/src/rpc/mod.rs +++ b/whisper/src/rpc/mod.rs @@ -277,7 +277,7 @@ impl Whisper for WhisperClien Some(types::Receiver::Identity(id)) => self.store.read().encryption_instance(&id.into_inner()) .map_err(whisper_error)?, None => { - use rand::{Rng, OsRng}; + use rand::{Rng, rngs::OsRng}; // broadcast mode: use fixed nonce and fresh key each time. diff --git a/whisper/src/rpc/types.rs b/whisper/src/rpc/types.rs index 40e440bf562..b5550dbff07 100644 --- a/whisper/src/rpc/types.rs +++ b/whisper/src/rpc/types.rs @@ -17,6 +17,7 @@ //! Types for Whisper RPC. use std::fmt; +use std::convert::AsRef; use std::ops::Deref; use ethereum_types::{H32, H64, H128, H256, H264, H512}; @@ -26,7 +27,7 @@ use serde::{Serialize, Serializer, Deserialize, Deserializer}; use serde::de::{Error, Visitor}; /// Helper trait for generic hex bytes encoding. -pub trait HexEncodable: Sized + ::std::ops::Deref { +pub trait HexEncodable: Sized + AsRef<[u8]> { fn from_bytes(bytes: Vec) -> Option; } @@ -39,7 +40,7 @@ macro_rules! impl_hex_for_hash { $( impl HexEncodable for $t { fn from_bytes(bytes: Vec) -> Option { - if bytes.len() != $t::len() { + if bytes.len() != $t::len_bytes() { None } else { Some($t::from_slice(&bytes)) @@ -100,7 +101,7 @@ pub type Symmetric = HexEncode; impl Serialize for HexEncode { fn serialize(&self, serializer: S) -> Result { - let data = &self.0[..]; + let data = self.0.as_ref(); let serialized = "0x".to_owned() + &data.to_hex(); serializer.serialize_str(serialized.as_ref()) From 86f16f65bf2829ec2de428b10ca29cde7c976e08 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 14 May 2019 15:48:08 +0200 Subject: [PATCH 08/90] [eip-712] fix compilation errors --- util/EIP-712/src/encode.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/EIP-712/src/encode.rs b/util/EIP-712/src/encode.rs index f3c89840d64..e386981d731 100644 --- a/util/EIP-712/src/encode.rs +++ b/util/EIP-712/src/encode.rs @@ -95,7 +95,8 @@ fn encode_type(message_type: &str, message_types: &MessageTypes) -> Result Result { - Ok(keccak(encode_type(message_type, typed_data)?)) + // TODO: update keccak-hash dep + Ok(H256(keccak(encode_type(message_type, typed_data)?).0)) } fn encode_data( @@ -126,11 +127,11 @@ fn encode_data( items.append(&mut encoded); } - keccak(items).to_vec() + keccak(items).0.to_vec() } Type::Custom(ref ident) if message_types.get(&*ident).is_some() => { - let type_hash = (&type_hash(ident, &message_types)?).to_vec(); + let type_hash = (&type_hash(ident, &message_types)?).0.to_vec(); let mut tokens = encode(&[EthAbiToken::FixedBytes(type_hash)]); for field in message_types.get(ident).expect("Already checked in match guard; qed") { @@ -219,7 +220,7 @@ pub fn hash_structured_data(typed_data: EIP712) -> Result { encode_data(&parser, &Type::Custom(typed_data.primary_type), &typed_data.types, &typed_data.message, None)? ); let concat = [&prefix[..], &domain_hash[..], &data_hash[..]].concat(); - Ok(keccak(concat)) + Ok(H256(keccak(concat).0)) } #[cfg(test)] From 75837808382a23ca0bc8c5f335966f8c15ee8dea Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 11:54:36 +0200 Subject: [PATCH 09/90] [ethjson] fix compilation errors --- json/src/hash.rs | 9 +++------ json/src/uint.rs | 22 ++-------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/json/src/hash.rs b/json/src/hash.rs index a025dc45414..406c2a0b41c 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -20,7 +20,6 @@ use std::str::FromStr; use std::fmt; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::{Error, Visitor}; -use rustc_hex::ToHex; use ethereum_types::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, Bloom as Hash2048}; macro_rules! impl_hash { @@ -56,8 +55,8 @@ macro_rules! impl_hash { fn visit_str(self, value: &str) -> Result where E: Error { let value = match value.len() { - 0 => $inner::from(0), - 2 if value == "0x" => $inner::from(0), + 0 => $inner::from_low_u64_be(0), + 2 if value == "0x" => $inner::from_low_u64_be(0), _ if value.starts_with("0x") => $inner::from_str(&value[2..]).map_err(|e| { Error::custom(format!("Invalid hex value {}: {}", value, e).as_str()) })?, @@ -80,9 +79,7 @@ macro_rules! impl_hash { impl Serialize for $name { fn serialize(&self, serializer: S) -> Result where S: Serializer { - let mut hex = "0x".to_owned(); - hex.push_str(&self.0.to_hex()); - serializer.serialize_str(&hex) + serializer.serialize_str(&format!("{:#x}", self.0)) } } } diff --git a/json/src/uint.rs b/json/src/uint.rs index 3f1d02f03e7..368d3e982f8 100644 --- a/json/src/uint.rs +++ b/json/src/uint.rs @@ -32,24 +32,6 @@ impl Into for Uint { } } -impl Into for Uint { - fn into(self) -> u64 { - u64::from(self.0) - } -} - -impl Into for Uint { - fn into(self) -> usize { - // TODO: clean it after util conversions refactored. - u64::from(self.0) as usize - } -} -impl Into for Uint { - fn into(self) -> u8 { - u64::from(self.0) as u8 - } -} - impl Serialize for Uint { fn serialize(&self, serializer: S) -> Result where S: Serializer { @@ -101,7 +83,7 @@ pub fn validate_non_zero<'de, D>(d: D) -> Result where D: Deseri let value = Uint::deserialize(d)?; if value == Uint(U256::from(0)) { - return Err(Error::invalid_value(Unexpected::Unsigned(value.into()), &"a non-zero value")) + return Err(Error::invalid_value(Unexpected::Unsigned(0), &"a non-zero value")) } Ok(value) @@ -112,7 +94,7 @@ pub fn validate_optional_non_zero<'de, D>(d: D) -> Result, D::Error if let Some(value) = value { if value == Uint(U256::from(0)) { - return Err(Error::invalid_value(Unexpected::Unsigned(value.into()), &"a non-zero value")) + return Err(Error::invalid_value(Unexpected::Unsigned(0), &"a non-zero value")) } } From fa9ef817c197591ff7616f61fd0945e0413aa390 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 11:55:12 +0200 Subject: [PATCH 10/90] [Cargo.toml] add TODO to remove patches --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index fcd1a8c3ddc..3ffb55e3ad1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -144,6 +144,7 @@ members = [ [patch.crates-io] heapsize = { git = "https://github.com/cheme/heapsize.git", branch = "ec-macfix" } +# TODO: remove when 0.5.3 is published ethereum-types = { git = "https://github.com/ordian/parity-common" } ethbloom = { git = "https://github.com/ordian/parity-common" } rlp = { git = "https://github.com/ordian/parity-common" } From f8ce152e924a2bfc7f8cec7ce1c726d1899ecf09 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 12:11:47 +0200 Subject: [PATCH 11/90] [ethstore] fix compilation errors --- accounts/ethstore/src/account/crypto.rs | 2 +- accounts/ethstore/src/accounts_dir/memory.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/ethstore/src/account/crypto.rs b/accounts/ethstore/src/account/crypto.rs index a3f6f9e9a30..27eb4b85c4c 100644 --- a/accounts/ethstore/src/account/crypto.rs +++ b/accounts/ethstore/src/account/crypto.rs @@ -75,7 +75,7 @@ impl From for String { impl Crypto { /// Encrypt account secret pub fn with_secret(secret: &Secret, password: &Password, iterations: NonZeroU32) -> Result { - Crypto::with_plain(&*secret, password, iterations) + Crypto::with_plain(secret.as_ref(), password, iterations) } /// Encrypt custom plain data diff --git a/accounts/ethstore/src/accounts_dir/memory.rs b/accounts/ethstore/src/accounts_dir/memory.rs index 617e7bcb024..7f623aa3a14 100644 --- a/accounts/ethstore/src/accounts_dir/memory.rs +++ b/accounts/ethstore/src/accounts_dir/memory.rs @@ -68,7 +68,7 @@ impl KeyDirectory for MemoryDirectory { fn unique_repr(&self) -> Result { let mut val = 0u64; let accounts = self.accounts.read(); - for acc in accounts.keys() { val = val ^ acc.low_u64() } + for acc in accounts.keys() { val = val ^ acc.to_low_u64_be() } Ok(val) } } From c7b4527b3b241c06a16d96063de39424d7ab68bd Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 12:11:59 +0200 Subject: [PATCH 12/90] use patched keccak-hash with new primitive-types --- Cargo.lock | 74 +++++++++++++------------- Cargo.toml | 4 +- cli-signer/rpc-client/Cargo.toml | 2 +- ethash/Cargo.toml | 2 +- ethcore/Cargo.toml | 2 +- ethcore/blockchain/Cargo.toml | 2 +- ethcore/evm/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 2 +- ethcore/private-tx/Cargo.toml | 2 +- ethcore/sync/Cargo.toml | 2 +- ethcore/types/Cargo.toml | 2 +- ethcore/vm/Cargo.toml | 2 +- miner/Cargo.toml | 2 +- miner/stratum/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- secret-store/Cargo.toml | 2 +- updater/Cargo.toml | 2 +- updater/hash-fetch/Cargo.toml | 2 +- util/EIP-712/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 2 +- util/patricia-trie-ethereum/Cargo.toml | 2 +- util/registrar/Cargo.toml | 2 +- 23 files changed, 61 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf8a9d199b6..5f9d8586127 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -304,7 +304,7 @@ dependencies = [ "ethjson 0.1.0", "ethkey 0.3.0", "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", @@ -573,7 +573,7 @@ dependencies = [ "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -677,7 +677,7 @@ dependencies = [ "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.5.2 (git+https://github.com/ordian/parity-common)", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "ethbloom" version = "0.6.3" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -745,7 +745,7 @@ dependencies = [ "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)", "journaldb 0.2.0", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -817,7 +817,7 @@ dependencies = [ "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -898,7 +898,7 @@ dependencies = [ "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)", "journaldb 0.2.0", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -955,7 +955,7 @@ dependencies = [ "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)", "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "linked-hash-map 0.5.1 (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", @@ -1006,7 +1006,7 @@ dependencies = [ "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "libc 0.2.48 (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.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1048,7 +1048,7 @@ dependencies = [ "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -1086,7 +1086,7 @@ dependencies = [ "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)", "jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1135,7 +1135,7 @@ dependencies = [ "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -1162,7 +1162,7 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -1194,7 +1194,7 @@ dependencies = [ [[package]] name = "ethereum-types" version = "0.5.2" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "ethbloom 0.6.3 (git+https://github.com/ordian/parity-common)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1310,7 +1310,7 @@ dependencies = [ "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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", @@ -1439,7 +1439,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1767,7 +1767,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1775,7 +1775,7 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.1.1" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", ] @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1892,7 +1892,7 @@ dependencies = [ "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)", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -2034,10 +2034,10 @@ dependencies = [ [[package]] name = "keccak-hash" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.1.4" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2439,7 +2439,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.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2626,7 +2626,7 @@ dependencies = [ "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "jsonrpc-core 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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2677,7 +2677,7 @@ dependencies = [ "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -2779,7 +2779,7 @@ dependencies = [ "jsonrpc-ipc-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)", "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -2815,7 +2815,7 @@ dependencies = [ "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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", @@ -2879,7 +2879,7 @@ dependencies = [ "ethcore 1.12.0", "ethcore-sync 1.12.0", "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -3024,7 +3024,7 @@ dependencies = [ "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "keccak-hasher 0.1.1", "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)", @@ -3170,7 +3170,7 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.2.4" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", @@ -3431,7 +3431,7 @@ dependencies = [ "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -3475,7 +3475,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.3.0" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4219,7 +4219,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "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)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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)", ] @@ -4276,7 +4276,7 @@ dependencies = [ [[package]] name = "uint" version = "0.7.0" -source = "git+https://github.com/ordian/parity-common#fb390e968e54d93ec4b90a8a045999d8666d8940" +source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4423,7 +4423,7 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", - "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "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", @@ -4745,7 +4745,7 @@ dependencies = [ "checksum jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3372b3248a53abcca8f61924f188052bb0c4cd80b482b2b4eaf9f8667efb9f4" "checksum jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c873dac37a601fb88d40ba49eeac3f1aa60953c06b2e99ddbf0569b6f8028478" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" -"checksum keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "253bbe643c32c816bf58fa5a88248fafedeebb139705ad17a62add3517854a86" +"checksum keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)" = "" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" "checksum kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45bcdf5eb083602cff61a6f8438dce2a7900d714e893fc48781c39fb119d37aa" diff --git a/Cargo.toml b/Cargo.toml index 3ffb55e3ad1..866aa632b69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,7 +63,7 @@ parity-whisper = { path = "whisper" } parity-path = "0.1" dir = { path = "util/dir" } panic_hook = { path = "util/panic-hook" } -keccak-hash = "0.1" +keccak-hash = "0.1.4" migration-rocksdb = { path = "util/migration-rocksdb" } kvdb = "0.1" kvdb-rocksdb = "0.1.3" @@ -149,3 +149,5 @@ ethereum-types = { git = "https://github.com/ordian/parity-common" } ethbloom = { git = "https://github.com/ordian/parity-common" } rlp = { git = "https://github.com/ordian/parity-common" } primitive-types = { git = "https://github.com/ordian/parity-common" } +# TODO: fix keccak-hash upstream +keccak-hash = { git = "https://github.com/ordian/parity-common" } diff --git a/cli-signer/rpc-client/Cargo.toml b/cli-signer/rpc-client/Cargo.toml index 61a16b5e535..bb9ffe746f2 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -18,4 +18,4 @@ parking_lot = "0.7" jsonrpc-core = "10.0.1" jsonrpc-ws-server = "10.0.1" parity-rpc = { path = "../../rpc" } -keccak-hash = "0.1" +keccak-hash = "0.1.4" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index 684c94e3368..71a742e1af5 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] crunchy = "0.1.0" either = "1.0.0" ethereum-types = "0.5.2" -keccak-hash = "0.1" +keccak-hash = "0.1.4" log = "0.4" memmap = "0.6" parking_lot = "0.7" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 17c76aaae45..8d88a8bac0d 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -35,7 +35,7 @@ hash-db = "0.11.0" heapsize = "0.4" itertools = "0.5" journaldb = { path = "../util/journaldb" } -keccak-hash = "0.1" +keccak-hash = "0.1.4" keccak-hasher = { path = "../util/keccak-hasher" } kvdb = "0.1" kvdb-memorydb = "0.1" diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index ed32fda003a..2dac784c505 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -27,7 +27,7 @@ rlp_derive = { path = "../../util/rlp-derive" } [dev-dependencies] env_logger = "0.5" ethkey = { path = "../../accounts/ethkey" } -keccak-hash = "0.1" +keccak-hash = "0.1.4" rustc-hex = "1.0" tempdir = "0.3" kvdb-memorydb = "0.1" diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 64b78ea4a0e..82b4c6d42e2 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -11,7 +11,7 @@ heapsize = "0.4" lazy_static = "1.0" log = "0.4" vm = { path = "../vm" } -keccak-hash = "0.1" +keccak-hash = "0.1.4" parking_lot = "0.7" memory-cache = { path = "../../util/memory-cache" } num-bigint = "0.2" diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 3546c172043..7c2c178a467 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -36,7 +36,7 @@ serde = "1.0" serde_derive = "1.0" parking_lot = "0.7" stats = { path = "../../util/stats" } -keccak-hash = "0.1" +keccak-hash = "0.1.4" keccak-hasher = { path = "../../util/keccak-hasher" } triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } kvdb = "0.1" diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 50aac2726b5..6c1bed005de 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -21,7 +21,7 @@ ethkey = { path = "../../accounts/ethkey" } fetch = { path = "../../util/fetch" } futures = "0.1" heapsize = "0.4" -keccak-hash = "0.1.2" +keccak-hash = "0.1.4" log = "0.4" parity-bytes = "0.1" parity-crypto = "0.3.0" diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index f0e75b98dbc..4b164c4c3f9 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -21,7 +21,7 @@ ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } hash-db = "0.11.0" heapsize = "0.4" -keccak-hash = "0.1" +keccak-hash = "0.1.4" keccak-hasher = { path = "../../util/keccak-hasher" } kvdb = "0.1" log = "0.4" diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index 2bd5605f9bf..f01c65e7028 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -9,7 +9,7 @@ ethereum-types = "0.5.2" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" -keccak-hash = "0.1" +keccak-hash = "0.1.4" parity-bytes = "0.1" rlp = { version = "0.3.0", features = ["ethereum"] } rlp_derive = { path = "../../util/rlp-derive" } diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 75b3875a0ac..e08d9c44ca2 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -12,4 +12,4 @@ patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" ethjson = { path = "../../json" } rlp = { version = "0.3.0", features = ["ethereum"] } -keccak-hash = "0.1" +keccak-hash = "0.1.4" diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 10e831ee62e..82d0d6ca530 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -24,7 +24,7 @@ ethcore-call-contract = { path = "../ethcore/call-contract" } ethereum-types = "0.5.2" futures = "0.1" heapsize = "0.4" -keccak-hash = "0.1" +keccak-hash = "0.1.4" linked-hash-map = "0.5" log = "0.4" parity-runtime = { path = "../util/runtime" } diff --git a/miner/stratum/Cargo.toml b/miner/stratum/Cargo.toml index 520ce9f8954..218eb5488bc 100644 --- a/miner/stratum/Cargo.toml +++ b/miner/stratum/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] [dependencies] ethereum-types = "0.5.2" -keccak-hash = "0.1" +keccak-hash = "0.1.4" jsonrpc-core = "10.0.1" jsonrpc-tcp-server = "10.0.1" log = "0.4" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 353a9e637f2..38bd0729e06 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -54,7 +54,7 @@ ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } ethstore = { path = "../accounts/ethstore" } fetch = { path = "../util/fetch" } -keccak-hash = "0.1.2" +keccak-hash = "0.1.4" parity-runtime = { path = "../util/runtime" } parity-updater = { path = "../updater" } parity-version = { path = "../util/version" } diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index c9fafeb2bf3..d233b61b0c6 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -19,7 +19,7 @@ ethereum-types = "0.5.2" ethkey = { path = "../accounts/ethkey" } futures = "0.1" hyper = { version = "0.12", default-features = false } -keccak-hash = "0.1" +keccak-hash = "0.1.4" kvdb = "0.1" lazy_static = "1.0" log = "0.4" diff --git a/updater/Cargo.toml b/updater/Cargo.toml index 4ac1ed49add..5b837433b2c 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -13,7 +13,7 @@ ethabi-derive = "7.0.0" ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } ethereum-types = "0.5.2" -keccak-hash = "0.1" +keccak-hash = "0.1.4" lazy_static = "1.0" log = "0.4" parity-bytes = "0.1" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index 3f822d7f468..b8bc299f549 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -17,7 +17,7 @@ fetch = { path = "../../util/fetch" } parity-bytes = "0.1" ethereum-types = "0.5.2" parity-runtime = { path = "../../util/runtime" } -keccak-hash = "0.1" +keccak-hash = "0.1.4" registrar = { path = "../../util/registrar" } ethabi = "7.0.0" diff --git a/util/EIP-712/Cargo.toml b/util/EIP-712/Cargo.toml index c424c601285..cc266593efc 100644 --- a/util/EIP-712/Cargo.toml +++ b/util/EIP-712/Cargo.toml @@ -15,7 +15,7 @@ serde_derive = "1.0" serde = "1.0" serde_json = "1.0" ethabi = "7.0.0" -keccak-hash = "0.1" +keccak-hash = "0.1.4" ethereum-types = "0.5.2" failure = "0.1" itertools = "0.7" diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index eee589e2a3f..98e7df9a290 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -20,5 +20,5 @@ rlp = { version = "0.3.0", features = ["ethereum"] } [dev-dependencies] env_logger = "0.5" -keccak-hash = "0.1" +keccak-hash = "0.1.4" kvdb-memorydb = "0.1" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index 74a81e45a35..c03ac3cb16a 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -28,7 +28,7 @@ ethkey = { path = "../../accounts/ethkey" } rlp = { version = "0.3.0", features = ["ethereum"] } parity-path = "0.1" ipnetwork = "0.12.6" -keccak-hash = "0.1" +keccak-hash = "0.1.4" parity-snappy = "0.1" serde = "1.0" serde_json = "1.0" diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index 84f40beb815..bd1eb473851 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -16,5 +16,5 @@ elastic-array = "0.10" [dev-dependencies] memory-db = "0.11.0" -keccak-hash = "0.1.2" +keccak-hash = "0.1.4" journaldb = { path = "../journaldb" } diff --git a/util/registrar/Cargo.toml b/util/registrar/Cargo.toml index f0614718ee3..03ce8426727 100644 --- a/util/registrar/Cargo.toml +++ b/util/registrar/Cargo.toml @@ -10,4 +10,4 @@ futures = "0.1" ethabi = "7.0.0" ethabi-derive = "7.0.0" ethabi-contract = "7.0.0" -keccak-hash = "0.1" +keccak-hash = "0.1.4" From 09c92c2eccd315ee1ef682ea1302cb95baca8e44 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 14:35:40 +0200 Subject: [PATCH 13/90] wip --- ethcore/vm/src/action_params.rs | 10 +++++----- json/src/hash.rs | 8 ++++++++ util/EIP-712/src/encode.rs | 10 +++++----- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ethcore/vm/src/action_params.rs b/ethcore/vm/src/action_params.rs index 0d4959c1899..6970147323d 100644 --- a/ethcore/vm/src/action_params.rs +++ b/ethcore/vm/src/action_params.rs @@ -96,11 +96,11 @@ impl Default for ActionParams { /// Returns default ActionParams initialized with zeros fn default() -> ActionParams { ActionParams { - code_address: Address::new(), + code_address: Address::default(), code_hash: Some(KECCAK_EMPTY), - address: Address::new(), - sender: Address::new(), - origin: Address::new(), + address: Address::default(), + sender: Address::default(), + origin: Address::default(), gas: U256::zero(), gas_price: U256::zero(), value: ActionValue::Transfer(U256::zero()), @@ -116,7 +116,7 @@ impl From for ActionParams { fn from(t: ethjson::vm::Transaction) -> Self { let address: Address = t.address.into(); ActionParams { - code_address: Address::new(), + code_address: Address::default(), code_hash: Some(keccak(&*t.code)), address: address, sender: t.sender.into(), diff --git a/json/src/hash.rs b/json/src/hash.rs index 406c2a0b41c..b5c353a7a3e 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -21,6 +21,7 @@ use std::fmt; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::{Error, Visitor}; use ethereum_types::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, Bloom as Hash2048}; +use uint::Uint; macro_rules! impl_hash { ($name: ident, $inner: ident) => { @@ -85,6 +86,13 @@ macro_rules! impl_hash { } } + +impl Into for Uint { + fn into(self) -> u64 { + self.0.to_low_u64_be() + } +} + impl_hash!(H64, Hash64); impl_hash!(Address, Hash160); impl_hash!(H256, Hash256); diff --git a/util/EIP-712/src/encode.rs b/util/EIP-712/src/encode.rs index e386981d731..3feac8a8d0c 100644 --- a/util/EIP-712/src/encode.rs +++ b/util/EIP-712/src/encode.rs @@ -127,7 +127,7 @@ fn encode_data( items.append(&mut encoded); } - keccak(items).0.to_vec() + keccak(items).as_ref().to_vec() } Type::Custom(ref ident) if message_types.get(&*ident).is_some() => { @@ -141,7 +141,7 @@ fn encode_data( tokens.append(&mut encoded); } - keccak(tokens).to_vec() + keccak(tokens).as_ref().to_vec() } Type::Bytes => { @@ -152,7 +152,7 @@ fn encode_data( let bytes = (&string[2..]) .from_hex::>() .map_err(|err| ErrorKind::HexParseError(format!("{}", err)))?; - let bytes = keccak(&bytes).to_vec(); + let bytes = keccak(&bytes).as_ref().to_vec(); encode(&[EthAbiToken::FixedBytes(bytes)]) } @@ -171,7 +171,7 @@ fn encode_data( Type::String => { let value = value.as_str().ok_or_else(|| serde_error("string", field_name))?; - let hash = keccak(value).to_vec(); + let hash = keccak(value).as_ref().to_vec(); encode(&[EthAbiToken::FixedBytes(hash)]) } @@ -220,7 +220,7 @@ pub fn hash_structured_data(typed_data: EIP712) -> Result { encode_data(&parser, &Type::Custom(typed_data.primary_type), &typed_data.types, &typed_data.message, None)? ); let concat = [&prefix[..], &domain_hash[..], &data_hash[..]].concat(); - Ok(H256(keccak(concat).0)) + Ok(keccak(concat)) } #[cfg(test)] From ab906ca17b0c6f10aa8f582d6a35dfeb8ac6f644 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 15:01:23 +0200 Subject: [PATCH 14/90] [ethcore-network-devp2p] fix compilation errors --- util/network-devp2p/src/connection.rs | 57 ++++++++++++++++----------- util/network-devp2p/src/discovery.rs | 8 ++-- util/network-devp2p/src/handshake.rs | 25 ++++++------ util/network-devp2p/src/host.rs | 2 +- util/network-devp2p/src/node_table.rs | 2 +- 5 files changed, 53 insertions(+), 41 deletions(-) diff --git a/util/network-devp2p/src/connection.rs b/util/network-devp2p/src/connection.rs index ae34ec44cf9..b8e530f8af5 100644 --- a/util/network-devp2p/src/connection.rs +++ b/util/network-devp2p/src/connection.rs @@ -298,37 +298,40 @@ impl EncryptedConnection { /// Create an encrypted connection out of the handshake. pub fn new(handshake: &mut Handshake) -> Result { let shared = crypto::ecdh::agree(handshake.ecdhe.secret(), &handshake.remote_ephemeral)?; - let mut nonce_material = H512::new(); + let mut nonce_material = H512::default(); if handshake.originated { - handshake.remote_nonce.copy_to(&mut nonce_material[0..32]); - handshake.nonce.copy_to(&mut nonce_material[32..64]); + (&mut nonce_material[0..32]).copy_from_slice(handshake.remote_nonce.as_bytes()); + (&mut nonce_material[32..64]).copy_from_slice(handshake.nonce.as_bytes()); } else { - handshake.nonce.copy_to(&mut nonce_material[0..32]); - handshake.remote_nonce.copy_to(&mut nonce_material[32..64]); + (&mut nonce_material[0..32]).copy_from_slice(handshake.nonce.as_bytes()); + (&mut nonce_material[32..64]).copy_from_slice(handshake.remote_nonce.as_bytes()); } - let mut key_material = H512::new(); - shared.copy_to(&mut key_material[0..32]); + let mut key_material = H512::default(); + (&mut key_material[0..32]).copy_from_slice(shared.as_bytes()); write_keccak(&nonce_material, &mut key_material[32..64]); - keccak(&key_material).copy_to(&mut key_material[32..64]); - keccak(&key_material).copy_to(&mut key_material[32..64]); + let key_material_keccak = keccak(&key_material); + (&mut key_material[32..64]).copy_from_slice(key_material_keccak.as_bytes()); + let key_material_keccak = keccak(&key_material); + (&mut key_material[32..64]).copy_from_slice(key_material_keccak.as_bytes()); let iv = vec![0u8; 16]; let encoder = CtrMode::new(AesSafe256Encryptor::new(&key_material[32..64]), iv); let iv = vec![0u8; 16]; let decoder = CtrMode::new(AesSafe256Encryptor::new(&key_material[32..64]), iv); - keccak(&key_material).copy_to(&mut key_material[32..64]); + let key_material_keccak = keccak(&key_material); + (&mut key_material[32..64]).copy_from_slice(key_material_keccak.as_bytes()); let mac_encoder = EcbEncryptor::new(AesSafe256Encryptor::new(&key_material[32..64]), NoPadding); let mut egress_mac = Keccak::new_keccak256(); let mut mac_material = H256::from_slice(&key_material[32..64]) ^ handshake.remote_nonce; - egress_mac.update(&mac_material); + egress_mac.update(mac_material.as_bytes()); egress_mac.update(if handshake.originated { &handshake.auth_cipher } else { &handshake.ack_cipher }); let mut ingress_mac = Keccak::new_keccak256(); mac_material = H256::from_slice(&key_material[32..64]) ^ handshake.nonce; - ingress_mac.update(&mac_material); + ingress_mac.update(mac_material.as_bytes()); ingress_mac.update(if handshake.originated { &handshake.ack_cipher } else { &handshake.auth_cipher }); let old_connection = handshake.connection.try_clone()?; @@ -385,14 +388,18 @@ impl EncryptedConnection { } EncryptedConnection::update_mac(&mut self.ingress_mac, &mut self.mac_encoder, &header[0..16]); let mac = &header[16..]; - let mut expected = H256::new(); - self.ingress_mac.clone().finalize(&mut expected); + let mut expected = H256::default(); + self.ingress_mac.clone().finalize(expected.as_bytes_mut()); if mac != &expected[0..16] { return Err(ErrorKind::Auth.into()); } - let mut hdec = H128::new(); - self.decoder.decrypt(&mut RefReadBuffer::new(&header[0..16]), &mut RefWriteBuffer::new(&mut hdec), false).expect("Invalid length or padding"); + let mut hdec = H128::default(); + self.decoder.decrypt( + &mut RefReadBuffer::new(&header[0..16]), + &mut RefWriteBuffer::new(hdec.as_bytes_mut()), + false, + ).expect("Invalid length or padding"); let length = ((((hdec[0] as u32) << 8) + (hdec[1] as u32)) << 8) + (hdec[2] as u32); let header_rlp = Rlp::new(&hdec[3..6]); @@ -418,8 +425,8 @@ impl EncryptedConnection { self.ingress_mac.update(&payload[0..payload.len() - 16]); EncryptedConnection::update_mac(&mut self.ingress_mac, &mut self.mac_encoder, &[0u8; 0]); let mac = &payload[(payload.len() - 16)..]; - let mut expected = H128::new(); - self.ingress_mac.clone().finalize(&mut expected); + let mut expected = H128::default(); + self.ingress_mac.clone().finalize(expected.as_bytes_mut()); if mac != &expected[..] { return Err(ErrorKind::Auth.into()); } @@ -436,14 +443,18 @@ impl EncryptedConnection { /// Update MAC after reading or writing any data. fn update_mac(mac: &mut Keccak, mac_encoder: &mut EcbEncryptor>, seed: &[u8]) { - let mut prev = H128::new(); - mac.clone().finalize(&mut prev); - let mut enc = H128::new(); - mac_encoder.encrypt(&mut RefReadBuffer::new(&prev), &mut RefWriteBuffer::new(&mut enc), true).expect("Error updating MAC"); + let mut prev = H128::default(); + mac.clone().finalize(prev.as_bytes_mut()); + let mut enc = H128::default(); + mac_encoder.encrypt( + &mut RefReadBuffer::new(prev.as_bytes()), + &mut RefWriteBuffer::new(enc.as_bytes_mut()), + true + ).expect("Error updating MAC"); mac_encoder.reset(); enc = enc ^ if seed.is_empty() { prev } else { H128::from_slice(seed) }; - mac.update(&enc); + mac.update(enc.as_bytes()); } /// Readable IO handler. Tracker receive status and returns decoded packet if available. diff --git a/util/network-devp2p/src/discovery.rs b/util/network-devp2p/src/discovery.rs index 7bf8dc62e5e..bdbc021d2fa 100644 --- a/util/network-devp2p/src/discovery.rs +++ b/util/network-devp2p/src/discovery.rs @@ -197,7 +197,7 @@ impl<'a> Discovery<'a> { public_endpoint: public, discovery_initiated: false, discovery_round: None, - discovery_id: NodeId::new(), + discovery_id: NodeId::default(), discovery_nodes: HashSet::new(), node_buckets: (0..ADDRESS_BITS).map(|_| NodeBucket::new()).collect(), other_observed_nodes: LruCache::new(OBSERVED_NODES_MAX_SIZE), @@ -414,7 +414,7 @@ impl<'a> Discovery<'a> { fn send_packet(&mut self, packet_id: u8, address: &SocketAddr, payload: &[u8]) -> Result { let packet = assemble_packet(packet_id, payload, &self.secret)?; - let hash = H256::from(&packet[0..32]); + let hash = H256::from_slice(&packet[0..32]); self.send_to(packet, address.clone()); Ok(hash) } @@ -491,7 +491,7 @@ impl<'a> Discovery<'a> { let packet_id = signed[0]; let rlp = Rlp::new(&signed[1..]); match packet_id { - PACKET_PING => self.on_ping(&rlp, &node_id, &from, &hash_signed), + PACKET_PING => self.on_ping(&rlp, &node_id, &from, hash_signed.as_bytes()), PACKET_PONG => self.on_pong(&rlp, &node_id, &from), PACKET_FIND_NODE => self.on_find_node(&rlp, &node_id, &from), PACKET_NEIGHBOURS => self.on_neighbours(&rlp, &node_id, &from), @@ -860,7 +860,7 @@ fn assemble_packet(packet_id: u8, bytes: &[u8], secret: &Secret) -> Result, socket: TcpStream, nonce: &H256) -> Result { Ok(Handshake { - id: if let Some(id) = id { *id } else { NodeId::new() }, + id: if let Some(id) = id { *id } else { NodeId::default() }, connection: Connection::new(token, socket), originated: false, state: HandshakeState::New, ecdhe: Random.generate()?, nonce: *nonce, - remote_ephemeral: Public::new(), - remote_nonce: H256::new(), + remote_ephemeral: Public::default(), + remote_nonce: H256::default(), remote_version: PROTOCOL_VERSION, auth_cipher: Bytes::new(), ack_cipher: Bytes::new(), @@ -149,8 +149,9 @@ impl Handshake { } fn set_auth(&mut self, host_secret: &Secret, sig: &[u8], remote_public: &[u8], remote_nonce: &[u8], remote_version: u64) -> Result<(), Error> { - self.id.clone_from_slice(remote_public); - self.remote_nonce.clone_from_slice(remote_nonce); + // TODO: assign_from_slice will panic if sizes differ + self.id.assign_from_slice(remote_public); + self.remote_nonce.assign_from_slice(remote_nonce); self.remote_version = remote_version; let shared = *ecdh::agree(host_secret, &self.id)?; let signature = H520::from_slice(sig); @@ -199,7 +200,7 @@ impl Handshake { let remote_public: Public = rlp.val_at(1)?; let remote_nonce: H256 = rlp.val_at(2)?; let remote_version: u64 = rlp.val_at(3)?; - self.set_auth(secret, &signature, &remote_public, &remote_nonce, remote_version)?; + self.set_auth(secret, signature.as_bytes(), remote_public.as_bytes(), remote_nonce.as_bytes(), remote_version)?; self.write_ack_eip8(io)?; Ok(()) } @@ -214,8 +215,8 @@ impl Handshake { self.ack_cipher = data.to_vec(); match ecies::decrypt(secret, &[], data) { Ok(ack) => { - self.remote_ephemeral.clone_from_slice(&ack[0..64]); - self.remote_nonce.clone_from_slice(&ack[64..(64+32)]); + self.remote_ephemeral.assign_from_slice(&ack[0..64]); + self.remote_nonce.assign_from_slice(&ack[64..(64+32)]); self.state = HandshakeState::StartSession; } Err(_) => { @@ -261,8 +262,8 @@ impl Handshake { let shared = *ecdh::agree(secret, &self.id)?; sig.copy_from_slice(&*sign(self.ecdhe.secret(), &(shared ^ self.nonce))?); write_keccak(self.ecdhe.public(), hepubk); - pubk.copy_from_slice(public); - nonce.copy_from_slice(&self.nonce); + pubk.copy_from_slice(public.as_bytes()); + nonce.copy_from_slice(self.nonce.as_bytes()); } let message = ecies::encrypt(&self.id, &[], &data)?; self.auth_cipher = message.clone(); @@ -281,8 +282,8 @@ impl Handshake { data[len - 1] = 0x0; let (epubk, rest) = data.split_at_mut(64); let (nonce, _) = rest.split_at_mut(32); - self.ecdhe.public().copy_to(epubk); - self.nonce.copy_to(nonce); + epubk.copy_from_slice(self.ecdhe.public().as_bytes()); + nonce.copy_from_slice(self.nonce.as_bytes()); } let message = ecies::encrypt(&self.id, &[], &data)?; self.ack_cipher = message.clone(); diff --git a/util/network-devp2p/src/host.rs b/util/network-devp2p/src/host.rs index 3dc107d2b20..ad08029fe6e 100644 --- a/util/network-devp2p/src/host.rs +++ b/util/network-devp2p/src/host.rs @@ -1223,7 +1223,7 @@ fn save_key(path: &Path, key: &Secret) { if let Err(e) = restrict_permissions_owner(path, true, false) { warn!(target: "network", "Failed to modify permissions of the file ({})", e); } - if let Err(e) = file.write(&key.hex().into_bytes()[2..]) { + if let Err(e) = file.write(&format!("{:x}", key).into_bytes()[2..]) { warn!("Error writing key file: {:?}", e); } } diff --git a/util/network-devp2p/src/node_table.rs b/util/network-devp2p/src/node_table.rs index db51890082d..12f5a0b666f 100644 --- a/util/network-devp2p/src/node_table.rs +++ b/util/network-devp2p/src/node_table.rs @@ -211,7 +211,7 @@ impl FromStr for Node { (s[8..136].parse().map_err(|_| ErrorKind::InvalidNodeId)?, NodeEndpoint::from_str(&s[137..])?) } else { - (NodeId::new(), NodeEndpoint::from_str(s)?) + (NodeId::default(), NodeEndpoint::from_str(s)?) }; Ok(Node { From c974f9229910218fb20a4a6b3b38bf54668f8c1a Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 15:03:49 +0200 Subject: [PATCH 15/90] [vm] fix compilation errors --- ethcore/vm/src/tests.rs | 6 +++--- json/src/hash.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ethcore/vm/src/tests.rs b/ethcore/vm/src/tests.rs index 306ad871da9..42d983896a7 100644 --- a/ethcore/vm/src/tests.rs +++ b/ethcore/vm/src/tests.rs @@ -107,11 +107,11 @@ impl FakeExt { impl Ext for FakeExt { fn initial_storage_at(&self, _key: &H256) -> Result { - Ok(H256::new()) + Ok(H256::default()) } fn storage_at(&self, key: &H256) -> Result { - Ok(self.store.get(key).unwrap_or(&H256::new()).clone()) + Ok(self.store.get(key).unwrap_or(&H256::default()).clone()) } fn set_storage(&mut self, key: H256, value: H256) -> Result<()> { @@ -136,7 +136,7 @@ impl Ext for FakeExt { } fn blockhash(&mut self, number: &U256) -> H256 { - self.blockhashes.get(number).unwrap_or(&H256::new()).clone() + self.blockhashes.get(number).unwrap_or(&H256::default()).clone() } fn create( diff --git a/json/src/hash.rs b/json/src/hash.rs index b5c353a7a3e..9c0f08e6974 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -89,7 +89,7 @@ macro_rules! impl_hash { impl Into for Uint { fn into(self) -> u64 { - self.0.to_low_u64_be() + self.0.low_u64() } } From 17e8e5236641f0dca65f322e10d1697c95910c90 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 17:45:47 +0200 Subject: [PATCH 16/90] [common-types, evm, wasm] fix compilation errors --- Cargo.lock | 35 ++++++++++---------- ethcore/evm/src/interpreter/gasometer.rs | 8 ++--- ethcore/evm/src/interpreter/mod.rs | 29 ++++++++-------- ethcore/types/src/account_diff.rs | 11 +++--- ethcore/types/src/filter.rs | 4 +-- ethcore/types/src/log_entry.rs | 4 +-- ethcore/types/src/transaction/transaction.rs | 14 ++++---- ethcore/wasm/src/runtime.rs | 22 ++++++------ 8 files changed, 66 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f9d8586127..cc9070efaee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -701,11 +701,12 @@ dependencies = [ [[package]] name = "ethbloom" -version = "0.6.3" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +version = "0.6.4" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", + "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1194,14 +1195,14 @@ dependencies = [ [[package]] name = "ethereum-types" version = "0.5.2" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ - "ethbloom 0.6.3 (git+https://github.com/ordian/parity-common)", + "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", "primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)", - "uint 0.7.0 (git+https://github.com/ordian/parity-common)", + "uint 0.7.1 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -1439,7 +1440,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1767,7 +1768,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1775,7 +1776,7 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.1.1" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", ] @@ -1783,7 +1784,7 @@ dependencies = [ [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2035,7 +2036,7 @@ dependencies = [ [[package]] name = "keccak-hash" version = "0.1.4" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3170,13 +3171,13 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.2.4" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", - "uint 0.7.0 (git+https://github.com/ordian/parity-common)", + "uint 0.7.1 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -3475,7 +3476,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.3.0" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4275,8 +4276,8 @@ dependencies = [ [[package]] name = "uint" -version = "0.7.0" -source = "git+https://github.com/ordian/parity-common#83470befa8e3dc0507b81f1920e31cf6ff25e0cd" +version = "0.7.1" +source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4677,7 +4678,7 @@ dependencies = [ "checksum ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b51f33d0b3998b4330d6b5a4b1b02a03d3c96b5de44d563929e232f4a30ba7e2" "checksum ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ae5f5517ad9270a91ea7c86487a4872ded693f5d039b4d3da210237980ddd3bf" "checksum ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a93a43ce2e9f09071449da36bfa7a1b20b950ee344b6904ff23de493b03b386" -"checksum ethbloom 0.6.3 (git+https://github.com/ordian/parity-common)" = "" +"checksum ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)" = "" "checksum ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e742184dc63a01c8ea0637369f8faa27c40f537949908a237f95c05e68d2c96" "checksum ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)" = "" "checksum ethereum-types-serialize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1873d77b32bc1891a79dad925f2acbc318ee942b38b9110f9dbc5fbeffcea350" @@ -4949,7 +4950,7 @@ dependencies = [ "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" "checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" -"checksum uint 0.7.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum uint 0.7.1 (git+https://github.com/ordian/parity-common)" = "" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" diff --git a/ethcore/evm/src/interpreter/gasometer.rs b/ethcore/evm/src/interpreter/gasometer.rs index 26fec2d9376..fe6d0290ace 100644 --- a/ethcore/evm/src/interpreter/gasometer.rs +++ b/ethcore/evm/src/interpreter/gasometer.rs @@ -15,7 +15,7 @@ // along with Parity Ethereum. If not, see . use std::cmp; -use ethereum_types::{U256, H256}; +use ethereum_types::{BigEndianHash, U256}; use super::u256_to_address; use {evm, vm}; @@ -121,12 +121,12 @@ impl Gasometer { Request::Gas(Gas::from(1)) }, instructions::SSTORE => { - let address = H256::from(stack.peek(0)); + let address = BigEndianHash::from_uint(stack.peek(0)); let newval = stack.peek(1); - let val = U256::from(&*ext.storage_at(&address)?); + let val = ext.storage_at(&address)?.into_uint(); let gas = if schedule.eip1283 { - let orig = U256::from(&*ext.initial_storage_at(&address)?); + let orig = ext.initial_storage_at(&address)?.into_uint(); calculate_eip1283_sstore_gas(schedule, &orig, &val, &newval) } else { if val.is_zero() && !newval.is_zero() { diff --git a/ethcore/evm/src/interpreter/mod.rs b/ethcore/evm/src/interpreter/mod.rs index 84231abb577..4ff6dad88ca 100644 --- a/ethcore/evm/src/interpreter/mod.rs +++ b/ethcore/evm/src/interpreter/mod.rs @@ -28,7 +28,7 @@ use std::{cmp, mem}; use std::sync::Arc; use hash::keccak; use bytes::Bytes; -use ethereum_types::{U256, H256, Address}; +use ethereum_types::{U256, H256, Address, BigEndianHash}; use num_bigint::BigUint; use vm::{ @@ -520,7 +520,7 @@ impl Interpreter { let init_size = self.stack.pop_back(); let address_scheme = match instruction { instructions::CREATE => CreateContractAddress::FromSenderAndNonce, - instructions::CREATE2 => CreateContractAddress::FromSenderSaltAndCodeHash(self.stack.pop_back().into()), + instructions::CREATE2 => CreateContractAddress::FromSenderSaltAndCodeHash(BigEndianHash::from_uint(&self.stack.pop_back())), _ => unreachable!("instruction can only be CREATE/CREATE2 checked above; qed"), }; @@ -677,7 +677,7 @@ impl Interpreter { let size = self.stack.pop_back(); let topics = self.stack.pop_n(no_of_topics) .iter() - .map(H256::from) + .map(BigEndianHash::from_uint) .collect(); ext.log(topics, self.mem.read_slice(offset, size))?; }, @@ -714,21 +714,21 @@ impl Interpreter { let offset = self.stack.pop_back(); let size = self.stack.pop_back(); let k = keccak(self.mem.read_slice(offset, size)); - self.stack.push(U256::from(&*k)); + self.stack.push(k.into_uint()); }, instructions::SLOAD => { - let key = H256::from(&self.stack.pop_back()); - let word = U256::from(&*ext.storage_at(&key)?); + let key = BigEndianHash::from_uint(&self.stack.pop_back()); + let word = ext.storage_at(&key)?.into_uint(); self.stack.push(word); }, instructions::SSTORE => { - let address = H256::from(&self.stack.pop_back()); + let address = BigEndianHash::from_uint(&self.stack.pop_back()); let val = self.stack.pop_back(); - let current_val = U256::from(&*ext.storage_at(&address)?); + let current_val = ext.storage_at(&address)?.into_uint(); // Increase refund for clear if ext.schedule().eip1283 { - let original_val = U256::from(&*ext.initial_storage_at(&address)?); + let original_val = ext.initial_storage_at(&address)?.into_uint(); gasometer::handle_eip1283_sstore_clears_refund(ext, &original_val, ¤t_val, &val); } else { if !current_val.is_zero() && val.is_zero() { @@ -736,7 +736,7 @@ impl Interpreter { ext.add_sstore_refund(sstore_clears_schedule); } } - ext.set_storage(address, H256::from(&val))?; + ext.set_storage(address, BigEndianHash::from_uint(&val))?; }, instructions::PC => { self.stack.push(U256::from(self.reader.position - 1)); @@ -797,7 +797,7 @@ impl Interpreter { instructions::EXTCODEHASH => { let address = u256_to_address(&self.stack.pop_back()); let hash = ext.extcodehash(&address)?.unwrap_or_else(H256::zero); - self.stack.push(U256::from(hash)); + self.stack.push(hash.into_uint()); }, instructions::CALLDATACOPY => { Self::copy_data_to_memory(&mut self.mem, &mut self.stack, &self.params.data.as_ref().map_or_else(|| &[] as &[u8], |d| &*d as &[u8])); @@ -831,7 +831,7 @@ impl Interpreter { instructions::BLOCKHASH => { let block_number = self.stack.pop_back(); let block_hash = ext.blockhash(&block_number); - self.stack.push(U256::from(&*block_hash)); + self.stack.push(block_hash.into_uint()); }, instructions::COINBASE => { self.stack.push(address_to_u256(ext.env_info().author.clone())); @@ -1182,12 +1182,13 @@ fn set_sign(value: U256, sign: bool) -> U256 { #[inline] fn u256_to_address(value: &U256) -> Address { - Address::from(H256::from(value)) + let addr: H256 = BigEndianHash::from_uint(value); + Address::from(addr) } #[inline] fn address_to_u256(value: Address) -> U256 { - U256::from(&*H256::from(value)) + H256::from(value).into_uint() } #[cfg(test)] diff --git a/ethcore/types/src/account_diff.rs b/ethcore/types/src/account_diff.rs index 09751ba4554..91e6469b565 100644 --- a/ethcore/types/src/account_diff.rs +++ b/ethcore/types/src/account_diff.rs @@ -19,7 +19,8 @@ use std::cmp::*; use std::fmt; use std::collections::BTreeMap; -use ethereum_types::{H256, U256}; +use std::convert::TryInto; +use ethereum_types::{BigEndianHash as _, H256, U256}; use bytes::Bytes; #[derive(Debug, PartialEq, Eq, Clone)] @@ -104,10 +105,10 @@ impl AccountDiff { // TODO: refactor into something nicer. fn interpreted_hash(u: &H256) -> String { - if u <= &H256::from(0xffffffff) { - format!("{} = 0x{:x}", U256::from(&**u).low_u32(), U256::from(&**u).low_u32()) - } else if u <= &H256::from(u64::max_value()) { - format!("{} = 0x{:x}", U256::from(&**u).low_u64(), U256::from(&**u).low_u64()) + let uint = u.into_uint(); + let uint_64: Result = uint.try_into(); + if let Ok(n) = uint_64 { + format!("{} = {:#x}", n, n) // } else if u <= &H256::from("0xffffffffffffffffffffffffffffffffffffffff") { // format!("@{}", Address::from(u)) } else { diff --git a/ethcore/types/src/filter.rs b/ethcore/types/src/filter.rs index 71e8d394414..2ab8f4473ed 100644 --- a/ethcore/types/src/filter.rs +++ b/ethcore/types/src/filter.rs @@ -76,7 +76,7 @@ impl Filter { let blooms = match self.address { Some(ref addresses) if !addresses.is_empty() => addresses.iter() - .map(|ref address| Bloom::from(BloomInput::Raw(address))) + .map(|ref address| Bloom::from(BloomInput::Raw(address.as_bytes()))) .collect(), _ => vec![Bloom::default()] }; @@ -86,7 +86,7 @@ impl Filter { Some(ref topics) => bs.into_iter().flat_map(|bloom| { topics.into_iter().map(|topic| { let mut b = bloom.clone(); - b.accrue(BloomInput::Raw(topic)); + b.accrue(BloomInput::Raw(topic.as_bytes())); b }).collect::>() }).collect() diff --git a/ethcore/types/src/log_entry.rs b/ethcore/types/src/log_entry.rs index a5087b2a003..cbbfb55bb9c 100644 --- a/ethcore/types/src/log_entry.rs +++ b/ethcore/types/src/log_entry.rs @@ -44,8 +44,8 @@ impl HeapSizeOf for LogEntry { impl LogEntry { /// Calculates the bloom of this log entry. pub fn bloom(&self) -> Bloom { - self.topics.iter().fold(Bloom::from(BloomInput::Raw(&self.address)), |mut b, t| { - b.accrue(BloomInput::Raw(t)); + self.topics.iter().fold(Bloom::from(BloomInput::Raw(self.address.as_bytes())), |mut b, t| { + b.accrue(BloomInput::Raw(t.as_bytes())); b }) } diff --git a/ethcore/types/src/transaction/transaction.rs b/ethcore/types/src/transaction/transaction.rs index 248bc264629..86f311960ab 100644 --- a/ethcore/types/src/transaction/transaction.rs +++ b/ethcore/types/src/transaction/transaction.rs @@ -18,7 +18,7 @@ use std::ops::Deref; -use ethereum_types::{H256, H160, Address, U256}; +use ethereum_types::{H256, H160, Address, U256, BigEndianHash}; use ethjson; use ethkey::{self, Signature, Secret, Public, recover, public_to_address}; use hash::keccak; @@ -179,7 +179,7 @@ impl From for UnverifiedTransaction { r: t.r.into(), s: t.s.into(), v: t.v.into(), - hash: 0.into(), + hash: H256::default(), }.compute_hash() } } @@ -207,7 +207,7 @@ impl Transaction { r: sig.r().into(), s: sig.s().into(), v: signature::add_chain_replay_protection(sig.v() as u64, chain_id), - hash: 0.into(), + hash: H256::default(), }.compute_hash() } @@ -231,7 +231,7 @@ impl Transaction { r: U256::one(), s: U256::one(), v: 0, - hash: 0.into(), + hash: H256::default(), }.compute_hash(), sender: from, public: None, @@ -246,7 +246,7 @@ impl Transaction { r: U256::zero(), s: U256::zero(), v: chain_id, - hash: 0.into(), + hash: H256::default(), }.compute_hash(), sender: UNSIGNED_SENDER, public: None, @@ -360,7 +360,9 @@ impl UnverifiedTransaction { /// Construct a signature object from the sig. pub fn signature(&self) -> Signature { - Signature::from_rsv(&self.r.into(), &self.s.into(), self.standard_v()) + let r: H256 = BigEndianHash::from_uint(&self.r); + let s: H256 = BigEndianHash::from_uint(&self.s); + Signature::from_rsv(&r, &s, self.standard_v()) } /// Checks whether the signature has a low 's' value. diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index 8466c3b8d90..164bde99eb2 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -15,7 +15,7 @@ // along with Parity Ethereum. If not, see . use std::cmp; -use ethereum_types::{U256, H256, Address}; +use ethereum_types::{BigEndianHash, U256, H256, Address}; use vm::{self, CallType}; use wasmi::{self, MemoryRef, RuntimeArgs, RuntimeValue, Error as InterpreterError, Trap, TrapKind}; use super::panic_payload; @@ -168,7 +168,7 @@ impl<'a> Runtime<'a> { let mut buf = [0u8; 32]; self.memory.get_into(ptr, &mut buf[..])?; - Ok(H256::from(&buf[..])) + Ok(H256::from_slice(&buf[..])) } /// Loads 160-bit hash (Ethereum address) from the specified sandboxed memory pointer @@ -176,7 +176,7 @@ impl<'a> Runtime<'a> { let mut buf = [0u8; 20]; self.memory.get_into(ptr, &mut buf[..])?; - Ok(Address::from(&buf[..])) + Ok(Address::from_slice(&buf[..])) } /// Loads 256-bit integer represented with bigendian from the specified sandboxed memory pointer @@ -262,7 +262,7 @@ impl<'a> Runtime<'a> { self.adjusted_charge(|schedule| schedule.sload_gas as u64)?; - self.memory.set(val_ptr as u32, &*val)?; + self.memory.set(val_ptr as u32, val.as_bytes())?; Ok(()) } @@ -502,14 +502,14 @@ impl<'a> Runtime<'a> { fn return_address_ptr(&mut self, ptr: u32, val: Address) -> Result<()> { self.charge(|schedule| schedule.wasm().static_address as u64)?; - self.memory.set(ptr, &*val)?; + self.memory.set(ptr, val.as_bytes())?; Ok(()) } fn return_u256_ptr(&mut self, ptr: u32, val: U256) -> Result<()> { - let value: H256 = val.into(); + let value: H256 = BigEndianHash::from_uint(&val); self.charge(|schedule| schedule.wasm().static_u256 as u64)?; - self.memory.set(ptr, &*value)?; + self.memory.set(ptr, value.as_bytes())?; Ok(()) } @@ -531,7 +531,7 @@ impl<'a> Runtime<'a> { match self.ext.create(&gas_left, &endowment, &code, scheme, false).ok().expect("Trap is false; trap error will not happen; qed") { vm::ContractCreateResult::Created(address, gas_left) => { - self.memory.set(result_ptr, &*address)?; + self.memory.set(result_ptr, address.as_bytes())?; self.gas_counter = self.gas_limit - // this cannot overflow, since initial gas is in [0..u64::max) range, // and gas_left cannot be bigger @@ -598,7 +598,7 @@ impl<'a> Runtime<'a> { trace!(target: "wasm", "runtime: CREATE2"); let endowment = self.u256_at(args.nth_checked(0)?)?; trace!(target: "wasm", " val: {:?}", endowment); - let salt: H256 = self.u256_at(args.nth_checked(1)?)?.into(); + let salt: H256 = BigEndianHash::from_uint(&self.u256_at(args.nth_checked(1)?)?); trace!(target: "wasm", " salt: {:?}", salt); let code_ptr: u32 = args.nth_checked(2)?; trace!(target: "wasm", " code_ptr: {:?}", code_ptr); @@ -646,7 +646,7 @@ impl<'a> Runtime<'a> { pub fn blockhash(&mut self, args: RuntimeArgs) -> Result<()> { self.adjusted_charge(|schedule| schedule.blockhash_gas as u64)?; let hash = self.ext.blockhash(&U256::from(args.nth_checked::(0)?)); - self.memory.set(args.nth_checked(1)?, &*hash)?; + self.memory.set(args.nth_checked(1)?, hash.as_bytes())?; Ok(()) } @@ -736,7 +736,7 @@ impl<'a> Runtime<'a> { *topics.get_mut(i as usize) .expect("topics is resized to `topic_count`, i is in 0..topic count iterator, get_mut uses i as an indexer, get_mut cannot fail; qed") - = H256::from(&self.memory.get(offset, 32)?[..]); + = H256::from_slice(&self.memory.get(offset, 32)?[..]); } self.ext.log(topics, &self.memory.get(data_ptr, data_len as usize)?).map_err(|_| Error::Log)?; From c188f13c5cfb285f2651e89d64796a81416a1209 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 17:54:36 +0200 Subject: [PATCH 17/90] [ethcore-db] Require AsRef instead of Deref for keys --- ethcore/db/src/db.rs | 40 ++++++++++++++++++++-------------------- ethcore/db/src/keys.rs | 20 ++++++++------------ 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/ethcore/db/src/db.rs b/ethcore/db/src/db.rs index c00f63eac23..08a441235da 100644 --- a/ethcore/db/src/db.rs +++ b/ethcore/db/src/db.rs @@ -16,7 +16,7 @@ //! Database utilities and definitions. -use std::ops::Deref; +use std::convert::AsRef; use std::hash::Hash; use std::collections::HashMap; use parking_lot::RwLock; @@ -82,7 +82,7 @@ impl Cache for HashMap where K: Hash + Eq { /// Should be used to get database key associated with given value. pub trait Key { /// The db key associated with this value. - type Target: Deref; + type Target: AsRef<[u8]>; /// Returns db key. fn key(&self) -> Self::Target; @@ -91,16 +91,16 @@ pub trait Key { /// Should be used to write value into database. pub trait Writable { /// Writes the value into the database. - fn write(&mut self, col: Option, key: &Key, value: &T) where T: rlp::Encodable, R: Deref; + fn write(&mut self, col: Option, key: &Key, value: &T) where T: rlp::Encodable, R: AsRef<[u8]>; /// Deletes key from the databse. - fn delete(&mut self, col: Option, key: &Key) where T: rlp::Encodable, R: Deref; + fn delete(&mut self, col: Option, key: &Key) where T: rlp::Encodable, R: AsRef<[u8]>; /// Writes the value into the database and updates the cache. fn write_with_cache(&mut self, col: Option, cache: &mut Cache, key: K, value: T, policy: CacheUpdatePolicy) where K: Key + Hash + Eq, T: rlp::Encodable, - R: Deref { + R: AsRef<[u8]> { self.write(col, &key, &value); match policy { CacheUpdatePolicy::Overwrite => { @@ -116,7 +116,7 @@ pub trait Writable { fn extend_with_cache(&mut self, col: Option, cache: &mut Cache, values: HashMap, policy: CacheUpdatePolicy) where K: Key + Hash + Eq, T: rlp::Encodable, - R: Deref { + R: AsRef<[u8]> { match policy { CacheUpdatePolicy::Overwrite => { for (key, value) in values { @@ -137,7 +137,7 @@ pub trait Writable { fn extend_with_option_cache(&mut self, col: Option, cache: &mut Cache>, values: HashMap>, policy: CacheUpdatePolicy) where K: Key + Hash + Eq, T: rlp::Encodable, - R: Deref { + R: AsRef<[u8]> { match policy { CacheUpdatePolicy::Overwrite => { for (key, value) in values { @@ -167,7 +167,7 @@ pub trait Readable { /// Returns value for given key. fn read(&self, col: Option, key: &Key) -> Option where T: rlp::Decodable, - R: Deref; + R: AsRef<[u8]>; /// Returns value for given key either in cache or in database. fn read_with_cache(&self, col: Option, cache: &RwLock, key: &K) -> Option where @@ -189,12 +189,12 @@ pub trait Readable { } /// Returns true if given value exists. - fn exists(&self, col: Option, key: &Key) -> bool where R: Deref; + fn exists(&self, col: Option, key: &Key) -> bool where R: AsRef<[u8]>; /// Returns true if given value exists either in cache or in database. fn exists_with_cache(&self, col: Option, cache: &RwLock, key: &K) -> bool where K: Eq + Hash + Key, - R: Deref, + R: AsRef<[u8]>, C: Cache { { let read = cache.read(); @@ -208,31 +208,31 @@ pub trait Readable { } impl Writable for DBTransaction { - fn write(&mut self, col: Option, key: &Key, value: &T) where T: rlp::Encodable, R: Deref { - self.put(col, &key.key(), &rlp::encode(value)); + fn write(&mut self, col: Option, key: &Key, value: &T) where T: rlp::Encodable, R: AsRef<[u8]> { + self.put(col, key.key().as_ref(), &rlp::encode(value)); } - fn delete(&mut self, col: Option, key: &Key) where T: rlp::Encodable, R: Deref { - self.delete(col, &key.key()); + fn delete(&mut self, col: Option, key: &Key) where T: rlp::Encodable, R: AsRef<[u8]> { + self.delete(col, key.key().as_ref()); } } impl Readable for KVDB { fn read(&self, col: Option, key: &Key) -> Option - where T: rlp::Decodable, R: Deref { - self.get(col, &key.key()) - .expect(&format!("db get failed, key: {:?}", &key.key() as &[u8])) + where T: rlp::Decodable, R: AsRef<[u8]> { + self.get(col, key.key().as_ref()) + .expect(&format!("db get failed, key: {:?}", key.key().as_ref())) .map(|v| rlp::decode(&v).expect("decode db value failed") ) } - fn exists(&self, col: Option, key: &Key) -> bool where R: Deref { - let result = self.get(col, &key.key()); + fn exists(&self, col: Option, key: &Key) -> bool where R: AsRef<[u8]> { + let result = self.get(col, key.key().as_ref()); match result { Ok(v) => v.is_some(), Err(err) => { - panic!("db get failed, key: {:?}, err: {:?}", &key.key() as &[u8], err); + panic!("db get failed, key: {:?}, err: {:?}", key.key().as_ref(), err); } } } diff --git a/ethcore/db/src/keys.rs b/ethcore/db/src/keys.rs index 96ecde85fb5..3e6a2db21c4 100644 --- a/ethcore/db/src/keys.rs +++ b/ethcore/db/src/keys.rs @@ -17,7 +17,7 @@ //! Blockchain DB extras. use std::io::Write; -use std::ops; +use std::convert::AsRef; use common_types::BlockNumber; use common_types::engines::epoch::Transition as EpochTransition; @@ -49,19 +49,17 @@ pub enum ExtrasIndex { fn with_index(hash: &H256, i: ExtrasIndex) -> H264 { let mut result = H264::default(); - result[0] = i as u8; - (*result)[1..].clone_from_slice(hash); + result.as_bytes_mut()[0] = i as u8; + result.as_bytes_mut()[1..].clone_from_slice(hash.as_bytes()); result } /// Wrapper for block number used as a DB key. pub struct BlockNumberKey([u8; 5]); -impl ops::Deref for BlockNumberKey { - type Target = [u8]; - - fn deref(&self) -> &Self::Target { - &self.0 +impl AsRef<[u8]> for BlockNumberKey { + fn as_ref(&self) -> &[u8] { + &self.0[..] } } @@ -123,10 +121,8 @@ pub const EPOCH_KEY_PREFIX: &'static [u8; DB_PREFIX_LEN] = &[ /// Epoch transitions key pub struct EpochTransitionsKey([u8; EPOCH_KEY_LEN]); -impl ops::Deref for EpochTransitionsKey { - type Target = [u8]; - - fn deref(&self) -> &[u8] { &self.0[..] } +impl AsRef<[u8]> for EpochTransitionsKey { + fn as_ref(&self) -> &[u8] { &self.0[..] } } impl Key for u64 { From 1fca62e680720a63a46cf4f73a8168295507d1bb Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 18:35:08 +0200 Subject: [PATCH 18/90] [ethcore-blockchain] fix some compilation errors --- ethcore/blockchain/src/blockchain.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ethcore/blockchain/src/blockchain.rs b/ethcore/blockchain/src/blockchain.rs index de6e8c134a6..e1491aee051 100644 --- a/ethcore/blockchain/src/blockchain.rs +++ b/ethcore/blockchain/src/blockchain.rs @@ -284,7 +284,7 @@ impl BlockProvider for BlockChain { } // Read from DB and populate cache - let b = self.db.key_value().get(db::COL_HEADERS, hash) + let b = self.db.key_value().get(db::COL_HEADERS, hash.as_bytes()) .expect("Low level database error when fetching block header data. Some issue with disk?")?; let header = encoded::Header::new(decompress(&b, blocks_swapper()).into_vec()); @@ -314,7 +314,7 @@ impl BlockProvider for BlockChain { } // Read from DB and populate cache - let b = self.db.key_value().get(db::COL_BODIES, hash) + let b = self.db.key_value().get(db::COL_BODIES, hash.as_bytes()) .expect("Low level database error when fetching block body data. Some issue with disk?")?; let body = encoded::Body::new(decompress(&b, blocks_swapper()).into_vec()); @@ -572,13 +572,13 @@ impl BlockChain { }; let mut batch = DBTransaction::new(); - batch.put(db::COL_HEADERS, &hash, block.header_rlp().as_raw()); - batch.put(db::COL_BODIES, &hash, &Self::block_to_body(genesis)); + batch.put(db::COL_HEADERS, hash.as_bytes(), block.header_rlp().as_raw()); + batch.put(db::COL_BODIES, hash.as_bytes(), &Self::block_to_body(genesis)); batch.write(db::COL_EXTRA, &hash, &details); batch.write(db::COL_EXTRA, &header.number(), &hash); - batch.put(db::COL_EXTRA, b"best", &hash); + batch.put(db::COL_EXTRA, b"best", hash.as_bytes()); bc.db.key_value().write(batch).expect("Low level database error when fetching 'best' block. Some issue with disk?"); hash } @@ -639,7 +639,7 @@ impl BlockChain { if hash != bc.genesis_hash() { trace!("First block calculated: {:?}", hash); let mut batch = db.key_value().transaction(); - batch.put(db::COL_EXTRA, b"first", &hash); + batch.put(db::COL_EXTRA, b"first", hash.as_bytes()); db.key_value().write(batch).expect("Low level database error when writing 'first' block. Some issue with disk?"); bc.first_block = Some(hash); } @@ -803,8 +803,8 @@ impl BlockChain { let compressed_body = compress(&Self::block_to_body(block.raw()), blocks_swapper()); // store block in db - batch.put(db::COL_HEADERS, &hash, &compressed_header); - batch.put(db::COL_BODIES, &hash, &compressed_body); + batch.put(db::COL_HEADERS, hash.as_bytes(), &compressed_header); + batch.put(db::COL_BODIES, hash.as_bytes(), &compressed_body); let maybe_parent = self.block_details(&block_parent_hash); @@ -939,7 +939,7 @@ impl BlockChain { *pending_best_ancient_block = Some(None); } else if block_number > ancient_number { trace!(target: "blockchain", "Updating the best ancient block to {}.", block_number); - batch.put(db::COL_EXTRA, b"ancient", &block_hash); + batch.put(db::COL_EXTRA, b"ancient", block_hash.as_bytes()); *pending_best_ancient_block = Some(Some(BestAncientBlock { hash: *block_hash, number: block_number, @@ -1079,8 +1079,8 @@ impl BlockChain { let compressed_body = compress(&Self::block_to_body(block.raw()), blocks_swapper()); // store block in db - batch.put(db::COL_HEADERS, &hash, &compressed_header); - batch.put(db::COL_BODIES, &hash, &compressed_body); + batch.put(db::COL_HEADERS, hash.as_bytes(), &compressed_header); + batch.put(db::COL_BODIES, hash.as_bytes(), &compressed_body); let info = self.block_info(&block.header_view(), route, &extras); @@ -1179,7 +1179,7 @@ impl BlockChain { { let mut best_block = self.pending_best_block.write(); if is_best && update.info.location != BlockLocation::Branch { - batch.put(db::COL_EXTRA, b"best", &update.info.hash); + batch.put(db::COL_EXTRA, b"best", update.info.hash.as_bytes()); *best_block = Some(BestBlock { total_difficulty: update.info.total_difficulty, header: update.block.decode_header(), From 8bfc263db17b927f800fea0f6c42b3c3287a6619 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 16 May 2019 21:30:14 +0200 Subject: [PATCH 19/90] [blooms-db] fix compilation errors Thanks a lot @dvdplm :) --- Cargo.lock | 3 ++- util/blooms-db/Cargo.toml | 2 +- util/blooms-db/src/file.rs | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11b819de5da..3426d161355 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,7 +160,7 @@ name = "blooms-db" 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)", + "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", "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)", @@ -1445,6 +1445,7 @@ source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb557 dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/util/blooms-db/Cargo.toml b/util/blooms-db/Cargo.toml index c64721e6f4a..b2e2bfacd02 100644 --- a/util/blooms-db/Cargo.toml +++ b/util/blooms-db/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.2" -ethbloom = "0.5" +ethbloom = "0.6.3" parking_lot = "0.7" tiny-keccak = "1.4" diff --git a/util/blooms-db/src/file.rs b/util/blooms-db/src/file.rs index 0362ce88494..e0693af24a1 100644 --- a/util/blooms-db/src/file.rs +++ b/util/blooms-db/src/file.rs @@ -65,7 +65,7 @@ impl File { let mut file_ref = &self.file; file_ref.seek(SeekFrom::Start(pos * 256))?; let mut bloom = ethbloom::Bloom::default(); - file_ref.read_exact(&mut bloom)?; + file_ref.read_exact(bloom.as_bytes_mut())?; Ok(bloom) } @@ -76,7 +76,7 @@ impl File { old_bloom.accrue_bloom(bloom); let mut file_ref = &self.file; file_ref.seek(SeekFrom::Start(pos * 256))?; - file_ref.write_all(&old_bloom) + file_ref.write_all(old_bloom.as_bytes()) } /// Replace bloom at given position with a new one. @@ -128,7 +128,7 @@ impl<'a> Iterator for FileIterator<'a> { fn next(&mut self) -> Option { let mut bloom = ethbloom::Bloom::default(); - match self.file.read_exact(&mut bloom) { + match self.file.read_exact(bloom.as_bytes_mut()) { Ok(_) => Some(Ok(bloom)), Err(ref err) if err.kind() == io::ErrorKind::UnexpectedEof => None, Err(err) => Some(Err(err)), From 9bcb992560e956f227b00dea753b7a5ed18ed745 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 17 May 2019 08:39:02 +0200 Subject: [PATCH 20/90] we don't need no rlp ethereum feature --- Cargo.lock | 405 ++++++++++++------------------ Cargo.toml | 2 +- ethcore/Cargo.toml | 4 +- ethcore/blockchain/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 2 +- ethcore/private-tx/Cargo.toml | 2 +- ethcore/sync/Cargo.toml | 2 +- ethcore/types/Cargo.toml | 2 +- ethcore/vm/Cargo.toml | 2 +- ipfs/Cargo.toml | 2 +- miner/Cargo.toml | 2 +- miner/local-store/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 2 +- util/network/Cargo.toml | 2 +- util/rlp-compress/Cargo.toml | 2 +- util/rlp-derive/Cargo.toml | 2 +- util/triehash-ethereum/Cargo.toml | 2 +- util/version/Cargo.toml | 2 +- whisper/Cargo.toml | 2 +- 22 files changed, 177 insertions(+), 272 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3426d161355..529d7f18681 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,7 +306,7 @@ dependencies = [ "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "unexpected 0.1.0", @@ -314,47 +314,38 @@ dependencies = [ [[package]] name = "criterion" -version = "0.2.5" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion-plot 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion-stats 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "csv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "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.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.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)", + "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.4.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)", - "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)", + "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "criterion-plot" -version = "0.2.5" +version = "0.3.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)", "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "criterion-stats" -version = "0.2.5" -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.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)", + "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -673,7 +664,7 @@ dependencies = [ name = "ethash" version = "1.12.0" dependencies = [ - "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion 0.2.11 (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.5.2 (git+https://github.com/ordian/parity-common)", @@ -687,22 +678,10 @@ dependencies = [ "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ethbloom" -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.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.89 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ethbloom" version = "0.6.4" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -720,7 +699,7 @@ dependencies = [ "bn 0.4.4 (git+https://github.com/paritytech/bn)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", - "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", @@ -767,8 +746,8 @@ dependencies = [ "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)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -779,7 +758,7 @@ dependencies = [ "time-utils 0.1.0", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-standardmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-standardmap 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", "triehash-ethereum 0.2.0", "unexpected 0.1.0", "using_queue 0.1.0", @@ -824,8 +803,8 @@ dependencies = [ "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.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 (git+https://github.com/ordian/parity-common)", + "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -857,7 +836,7 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", ] @@ -910,7 +889,7 @@ dependencies = [ "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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "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)", @@ -962,7 +941,7 @@ dependencies = [ "parity-runtime 0.1.0", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "price-info 1.12.0", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "rustc-hex 1.0.0 (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)", @@ -986,7 +965,7 @@ dependencies = [ "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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "semver 0.9.0 (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)", @@ -1018,7 +997,7 @@ dependencies = [ "parity-snappy 0.1.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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1056,7 +1035,7 @@ dependencies = [ "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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1174,29 +1153,16 @@ dependencies = [ "parity-runtime 0.1.0", "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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "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)", "triehash-ethereum 0.2.0", ] -[[package]] -name = "ethereum-types" -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.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.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" version = "0.5.2" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1206,14 +1172,6 @@ dependencies = [ "uint 0.7.1 (git+https://github.com/ordian/parity-common)", ] -[[package]] -name = "ethereum-types-serialize" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ethjson" version = "0.1.0" @@ -1309,7 +1267,7 @@ name = "evm" 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)", + "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", @@ -1427,21 +1385,10 @@ dependencies = [ "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "fixed-hash" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "libc 0.2.48 (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)", -] - [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1477,6 +1424,11 @@ name = "fs_extra" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -1568,21 +1520,6 @@ name = "hamming" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "handlebars" -version = "0.32.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "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.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" @@ -1604,6 +1541,19 @@ name = "hash-db" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "hash-db" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hash256-std-hasher" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "heapsize" version = "0.4.2" @@ -1770,7 +1720,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1778,15 +1728,15 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.1.1" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", ] [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1837,11 +1787,11 @@ dependencies = [ ] [[package]] -name = "itertools-num" -version = "0.1.2" +name = "itertools" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1878,7 +1828,7 @@ dependencies = [ "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.6 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1903,7 +1853,7 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -2038,7 +1988,7 @@ dependencies = [ [[package]] name = "keccak-hash" version = "0.1.4" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2054,6 +2004,16 @@ dependencies = [ "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "keccak-hasher" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hash256-std-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -2442,7 +2402,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)", ] @@ -2654,7 +2614,7 @@ dependencies = [ "pretty_assertions 0.1.2 (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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "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)", @@ -2703,7 +2663,7 @@ dependencies = [ "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)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2717,7 +2677,7 @@ 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)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "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)", @@ -2795,7 +2755,7 @@ dependencies = [ "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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2902,7 +2862,7 @@ name = "parity-version" version = "2.6.0" dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "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.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2937,7 +2897,7 @@ dependencies = [ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "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)", @@ -3031,7 +2991,7 @@ dependencies = [ "keccak-hasher 0.1.1", "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)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3040,21 +3000,6 @@ name = "percent-encoding" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "pest" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "pest_derive" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "petgraph" version = "0.4.13" @@ -3173,7 +3118,7 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.2.4" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", @@ -3234,11 +3179,6 @@ name = "quick-error" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "quote" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "quote" version = "0.6.8" @@ -3319,6 +3259,11 @@ name = "rand_core" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rand_core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rand_hc" version = "0.1.0" @@ -3335,6 +3280,19 @@ dependencies = [ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand_pcg" version = "0.1.1" @@ -3352,9 +3310,18 @@ dependencies = [ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_xoshiro" +version = "0.1.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)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rayon" -version = "1.0.2" +version = "1.0.3" 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)", @@ -3373,6 +3340,14 @@ dependencies = [ "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_syscall" version = "0.1.40" @@ -3468,22 +3443,10 @@ dependencies = [ [[package]] name = "rlp" -version = "0.2.4" -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.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rlp" -version = "0.3.0" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +version = "0.3.1" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "byteorder 1.2.6 (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)", ] @@ -3493,7 +3456,7 @@ version = "0.1.0" dependencies = [ "elastic-array 0.10.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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -3502,7 +3465,7 @@ version = "0.1.0" 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)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3681,16 +3644,6 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "simplelog" -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.6 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "siphasher" version = "0.1.3" @@ -3776,16 +3729,6 @@ name = "strsim" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "syn" -version = "0.11.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "syn" version = "0.15.26" @@ -3796,14 +3739,6 @@ dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "synstructure" version = "0.10.1" @@ -3829,15 +3764,6 @@ dependencies = [ "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "term" -version = "0.5.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)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "term_size" version = "0.3.1" @@ -3892,11 +3818,6 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "thread-scoped" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "thread_local" version = "0.3.6" @@ -3943,6 +3864,15 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tinytemplate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "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 = "tokio" version = "0.1.11" @@ -4225,13 +4155,12 @@ dependencies = [ [[package]] name = "trie-standardmap" -version = "0.1.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", - "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)", + "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4240,7 +4169,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -4272,21 +4201,10 @@ name = "ucd-util" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "uint" -version = "0.4.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)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "uint" version = "0.7.1" -source = "git+https://github.com/ordian/parity-common#9c8df0e11d1524ea0ab7bcb5574dccc381a49489" +source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4337,11 +4255,6 @@ name = "unicode-width" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unicode-xid" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-xid" version = "0.1.0" @@ -4437,7 +4350,7 @@ dependencies = [ "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 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4448,7 +4361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "walkdir" -version = "2.2.5" +version = "2.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4652,9 +4565,8 @@ dependencies = [ "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" "checksum combine 3.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc1d011beeed29187b8db2ac3925c8dd4d3e87db463dc9d2d2833985388fc5bc" -"checksum criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c47d2b548c5647e1a436dc0cb78d4ebf51b6bf7ab101ed76662828bdd4d3a24a" -"checksum criterion-plot 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6e649d6aacdbbdb94ec659561a309a71336fc5655ed408f3afd28df2fc0c4f4f" -"checksum criterion-stats 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ff43cac80562f91ead0b617c1be74edf350adfaa195809d355de98dfc8f9237d" +"checksum criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0363053954f3e679645fc443321ca128b7b950a6fe288cf5f9335cc22ee58394" +"checksum criterion-plot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76f9212ddf2f4a9eb2d401635190600656a1f88a932ef53d06e7fa4c7e02fb8e" "checksum crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7408247b1b87f480890f28b670c5f8d9a8a4274833433fe74dc0dfd46d33650" "checksum crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b85741761b7f160bc5e7e0c14986ef685b7f8bf9b7ad081c60c604bb4649827" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" @@ -4686,22 +4598,19 @@ dependencies = [ "checksum ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be9a03ff8f3d495d9b73d59fd166acc91d0fd81779911b0b8b4c87b6024a670a" "checksum ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b51f33d0b3998b4330d6b5a4b1b02a03d3c96b5de44d563929e232f4a30ba7e2" "checksum ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ae5f5517ad9270a91ea7c86487a4872ded693f5d039b4d3da210237980ddd3bf" -"checksum ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a93a43ce2e9f09071449da36bfa7a1b20b950ee344b6904ff23de493b03b386" "checksum ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)" = "" -"checksum ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e742184dc63a01c8ea0637369f8faa27c40f537949908a237f95c05e68d2c96" "checksum ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)" = "" -"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" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" -"checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" "checksum fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)" = "" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" "checksum fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b" @@ -4713,8 +4622,9 @@ dependencies = [ "checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865" "checksum h2 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "a27e7ed946e8335bdf9a191bc1b9b14a03ba822d013d2f58437f4fabcbd7fc2c" "checksum hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1" -"checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd" "checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" +"checksum hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ba7fb417e5c470acdd61068c79767d0e65962e70836cf6c9dfd2409f06345ce0" +"checksum hash256-std-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b2027c19ec91eb304999abae7307d225cf93be42af53b0039f76e98ed5af86" "checksum heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)" = "" "checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" "checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa" @@ -4739,7 +4649,7 @@ dependencies = [ "checksum ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)" = "70783119ac90828aaba91eae39db32c6c1b8838deea3637e5238efa0130801ab" "checksum itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4833d6978da405305126af4ac88569b5d71ff758581ce5a987dbfa3755f694fc" "checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" -"checksum itertools-num 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "83ca7b70b838f2e34bc6c2f367a1ed1cfe34fb82464adecadd31cdcc7da882fc" +"checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum jemalloc-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "bfc62c8e50e381768ce8ee0428ee53741929f7ebd73e4d83f669bcf7693e00ae" "checksum jemallocator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9f0cd42ac65f758063fea55126b0148b1ce0a6354ff78e07a4d6806bc65c4ab3" @@ -4756,6 +4666,7 @@ dependencies = [ "checksum jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c873dac37a601fb88d40ba49eeac3f1aa60953c06b2e99ddbf0569b6f8028478" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" "checksum keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)" = "" +"checksum keccak-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "af672553b2abac1c86c29fd62c79880638b6abc91d96db4aa42a5baab2bc1ca9" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" "checksum kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45bcdf5eb083602cff61a6f8438dce2a7900d714e893fc48781c39fb119d37aa" @@ -4825,8 +4736,6 @@ dependencies = [ "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" -"checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc" -"checksum pest_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3294f437119209b084c797604295f40227cffa35c57220b1e99a6ff3bf8ee4" "checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" "checksum phf 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "cec29da322b242f4c3098852c77a0ca261c9c01b806cae85a5572a1eb94db9a6" "checksum phf_codegen 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "7d187f00cd98d5afbcd8898f6cf181743a449162aeb329dcd2f3849009e605ad" @@ -4845,7 +4754,6 @@ dependencies = [ "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" "checksum pwasm-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e9135bed7b452e20dbb395a2d519abaf0c46d60e7ecc02daeeab447d29bada1" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" @@ -4854,12 +4762,16 @@ dependencies = [ "checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a" "checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" "checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" +"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" "checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "df7a791f788cb4c516f0e091301a29c2b71ef680db5e644a7d68835c8ae6dbfa" +"checksum rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929" +"checksum rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "373814f27745b2686b350dd261bfd24576a6fb0e2c5919b3a2b6005f820b0473" "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "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" @@ -4869,8 +4781,7 @@ dependencies = [ "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" -"checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" -"checksum rlp 0.3.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum rlp 0.3.1 (git+https://github.com/ordian/parity-common)" = "" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" "checksum rprompt 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1601f32bc5858aae3cbfa1c645c96c4d820cc5c16be0194f089560c00b6eb625" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" @@ -4895,7 +4806,6 @@ dependencies = [ "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" "checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" -"checksum simplelog 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e95345f185d5adeb8ec93459d2dc99654e294cc6ccf5b75414d8ea262de9a13" "checksum siphasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "833011ca526bd88f16778d32c699d325a9ad302fa06381cd66f7be63351d3f6d" "checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum skeptic 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24ebf8a06f5f8bae61ae5bbc7af7aac4ef6907ae975130faba1199e5fe82256a" @@ -4909,25 +4819,22 @@ dependencies = [ "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9" -"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e6b677dd1e8214ea1ef4297f85dbcbed8e8cdddb561040cc998ca2551c37561" "checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" -"checksum thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcbb6aa301e5d3b0b5ef639c9a9c7e2f1c944f177b460c04dc24c69b1fa2bd99" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" "checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" "checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" +"checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" @@ -4953,13 +4860,12 @@ dependencies = [ "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" -"checksum trie-standardmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e26f52976a57a0859616d6fcec87092ac35d08eabbd78dc3dabee93b480ea5f" +"checksum trie-standardmap 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e4e24277af05f38f3aaf03ac78e3a154be83f13db9c8ef0cb95bb1aa764a477b" "checksum triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d26efb4ddf87870fc08dc9a6580dc3061be350d7b9d0eb30aef1c8b4227aa46" "checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" "checksum uint 0.7.1 (git+https://github.com/ordian/parity-common)" = "" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" @@ -4967,7 +4873,6 @@ dependencies = [ "checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" "checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" @@ -4979,7 +4884,7 @@ dependencies = [ "checksum vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c3365f36c57e5df714a34be40902b27a992eeddb9996eca52d0584611cf885d" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "af464bc7be7b785c7ac72e266a6b67c4c9070155606f51655a650a6686204e35" +"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1" "checksum want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" "checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" "checksum wasmi 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b4a6d379e9332b1b1f52c5a87f2481c85c7c931d8ec411963dfb8f26b1ec1e3" diff --git a/Cargo.toml b/Cargo.toml index 866aa632b69..297cacb5fba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ ethereum-types = "0.5.2" ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } node-filter = { path = "ethcore/node-filter" } -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } cli-signer= { path = "cli-signer" } parity-daemonize = "0.3" parity-hash-fetch = { path = "updater/hash-fetch" } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 8d88a8bac0d..8a8104157bb 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -57,7 +57,7 @@ trie-db = "0.11.0" patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" } rand = "0.4" rayon = "1.0" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } rlp_derive = { path = "../util/rlp-derive" } rustc-hex = "1.0" serde = "1.0" @@ -82,7 +82,7 @@ kvdb-rocksdb = "0.1.3" parity-runtime = { path = "../util/runtime" } rlp_compress = { path = "../util/rlp-compress" } tempdir = "0.3" -trie-standardmap = "0.1" +trie-standardmap = "0.12.2" [features] parity = ["work-notify", "price-info", "stratum"] diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index 2dac784c505..ec76cad02a7 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -20,7 +20,7 @@ log = "0.4" parity-bytes = "0.1" parking_lot = "0.7" rayon = "1.0" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } rlp_compress = { path = "../../util/rlp-compress" } rlp_derive = { path = "../../util/rlp-derive" } diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index c2203b1cd7f..6837d52e205 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -13,5 +13,5 @@ ethereum-types = "0.5.2" heapsize = "0.4" kvdb = "0.1" parking_lot = "0.7" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } rlp_derive = { path = "../../util/rlp-derive" } diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 7c2c178a467..d73e81abe16 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -25,7 +25,7 @@ heapsize = "0.4" vm = { path = "../vm" } fastmap = { path = "../../util/fastmap" } failsafe = { version = "0.3.0", default-features = false, features = ["parking_lot_mutex"] } -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } rlp_derive = { path = "../../util/rlp-derive" } smallvec = "0.6" futures = "0.1" diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 7414c40bce2..4eeb87673b7 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -29,7 +29,7 @@ parking_lot = "0.7" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } rand = "0.3" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } rlp_derive = { path = "../../util/rlp-derive" } rustc-hex = "1.0" serde = "1.0" diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 4b164c4c3f9..def0e64c473 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -29,7 +29,7 @@ macros = { path = "../../util/macros" } parity-bytes = "0.1" parking_lot = "0.7" rand = "0.4" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } trace-time = "0.1" triehash-ethereum = {version = "0.2", path = "../../util/triehash-ethereum" } futures = "0.1" diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index f01c65e7028..1ca204bab5e 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -11,7 +11,7 @@ ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" keccak-hash = "0.1.4" parity-bytes = "0.1" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } rlp_derive = { path = "../../util/rlp-derive" } unexpected = { path = "../../util/unexpected" } diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index e08d9c44ca2..09e6551f01c 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -11,5 +11,5 @@ trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" ethjson = { path = "../../json" } -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } keccak-hash = "0.1.4" diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 1ca1305712a..a7bc6766aa9 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -11,7 +11,7 @@ parity-bytes = "0.1" ethereum-types = "0.5.2" jsonrpc-core = "10.0.1" jsonrpc-http-server = "10.0.1" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } cid = "0.3" multihash = "0.8" unicase = "2.0" diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 82d0d6ca530..4b144e9778d 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -30,7 +30,7 @@ log = "0.4" parity-runtime = { path = "../util/runtime" } parking_lot = "0.7" price-info = { path = "./price-info", optional = true } -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/miner/local-store/Cargo.toml b/miner/local-store/Cargo.toml index d16c6440719..23a12df81a7 100644 --- a/miner/local-store/Cargo.toml +++ b/miner/local-store/Cargo.toml @@ -9,7 +9,7 @@ common-types = { path = "../../ethcore/types" } ethcore-io = { path = "../../util/io" } kvdb = "0.1" log = "0.4" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 38bd0729e06..1b566b5b77a 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -58,7 +58,7 @@ keccak-hash = "0.1.4" parity-runtime = { path = "../util/runtime" } parity-updater = { path = "../updater" } parity-version = { path = "../util/version" } -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } stats = { path = "../util/stats" } vm = { path = "../ethcore/vm" } diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 98e7df9a290..4a318545c76 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -16,7 +16,7 @@ log = "0.4" memory-db = "0.11.0" parking_lot = "0.7" fastmap = { path = "../../util/fastmap" } -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } [dev-dependencies] env_logger = "0.5" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index c03ac3cb16a..5fc3657570b 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -25,7 +25,7 @@ parity-crypto = "0.3.0" ethcore-network = { path = "../network" } ethereum-types = "0.5.2" ethkey = { path = "../../accounts/ethkey" } -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } parity-path = "0.1" ipnetwork = "0.12.6" keccak-hash = "0.1.4" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index 1f121916e03..f9d1bf14b25 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -14,7 +14,7 @@ ethereum-types = "0.5.2" ethkey = { path = "../../accounts/ethkey" } ipnetwork = "0.12.6" lazy_static = "1.0" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } libc = "0.2" parity-snappy = "0.1" semver = {version="0.9.0", features=["serde"]} diff --git a/util/rlp-compress/Cargo.toml b/util/rlp-compress/Cargo.toml index 4bd34bce13e..3139a175c44 100644 --- a/util/rlp-compress/Cargo.toml +++ b/util/rlp-compress/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } elastic-array = "0.10" lazy_static = "1.0" diff --git a/util/rlp-derive/Cargo.toml b/util/rlp-derive/Cargo.toml index 2087f752432..c107d13a49c 100644 --- a/util/rlp-derive/Cargo.toml +++ b/util/rlp-derive/Cargo.toml @@ -13,4 +13,4 @@ quote = "0.6" proc-macro2 = "0.4" [dev-dependencies] -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index 0e0a593afc7..c5fce9ed34c 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -6,6 +6,6 @@ description = "Trie-root helpers, ethereum style" license = "GPL-3.0" [dependencies] -triehash = { version = "0.4.0", features = ["ethereum"] } +triehash = { version = "0.4.0", default-features = false } ethereum-types = "0.5.2" keccak-hasher = { path = "../keccak-hasher" } diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 192ff906a2d..5e276a163a0 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -23,7 +23,7 @@ goerli = { forkBlock = 0, critical = false } [dependencies] parity-bytes = "0.1" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } target_info = "0.1" [build-dependencies] diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index d3c52fb0553..39cf83857f8 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -18,7 +18,7 @@ ordered-float = "0.5" parking_lot = "0.7" rand = "0.6" rand_xorshift = "0.1.1" -rlp = { version = "0.3.0", features = ["ethereum"] } +rlp = { version = "0.3.0", default-features = false } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" From 4bb39c5708a218c9104087bb134bda96a31df1a0 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 17 May 2019 14:54:54 +0200 Subject: [PATCH 21/90] [ethcore] fix some compilation errors --- ethcore/evm/src/tests.rs | 2 +- ethcore/src/account_db.rs | 4 +-- ethcore/src/builtin.rs | 7 ++-- ethcore/src/client/client.rs | 12 +++---- ethcore/src/client/test_client.rs | 26 +++++++++----- ethcore/src/engines/authority_round/mod.rs | 4 +-- ethcore/src/engines/basic_authority.rs | 2 +- ethcore/src/engines/clique/block_state.rs | 2 +- ethcore/src/engines/clique/mod.rs | 6 ++-- ethcore/src/engines/clique/util.rs | 4 +-- ethcore/src/ethereum/ethash.rs | 6 ++-- ethcore/src/executive.rs | 9 ++--- ethcore/src/externalities.rs | 9 ++--- ethcore/src/machine/impls.rs | 4 +-- ethcore/src/miner/stratum.rs | 10 +++++- ethcore/src/pod_account.rs | 20 +++++------ ethcore/src/snapshot/block.rs | 6 ++-- ethcore/src/snapshot/mod.rs | 6 ++-- ethcore/src/spec/spec.rs | 6 ++-- ethcore/src/state/account.rs | 16 ++++----- ethcore/src/state/mod.rs | 40 +++++++++++----------- ethcore/src/state_db.rs | 4 +-- ethcore/src/test_helpers.rs | 4 +-- ethcore/src/trace/db.rs | 7 ++-- ethcore/src/trace/types/filter.rs | 5 ++- ethcore/src/trace/types/trace.rs | 14 ++++---- ethcore/src/tx_filter.rs | 2 +- ethcore/sync/src/blocks.rs | 2 +- ethcore/sync/src/chain/mod.rs | 2 +- ethcore/sync/src/chain/supplier.rs | 6 ++-- ethcore/sync/src/snapshot.rs | 4 +-- ethcore/sync/src/tests/snapshot.rs | 4 +-- ethcore/types/src/account_diff.rs | 5 ++- json/src/hash.rs | 7 ---- json/src/uint.rs | 13 +++++++ rpc/src/v1/tests/mocked/eth.rs | 2 +- util/network-devp2p/src/handshake.rs | 2 +- util/patricia-trie-ethereum/src/lib.rs | 4 +-- 38 files changed, 158 insertions(+), 130 deletions(-) diff --git a/ethcore/evm/src/tests.rs b/ethcore/evm/src/tests.rs index dd039311ebd..c33db5c0d63 100644 --- a/ethcore/evm/src/tests.rs +++ b/ethcore/evm/src/tests.rs @@ -239,7 +239,7 @@ fn test_blockhash(factory: super::Factory) { }; assert_eq!(gas_left, U256::from(79_974)); - assert_eq!(ext.store.get(&H256::new()).unwrap(), &blockhash); + assert_eq!(ext.store.get(&H256::zero()).unwrap(), &blockhash); } evm_test!{test_calldataload: test_calldataload_int} diff --git a/ethcore/src/account_db.rs b/ethcore/src/account_db.rs index a389c009bf7..fcc6f74c6cd 100644 --- a/ethcore/src/account_db.rs +++ b/ethcore/src/account_db.rs @@ -31,8 +31,8 @@ use ethereum_types::Address; fn combine_key<'a>(address_hash: &'a H256, key: &'a H256) -> H256 { let mut dst = key.clone(); { - let last_src: &[u8] = &*address_hash; - let last_dst: &mut [u8] = &mut *dst; + let last_src: &[u8] = address_hash.as_bytes(); + let last_dst: &mut [u8] = dst.as_bytes_mut(); for (k, a) in last_dst[12..].iter_mut().zip(&last_src[12..]) { *k ^= *a } diff --git a/ethcore/src/builtin.rs b/ethcore/src/builtin.rs index 499e3c8f6cc..571208e61bf 100644 --- a/ethcore/src/builtin.rs +++ b/ethcore/src/builtin.rs @@ -95,7 +95,8 @@ impl Pricer for ModexpPricer { // read lengths as U256 here for accurate gas calculation. let mut read_len = || { reader.read_exact(&mut buf[..]).expect("reading from zero-extended memory cannot fail; qed"); - U256::from(H256::from_slice(&buf[..])) + // TODO: check byte order + U256::from_big_endian(&buf[..]) }; let base_len = read_len(); let exp_len = read_len(); @@ -118,7 +119,7 @@ impl Pricer for ModexpPricer { let mut reader = input[(96 + base_len as usize)..].chain(io::repeat(0)); let len = min(exp_len, 32) as usize; reader.read_exact(&mut buf[(32 - len)..]).expect("reading from zero-extended memory cannot fail; qed"); - U256::from(H256::from_slice(&buf[..])) + U256::from_big_endian(&buf[..]) }; let adjusted_exp_len = Self::adjusted_exp_len(exp_len, exp_low); @@ -286,7 +287,7 @@ impl Impl for EcRecover { if let Ok(p) = ec_recover(&s, &hash) { let r = keccak(p); output.write(0, &[0; 12]); - output.write(12, &r[12..r.len()]); + output.write(12, &r.as_bytes()[12..]); } } diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index bf980ac5fd0..e828fb7a456 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -1336,15 +1336,15 @@ impl BlockChainReset for Client { let mut db_transaction = DBTransaction::with_capacity((num + 1) as usize); for hash in &blocks_to_delete { - db_transaction.delete(::db::COL_HEADERS, &hash.hash()); - db_transaction.delete(::db::COL_BODIES, &hash.hash()); - db_transaction.delete(::db::COL_EXTRA, &hash.hash()); + db_transaction.delete(::db::COL_HEADERS, hash.hash().as_bytes()); + db_transaction.delete(::db::COL_BODIES, hash.hash().as_bytes()); + db_transaction.delete(::db::COL_EXTRA, hash.hash().as_bytes()); Writable::delete:: (&mut db_transaction, ::db::COL_EXTRA, &hash.number()); } // update the new best block hash - db_transaction.put(::db::COL_EXTRA, b"best", &*best_block_hash); + db_transaction.put(::db::COL_EXTRA, b"best", best_block_hash.as_bytes()); self.db.read() .key_value() @@ -1799,7 +1799,7 @@ impl BlockChainClient for Client { }; if let Some(after) = after { - if let Err(e) = iter.seek(after) { + if let Err(e) = iter.seek(after.as_bytes()) { trace!(target: "fatdb", "list_accounts: Couldn't seek the DB: {:?}", e); } else { // Position the iterator after the `after` element @@ -1847,7 +1847,7 @@ impl BlockChainClient for Client { }; if let Some(after) = after { - if let Err(e) = iter.seek(after) { + if let Err(e) = iter.seek(after.as_bytes()) { trace!(target: "fatdb", "list_storage: Couldn't seek the DB: {:?}", e); } else { // Position the iterator after the `after` element diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index 1ae1a501cc6..bc7c1cf8f64 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -16,6 +16,7 @@ //! Test client. +use std::str::FromStr; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering as AtomicOrder}; use std::sync::Arc; use std::collections::{HashMap, BTreeMap}; @@ -167,9 +168,9 @@ impl TestBlockChainClient { let mut client = TestBlockChainClient { blocks: RwLock::new(HashMap::new()), numbers: RwLock::new(HashMap::new()), - genesis_hash: H256::new(), + genesis_hash: H256::zero(), extra_data: extra_data, - last_hash: RwLock::new(H256::new()), + last_hash: RwLock::new(H256::zero()), difficulty: RwLock::new(spec.genesis_header().difficulty().clone()), balances: RwLock::new(HashMap::new()), nonces: RwLock::new(HashMap::new()), @@ -326,7 +327,7 @@ impl TestBlockChainClient { pub fn corrupt_block_parent(&self, n: BlockNumber) { let hash = self.block_hash(BlockId::Number(n)).unwrap(); let mut header: Header = self.block_header(BlockId::Number(n)).unwrap().decode().expect("decoding failed"); - header.set_parent_hash(H256::from(42)); + header.set_parent_hash(H256::from_low_u64_be(42)); let mut rlp = RlpStream::new_list(3); rlp.append(&header); rlp.append_raw(&::rlp::NULL_RLP, 1); @@ -661,7 +662,15 @@ impl BlockChainClient for TestBlockChainClient { } fn replay_block_transactions(&self, _block: BlockId, _analytics: CallAnalytics) -> Result>, CallError> { - Ok(Box::new(self.traces.read().clone().unwrap().into_iter().map(|t| t.transaction_hash.unwrap_or(H256::new())).zip(self.execution_result.read().clone().unwrap().into_iter()))) + Ok(Box::new( + self.traces + .read() + .clone() + .unwrap() + .into_iter() + .map(|t| t.transaction_hash.unwrap_or_default()) + .zip(self.execution_result.read().clone().unwrap().into_iter()) + )) } fn block_total_difficulty(&self, _id: BlockId) -> Option { @@ -685,7 +694,8 @@ impl BlockChainClient for TestBlockChainClient { fn storage_at(&self, address: &Address, position: &H256, state: StateOrBlock) -> Option { match state { - StateOrBlock::Block(BlockId::Latest) => Some(self.storage.read().get(&(address.clone(), position.clone())).cloned().unwrap_or_else(H256::new)), + StateOrBlock::Block(BlockId::Latest) => + Some(self.storage.read().get(&(address.clone(), position.clone())).cloned().unwrap_or_default()), _ => None, } } @@ -773,7 +783,7 @@ impl BlockChainClient for TestBlockChainClient { // works only if blocks are one after another 1 -> 2 -> 3 fn tree_route(&self, from: &H256, to: &H256) -> Option { Some(TreeRoute { - ancestor: H256::new(), + ancestor: H256::zero(), index: 0, blocks: { let numbers_read = self.numbers.read(); @@ -808,7 +818,7 @@ impl BlockChainClient for TestBlockChainClient { // TODO: returns just hashes instead of node state rlp(?) fn state_data(&self, hash: &H256) -> Option { // starts with 'f' ? - if *hash > H256::from("f000000000000000000000000000000000000000000000000000000000000000") { + if *hash > H256::from_str("f000000000000000000000000000000000000000000000000000000000000000").unwrap() { let mut rlp = RlpStream::new(); rlp.append(&hash.clone()); return Some(rlp.out()); @@ -818,7 +828,7 @@ impl BlockChainClient for TestBlockChainClient { fn block_receipts(&self, hash: &H256) -> Option { // starts with 'f' ? - if *hash > H256::from("f000000000000000000000000000000000000000000000000000000000000000") { + if *hash > H256::from_str("f000000000000000000000000000000000000000000000000000000000000000").unwrap() { let receipt = BlockReceipts::new(vec![Receipt::new( TransactionOutcome::StateRoot(H256::zero()), U256::zero(), diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index 55c09c46028..b3ea7c1210d 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -496,7 +496,7 @@ impl super::EpochVerifier for EpochVerifier { fn header_seal_hash(header: &Header, empty_steps_rlp: Option<&[u8]>) -> H256 { match empty_steps_rlp { Some(empty_steps_rlp) => { - let mut message = header.bare_hash().to_vec(); + let mut message = header.bare_hash().as_bytes().to_vec(); message.extend_from_slice(empty_steps_rlp); keccak(message) }, @@ -1122,7 +1122,7 @@ impl Engine for AuthorityRound { let mut fields = vec![ encode(&step), - encode(&(&H520::from(signature) as &[u8])), + encode(&(H520::from(signature).as_bytes())), ]; if let Some(empty_steps_rlp) = empty_steps_rlp { diff --git a/ethcore/src/engines/basic_authority.rs b/ethcore/src/engines/basic_authority.rs index 69b8d07c526..f45b084bb45 100644 --- a/ethcore/src/engines/basic_authority.rs +++ b/ethcore/src/engines/basic_authority.rs @@ -109,7 +109,7 @@ impl Engine for BasicAuthority { if self.validators.contains(header.parent_hash(), author) { // account should be pernamently unlocked, otherwise sealing will fail if let Ok(signature) = self.sign(header.bare_hash()) { - return Seal::Regular(vec![::rlp::encode(&(&H520::from(signature) as &[u8]))]); + return Seal::Regular(vec![::rlp::encode(&(H520::from(signature).as_bytes()))]); } else { trace!(target: "basicauthority", "generate_seal: FAIL: accounts secret key unavailable"); } diff --git a/ethcore/src/engines/clique/block_state.rs b/ethcore/src/engines/clique/block_state.rs index 4257076c064..5e1c5f2fb46 100644 --- a/ethcore/src/engines/clique/block_state.rs +++ b/ethcore/src/engines/clique/block_state.rs @@ -194,7 +194,7 @@ impl CliqueBlockState { Err(BlockError::InvalidSealArity(Mismatch { expected: 2, found: decoded_seal.len() }))? } - let nonce: H64 = decoded_seal[1].into(); + let nonce = H64::from_slice(decoded_seal[1]); self.update_signers_on_vote(VoteType::from_nonce(nonce)?, creator, *header.author(), header.number())?; } diff --git a/ethcore/src/engines/clique/mod.rs b/ethcore/src/engines/clique/mod.rs index 1ae30905e0e..e799f5e335d 100644 --- a/ethcore/src/engines/clique/mod.rs +++ b/ethcore/src/engines/clique/mod.rs @@ -558,7 +558,7 @@ impl Engine for Clique { if is_checkpoint && *header.author() != NULL_AUTHOR { return Err(EngineError::CliqueWrongAuthorCheckpoint(Mismatch { - expected: 0.into(), + expected: H160::zero(), found: *header.author(), }))?; } @@ -571,8 +571,8 @@ impl Engine for Clique { }))? } - let mixhash: H256 = seal_fields[0].into(); - let nonce: H64 = seal_fields[1].into(); + let mixhash = H256::from_slice(seal_fields[0]); + let nonce = H64::from_slice(seal_fields[1]); // Nonce must be 0x00..0 or 0xff..f if nonce != NONCE_DROP_VOTE && nonce != NONCE_AUTH_VOTE { diff --git a/ethcore/src/engines/clique/util.rs b/ethcore/src/engines/clique/util.rs index 3f75289e91e..79b74bb7365 100644 --- a/ethcore/src/engines/clique/util.rs +++ b/ethcore/src/engines/clique/util.rs @@ -102,7 +102,7 @@ pub fn extract_signers(header: &Header) -> Result, Error> { .map(|i| { let start = i * ADDRESS_LENGTH; let end = start + ADDRESS_LENGTH; - signers_raw[start..end].into() + Address::from_slice(&signers_raw[start..end]) }) .collect(); @@ -111,5 +111,5 @@ pub fn extract_signers(header: &Header) -> Result, Error> { /// Retrieve `null_seal` pub fn null_seal() -> Vec> { - vec![encode(&NULL_MIXHASH.to_vec()), encode(&NULL_NONCE.to_vec())] + vec![encode(&NULL_MIXHASH.as_bytes().to_vec()), encode(&NULL_NONCE.as_bytes().to_vec())] } diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index 8a19d9a0116..f2fb0703828 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -324,7 +324,7 @@ impl Engine for Arc { let difficulty = ethash::boundary_to_difficulty(&H256(quick_get_difficulty( &header.bare_hash().0, - seal.nonce.low_u64(), + seal.nonce.to_low_u64_be(), &seal.mix_hash.0, header.number() >= self.ethash_params.progpow_transition ))); @@ -339,14 +339,14 @@ impl Engine for Arc { fn verify_block_unordered(&self, header: &Header) -> Result<(), Error> { let seal = Seal::parse_seal(header.seal())?; - let result = self.pow.compute_light(header.number() as u64, &header.bare_hash().0, seal.nonce.low_u64()); + let result = self.pow.compute_light(header.number() as u64, &header.bare_hash().0, seal.nonce.to_low_u64_be()); let mix = H256(result.mix_hash); let difficulty = ethash::boundary_to_difficulty(&H256(result.value)); trace!(target: "miner", "num: {num}, seed: {seed}, h: {h}, non: {non}, mix: {mix}, res: {res}", num = header.number() as u64, seed = H256(slow_hash_block_number(header.number() as u64)), h = header.bare_hash(), - non = seal.nonce.low_u64(), + non = seal.nonce.to_low_u64_be(), mix = H256(result.mix_hash), res = H256(result.value)); if mix != seal.mix_hash { diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index 68d4edc7948..8bebc46af03 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -16,6 +16,7 @@ //! Transaction Execution environment. use std::cmp; +use std::convert::TryFrom; use std::sync::Arc; use hash::keccak; use ethereum_types::{H256, U256, U512, Address}; @@ -858,7 +859,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> { if !schedule.keep_unsigned_nonce || !t.is_unsigned() { self.state.inc_nonce(&sender)?; } - self.state.sub_balance(&sender, &U256::from(gas_cost), &mut substate.to_cleanup_mode(&schedule))?; + self.state.sub_balance(&sender, &U256::try_from(gas_cost).expect("TODO: why does it fit U256?"), &mut substate.to_cleanup_mode(&schedule))?; let (result, output) = match t.action { Action::Create => { @@ -1229,7 +1230,7 @@ mod tests { }; assert_eq!(gas_left, U256::from(79_975)); - assert_eq!(state.storage_at(&address, &H256::new()).unwrap(), H256::from(&U256::from(0xf9u64))); + assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), H256::from(&U256::from(0xf9u64))); assert_eq!(state.balance(&sender).unwrap(), U256::from(0xf9)); assert_eq!(state.balance(&address).unwrap(), U256::from(0x7)); assert_eq!(substate.contracts_created.len(), 0); @@ -1890,7 +1891,7 @@ mod tests { assert_eq!(state.balance(&sender).unwrap(), U256::from(1)); assert_eq!(state.balance(&contract).unwrap(), U256::from(17)); assert_eq!(state.nonce(&sender).unwrap(), U256::from(1)); - assert_eq!(state.storage_at(&contract, &H256::new()).unwrap(), H256::from(&U256::from(1))); + assert_eq!(state.storage_at(&contract, &H256::zero()).unwrap(), H256::from(&U256::from(1))); } evm_test!{test_transact_invalid_nonce: test_transact_invalid_nonce_int} @@ -2069,7 +2070,7 @@ mod tests { let y1 = Address::from(0x2001); let y2 = Address::from(0x2002); let operating_address = Address::from(0); - let k = H256::new(); + let k = H256::zero(); let mut state = get_temp_state_with_factory(factory.clone()); state.new_contract(&x1, U256::zero(), U256::from(1)).unwrap(); diff --git a/ethcore/src/externalities.rs b/ethcore/src/externalities.rs index 23a4a83c3d1..4dab9b3d5b5 100644 --- a/ethcore/src/externalities.rs +++ b/ethcore/src/externalities.rs @@ -17,7 +17,7 @@ //! Transaction Execution environment. use std::cmp; use std::sync::Arc; -use ethereum_types::{H256, U256, Address}; +use ethereum_types::{H256, U256, Address, BigEndianHash}; use bytes::Bytes; use state::{Backend as StateBackend, State, Substate, CleanupMode}; use machine::EthereumMachine as Machine; @@ -166,6 +166,7 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for Externalities<'a, T, V, B> Ok((code, hash)) => (code, hash), Err(_) => return H256::zero(), }; + let data: H256 = BigEndianHash::from_uint(number); let params = ActionParams { sender: self.origin_info.address.clone(), @@ -177,7 +178,7 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for Externalities<'a, T, V, B> gas_price: 0.into(), code: code, code_hash: code_hash, - data: Some(H256::from(number).to_vec()), + data: Some(data.as_bytes().to_vec()), call_type: CallType::Call, params_type: vm::ParamsType::Separate, }; @@ -185,8 +186,8 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for Externalities<'a, T, V, B> let mut ex = Executive::new(self.state, self.env_info, self.machine, self.schedule); let r = ex.call_with_crossbeam(params, self.substate, self.stack_depth + 1, self.tracer, self.vm_tracer); let output = match &r { - Ok(ref r) => H256::from(&r.return_data[..32]), - _ => H256::new(), + Ok(ref r) => H256::from_slice(&r.return_data[..32]), + _ => H256::zero(), }; trace!("ext: blockhash contract({}) -> {:?}({}) self.env_info.number={}\n", number, r, output, self.env_info.number); output diff --git a/ethcore/src/machine/impls.rs b/ethcore/src/machine/impls.rs index 72f20ecdf7d..17959506070 100644 --- a/ethcore/src/machine/impls.rs +++ b/ethcore/src/machine/impls.rs @@ -60,7 +60,7 @@ impl From<::ethjson::spec::EthashParams> for EthashExtensions { EthashExtensions { homestead_transition: p.homestead_transition.map_or(0, Into::into), dao_hardfork_transition: p.dao_hardfork_transition.map_or(u64::max_value(), Into::into), - dao_hardfork_beneficiary: p.dao_hardfork_beneficiary.map_or_else(Address::new, Into::into), + dao_hardfork_beneficiary: p.dao_hardfork_beneficiary.map_or_else(Address::zero, Into::into), dao_hardfork_accounts: p.dao_hardfork_accounts.unwrap_or_else(Vec::new).into_iter().map(Into::into).collect(), } } @@ -203,7 +203,7 @@ impl EthereumMachine { block, params.eip210_contract_address, params.eip210_contract_gas, - Some(parent_hash.to_vec()), + Some(parent_hash.as_bytes().to_vec()), )?; } Ok(()) diff --git a/ethcore/src/miner/stratum.rs b/ethcore/src/miner/stratum.rs index 71862225ab5..aad646753a3 100644 --- a/ethcore/src/miner/stratum.rs +++ b/ethcore/src/miner/stratum.rs @@ -21,7 +21,7 @@ use std::net::{SocketAddr, AddrParseError}; use std::fmt; use client::{Client, ImportSealedBlock}; -use ethereum_types::{H64, H256, clean_0x, U256}; +use ethereum_types::{H64, H256, U256}; use ethash::{self, SeedHashCompute}; #[cfg(feature = "work-notify")] use ethcore_miner::work_notify::NotifyWork; @@ -47,6 +47,14 @@ pub struct Options { pub secret: Option, } +fn clean_0x(s: &str) -> &str { + if s.starts_with("0x") { + &s[2..] + } else { + s + } +} + struct SubmitPayload { nonce: H64, pow_hash: H256, diff --git a/ethcore/src/pod_account.rs b/ethcore/src/pod_account.rs index 39dce6e36da..b4d1586208d 100644 --- a/ethcore/src/pod_account.rs +++ b/ethcore/src/pod_account.rs @@ -20,7 +20,7 @@ use std::fmt; use std::collections::BTreeMap; use itertools::Itertools; use hash::{keccak}; -use ethereum_types::{H256, U256}; +use ethereum_types::{H256, U256, BigEndianHash}; use hash_db::HashDB; use kvdb::DBValue; use keccak_hasher::KeccakHasher; @@ -73,7 +73,7 @@ impl PodAccount { let mut stream = RlpStream::new_list(4); stream.append(&self.nonce); stream.append(&self.balance); - stream.append(&sec_trie_root(self.storage.iter().map(|(k, v)| (k, rlp::encode(&U256::from(&**v)))))); + stream.append(&sec_trie_root(self.storage.iter().map(|(k, v)| (k, rlp::encode(&v.into_uint()))))); stream.append(&keccak(&self.code.as_ref().unwrap_or(&vec![]))); stream.out() } @@ -84,10 +84,10 @@ impl PodAccount { Some(ref c) if !c.is_empty() => { db.insert(c); } _ => {} } - let mut r = H256::new(); + let mut r = H256::zero(); let mut t = factory.create(db, &mut r); for (k, v) in &self.storage { - if let Err(e) = t.insert(k, &rlp::encode(&U256::from(&**v))) { + if let Err(e) = t.insert(k.as_bytes(), &rlp::encode(&v.into_uint())) { warn!("Encountered potential DB corruption: {}", e); } } @@ -103,7 +103,7 @@ impl From for PodAccount { storage: a.storage.into_iter().map(|(key, value)| { let key: U256 = key.into(); let value: U256 = value.into(); - (H256::from(key), H256::from(value)) + (BigEndianHash::from_uint(&key), BigEndianHash::from_uint(&value)) }).collect(), } } @@ -118,7 +118,7 @@ impl From for PodAccount { storage: a.storage.map_or_else(BTreeMap::new, |s| s.into_iter().map(|(key, value)| { let key: U256 = key.into(); let value: U256 = value.into(); - (H256::from(key), H256::from(value)) + (BigEndianHash::from_uint(&key), BigEndianHash::from_uint(&value)) }).collect()), } } @@ -130,7 +130,7 @@ impl fmt::Display for PodAccount { self.balance, self.nonce, self.code.as_ref().map_or(0, |c| c.len()), - self.code.as_ref().map_or_else(H256::new, |c| keccak(c)), + self.code.as_ref().map_or_else(H256::zero, |c| keccak(c)), self.storage.len(), ) } @@ -154,7 +154,7 @@ pub fn diff_pod(pre: Option<&PodAccount>, post: Option<&PodAccount>) -> Option { let storage: Vec<_> = pre.storage.keys().merge(post.storage.keys()) - .filter(|k| pre.storage.get(k).unwrap_or(&H256::new()) != post.storage.get(k).unwrap_or(&H256::new())) + .filter(|k| pre.storage.get(k).unwrap_or(&H256::zero()) != post.storage.get(k).unwrap_or(&H256::zero())) .collect(); let r = AccountDiff { balance: Diff::new(pre.balance, post.balance), @@ -165,8 +165,8 @@ pub fn diff_pod(pre: Option<&PodAccount>, post: Option<&PodAccount>) -> Option for CommonParams { BlockNumber::max_value, Into::into, ), - eip210_contract_address: p.eip210_contract_address.map_or(0xf0.into(), Into::into), + eip210_contract_address: p.eip210_contract_address.map_or(Address::from_low_u64_be(0xf0), Into::into), eip210_contract_code: p.eip210_contract_code.map_or_else( || { DEFAULT_BLOCKHASH_CONTRACT.from_hex().expect( @@ -315,7 +315,7 @@ impl From for CommonParams { nonce_cap_increment: p.nonce_cap_increment.map_or(64, Into::into), remove_dust_contracts: p.remove_dust_contracts.unwrap_or(false), gas_limit_bound_divisor: p.gas_limit_bound_divisor.into(), - registrar: p.registrar.map_or_else(Address::new, Into::into), + registrar: p.registrar.map_or_else(Address::zero, Into::into), node_permission_contract: p.node_permission_contract.map(Into::into), max_code_size: p.max_code_size.map_or(u64::max_value(), Into::into), max_transaction_size: p.max_transaction_size.map_or(MAX_TRANSACTION_SIZE, Into::into), @@ -627,7 +627,7 @@ impl Spec { let mut t = factories.trie.create(db.as_hash_db_mut(), &mut root); for (address, account) in self.genesis_state.get().iter() { - t.insert(&**address, &account.rlp())?; + t.insert(address.as_bytes(), &account.rlp())?; } } diff --git a/ethcore/src/state/account.rs b/ethcore/src/state/account.rs index fea9444b1cc..93111f25b9d 100644 --- a/ethcore/src/state/account.rs +++ b/ethcore/src/state/account.rs @@ -20,7 +20,7 @@ use std::fmt; use std::sync::Arc; use std::collections::{HashMap, BTreeMap}; use hash::{KECCAK_EMPTY, KECCAK_NULL_RLP, keccak}; -use ethereum_types::{H256, U256, Address}; +use ethereum_types::{H256, U256, Address, BigEndianHash}; use error::Error; use hash_db::HashDB; use keccak_hasher::KeccakHasher; @@ -255,8 +255,8 @@ impl Account { fn get_and_cache_storage(storage_root: &H256, storage_cache: &mut LruCache, db: &HashDB, key: &H256) -> TrieResult { let db = SecTrieDB::new(&db, storage_root)?; let panicky_decoder = |bytes:&[u8]| ::rlp::decode(&bytes).expect("decoding db value failed"); - let item: U256 = db.get_with(key, panicky_decoder)?.unwrap_or_else(U256::zero); - let value: H256 = item.into(); + let item: U256 = db.get_with(key.as_bytes(), panicky_decoder)?.unwrap_or_else(U256::zero); + let value: H256 = BigEndianHash::from_uint(&item); storage_cache.insert(key.clone(), value.clone()); Ok(value) } @@ -291,7 +291,7 @@ impl Account { // If storage root is empty RLP, then early return zero value. Practically, this makes it so that if // `original_storage_cache` is used, then `storage_cache` will always remain empty. if self.storage_root == KECCAK_NULL_RLP { - return Some(H256::new()); + return Some(H256::zero()); } if let Some(value) = self.storage_cache.borrow_mut().get_mut(key) { @@ -488,8 +488,8 @@ impl Account { // cast key and value to trait type, // so we can call overloaded `to_bytes` method match v.is_zero() { - true => t.remove(&k)?, - false => t.insert(&k, &encode(&U256::from(&*v)))?, + true => t.remove(k.as_bytes())?, + false => t.insert(k.as_bytes(), &encode(&v.into_uint()))?, }; self.storage_cache.borrow_mut().insert(k, v); @@ -595,10 +595,10 @@ impl Account { let item: U256 = { let panicky_decoder = |bytes:&[u8]| ::rlp::decode(bytes).expect("decoding db value failed"); let query = (&mut recorder, panicky_decoder); - trie.get_with(&storage_key, query)?.unwrap_or_else(U256::zero) + trie.get_with(storage_key.as_bytes(), query)?.unwrap_or_else(U256::zero) }; - Ok((recorder.drain().into_iter().map(|r| r.data).collect(), item.into())) + Ok((recorder.drain().into_iter().map(|r| r.data).collect(), BigEndianHash::from_uint(&item))) } } diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index ddad10c40dd..1060d600e57 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -363,7 +363,7 @@ impl State { /// Creates new state with empty state root /// Used for tests. pub fn new(mut db: B, account_start_nonce: U256, factories: Factories) -> State { - let mut root = H256::new(); + let mut root = H256::zero(); { // init trie and reset root to null let _ = factories.trie.create(db.as_hash_db_mut(), &mut root); @@ -502,7 +502,7 @@ impl State { let original_storage_root = self.original_storage_root(contract)?; let (nonce, overflow) = self.account_start_nonce.overflowing_add(nonce_offset); if overflow { - return Err(Box::new(TrieError::DecoderError(H256::from(contract), + return Err(Box::new(TrieError::DecoderError(H256::from(*contract), rlp::DecoderError::Custom("Nonce overflow".into())))); } self.insert_cache(contract, AccountEntry::new_dirty(Some(Account::new_contract(balance, nonce, original_storage_root)))); @@ -603,12 +603,12 @@ impl State { // would always be empty. Note that this branch is actually never called, because // `cached_storage_at` handled this case. warn!(target: "state", "Trying to get an account's cached storage value, but base storage root does not equal to original storage root! Assuming the value is empty."); - return Ok(Some(H256::new())); + return Ok(Some(H256::zero())); } } }, // The account didn't exist at that point. Return empty value. - Some(Some(AccountEntry { account: None, .. })) => return Ok(Some(H256::new())), + Some(Some(AccountEntry { account: None, .. })) => return Ok(Some(H256::zero())), // The value was not cached at that checkpoint, meaning it was not modified at all. Some(None) => { kind = Some(ReturnKind::OriginalAt); @@ -658,12 +658,12 @@ impl State { local_account = Some(maybe_acc); } }, - _ => return Ok(H256::new()), + _ => return Ok(H256::zero()), } } // check the global cache and and cache storage key there if found, let trie_res = self.db.get_cached(address, |acc| match acc { - None => Ok(H256::new()), + None => Ok(H256::zero()), Some(a) => { let account_db = self.factories.accountdb.readonly(self.db.as_hash_db(), a.address_hash(address)); f_at(a, account_db.as_hash_db(), key) @@ -680,7 +680,7 @@ impl State { let account_db = self.factories.accountdb.readonly(self.db.as_hash_db(), account.address_hash(address)); return f_at(account, account_db.as_hash_db(), key) } else { - return Ok(H256::new()) + return Ok(H256::zero()) } } } @@ -692,8 +692,8 @@ impl State { let db = &self.db.as_hash_db(); let db = self.factories.trie.readonly(db, &self.root).expect(SEC_TRIE_DB_UNWRAP_STR); let from_rlp = |b: &[u8]| Account::from_rlp(b).expect("decoding db value failed"); - let maybe_acc = db.get_with(address, from_rlp)?; - let r = maybe_acc.as_ref().map_or(Ok(H256::new()), |a| { + let maybe_acc = db.get_with(address.as_bytes(), from_rlp)?; + let r = maybe_acc.as_ref().map_or(Ok(H256::zero()), |a| { let account_db = self.factories.accountdb.readonly(self.db.as_hash_db(), a.address_hash(address)); f_at(a, account_db.as_hash_db(), key) }); @@ -904,10 +904,10 @@ impl State { a.state = AccountState::Committed; match a.account { Some(ref mut account) => { - trie.insert(address, &account.rlp())?; + trie.insert(address.as_bytes(), &account.rlp())?; }, None => { - trie.remove(address)?; + trie.remove(address.as_bytes())?; }, }; } @@ -1141,7 +1141,7 @@ impl State { if Self::update_account_cache(require, account, &self.db, accountdb.as_hash_db()) { return Ok(f(Some(account))); } else { - return Err(Box::new(TrieError::IncompleteDatabase(H256::from(a)))); + return Err(Box::new(TrieError::IncompleteDatabase(H256::from(*a)))); } } return Ok(f(None)); @@ -1151,7 +1151,7 @@ impl State { if let Some(ref mut account) = acc { let accountdb = self.factories.accountdb.readonly(self.db.as_hash_db(), account.address_hash(a)); if !Self::update_account_cache(require, account, &self.db, accountdb.as_hash_db()) { - return Err(Box::new(TrieError::IncompleteDatabase(H256::from(a)))); + return Err(Box::new(TrieError::IncompleteDatabase(H256::from(*a)))); } } Ok(f(acc.map(|a| &*a))) @@ -1166,11 +1166,11 @@ impl State { let db = &self.db.as_hash_db(); let db = self.factories.trie.readonly(db, &self.root)?; let from_rlp = |b: &[u8]| Account::from_rlp(b).expect("decoding db value failed"); - let mut maybe_acc = db.get_with(a, from_rlp)?; + let mut maybe_acc = db.get_with(a.as_bytes(), from_rlp)?; if let Some(ref mut account) = maybe_acc.as_mut() { let accountdb = self.factories.accountdb.readonly(self.db.as_hash_db(), account.address_hash(a)); if !Self::update_account_cache(require, account, &self.db, accountdb.as_hash_db()) { - return Err(Box::new(TrieError::IncompleteDatabase(H256::from(a)))); + return Err(Box::new(TrieError::IncompleteDatabase(H256::from(*a)))); } } let r = f(maybe_acc.as_ref()); @@ -1199,7 +1199,7 @@ impl State { let db = &self.db.as_hash_db(); let db = self.factories.trie.readonly(db, &self.root)?; let from_rlp = |b:&[u8]| { Account::from_rlp(b).expect("decoding db value failed") }; - AccountEntry::new_clean(db.get_with(a, from_rlp)?) + AccountEntry::new_clean(db.get_with(a.as_bytes(), from_rlp)?) } else { AccountEntry::new_clean(None) }; @@ -1228,7 +1228,7 @@ impl State { let accountdb = self.factories.accountdb.readonly(self.db.as_hash_db(), addr_hash); if !Self::update_account_cache(RequireCache::Code, &mut account, &self.db, accountdb.as_hash_db()) { - return Err(Box::new(TrieError::IncompleteDatabase(H256::from(a)))) + return Err(Box::new(TrieError::IncompleteDatabase(H256::from(*a)))) } } @@ -1257,7 +1257,7 @@ impl State { ::rlp::decode(bytes).unwrap_or_else(|_| panic!("prove_account, could not query trie for account key={}", &account_key)) }; let query = (&mut recorder, panicky_decoder); - trie.get_with(&account_key, query)? + trie.get_with(account_key.as_bytes(), query)? }; let account = maybe_account.unwrap_or_else(|| BasicAccount { balance: 0.into(), @@ -1280,9 +1280,9 @@ impl State { let db = &self.db.as_hash_db(); let trie = TrieDB::new(db, &self.root)?; let from_rlp = |b: &[u8]| Account::from_rlp(b).expect("decoding db value failed"); - let acc = match trie.get_with(&account_key, from_rlp)? { + let acc = match trie.get_with(account_key.as_bytes(), from_rlp)? { Some(acc) => acc, - None => return Ok((Vec::new(), H256::new())), + None => return Ok((Vec::new(), H256::zero())), }; let account_db = self.factories.accountdb.readonly(self.db.as_hash_db(), account_key); diff --git a/ethcore/src/state_db.rs b/ethcore/src/state_db.rs index 066a4f6162e..2613411e4e0 100644 --- a/ethcore/src/state_db.rs +++ b/ethcore/src/state_db.rs @@ -458,13 +458,13 @@ impl state::Backend for StateDB { fn note_non_null_account(&self, address: &Address) { trace!(target: "account_bloom", "Note account bloom: {:?}", address); let mut bloom = self.account_bloom.lock(); - bloom.set(&*keccak(address)); + bloom.set(keccak(address).as_bytes()); } fn is_known_null(&self, address: &Address) -> bool { trace!(target: "account_bloom", "Check account bloom: {:?}", address); let bloom = self.account_bloom.lock(); - let is_null = !bloom.check(&*keccak(address)); + let is_null = !bloom.check(keccak(address).as_bytes()); is_null } } diff --git a/ethcore/src/test_helpers.rs b/ethcore/src/test_helpers.rs index b5575f36cd9..2112e58160b 100644 --- a/ethcore/src/test_helpers.rs +++ b/ethcore/src/test_helpers.rs @@ -136,7 +136,7 @@ pub fn generate_dummy_client_with_spec_and_data(test_spec: F, block_number: u let mut last_hashes = vec![]; let mut last_header = genesis_header.clone(); - let kp = KeyPair::from_secret_slice(&keccak("")).unwrap(); + let kp = KeyPair::from_secret_slice(keccak("").as_bytes()).unwrap(); let author = kp.address(); let mut n = 0; @@ -493,7 +493,7 @@ pub fn get_bad_state_dummy_block() -> Bytes { block_header.set_timestamp(40); block_header.set_number(1); block_header.set_parent_hash(test_spec.genesis_header().hash()); - block_header.set_state_root(0xbad.into()); + block_header.set_state_root(H256::from_low_u64_be(0xbad)); create_test_block(&block_header) } diff --git a/ethcore/src/trace/db.rs b/ethcore/src/trace/db.rs index 8dbd38449f7..d3758481275 100644 --- a/ethcore/src/trace/db.rs +++ b/ethcore/src/trace/db.rs @@ -43,8 +43,11 @@ impl Key for H256 { fn key(&self) -> H264 { let mut result = H264::default(); - result[0] = TraceDBIndex::BlockTraces as u8; - result[1..33].copy_from_slice(self); + { + let bytes = result.as_bytes_mut(); + bytes[0] = TraceDBIndex::BlockTraces as u8; + bytes[1..33].copy_from_slice(self.as_bytes()); + } result } } diff --git a/ethcore/src/trace/types/filter.rs b/ethcore/src/trace/types/filter.rs index d7b8fcc1808..e107ebcdffb 100644 --- a/ethcore/src/trace/types/filter.rs +++ b/ethcore/src/trace/types/filter.rs @@ -51,7 +51,7 @@ impl AddressesFilter { match self.list.is_empty() { true => vec![Bloom::default()], false => self.list.iter() - .map(|address| Bloom::from(BloomInput::Raw(address))) + .map(|address| Bloom::from(BloomInput::Raw(address.as_bytes()))) .collect(), } } @@ -65,7 +65,7 @@ impl AddressesFilter { .flat_map(|bloom| self.list.iter() .map(|address| { let mut bloom = bloom.clone(); - bloom.accrue(BloomInput::Raw(address)); + bloom.accrue(BloomInput::Raw(address.as_bytes())); bloom }) .collect::>()) @@ -425,4 +425,3 @@ mod tests { } } - diff --git a/ethcore/src/trace/types/trace.rs b/ethcore/src/trace/types/trace.rs index 16084e94cbd..6878cef9be9 100644 --- a/ethcore/src/trace/types/trace.rs +++ b/ethcore/src/trace/types/trace.rs @@ -47,7 +47,7 @@ pub struct CreateResult { impl CreateResult { /// Returns bloom. pub fn bloom(&self) -> Bloom { - BloomInput::Raw(&self.address).into() + BloomInput::Raw(self.address.as_bytes()).into() } } @@ -96,8 +96,8 @@ impl Call { /// The bloom contains from and to addresses. pub fn bloom(&self) -> Bloom { let mut bloom = Bloom::default(); - bloom.accrue(BloomInput::Raw(&self.from)); - bloom.accrue(BloomInput::Raw(&self.to)); + bloom.accrue(BloomInput::Raw(self.from.as_bytes())); + bloom.accrue(BloomInput::Raw(self.to.as_bytes())); bloom } } @@ -130,7 +130,7 @@ impl Create { /// Returns bloom create action bloom. /// The bloom contains only from address. pub fn bloom(&self) -> Bloom { - BloomInput::Raw(&self.from).into() + BloomInput::Raw(self.from.as_bytes()).into() } } @@ -185,7 +185,7 @@ pub struct Reward { impl Reward { /// Return reward action bloom. pub fn bloom(&self) -> Bloom { - BloomInput::Raw(&self.author).into() + BloomInput::Raw(self.author.as_bytes()).into() } } @@ -225,8 +225,8 @@ impl Suicide { /// Return suicide action bloom. pub fn bloom(&self) -> Bloom { let mut bloom = Bloom::default(); - bloom.accrue(BloomInput::Raw(&self.address)); - bloom.accrue(BloomInput::Raw(&self.refund_address)); + bloom.accrue(BloomInput::Raw(self.address.as_bytes())); + bloom.accrue(BloomInput::Raw(self.refund_address.as_bytes())); bloom } } diff --git a/ethcore/src/tx_filter.rs b/ethcore/src/tx_filter.rs index 3f32ab365a8..69ed7acf304 100644 --- a/ethcore/src/tx_filter.rs +++ b/ethcore/src/tx_filter.rs @@ -71,7 +71,7 @@ impl TransactionFilter { let mut contract_version_cache = self.contract_version_cache.lock(); let (tx_type, to) = match transaction.action { - Action::Create => (tx_permissions::CREATE, Address::new()), + Action::Create => (tx_permissions::CREATE, Address::zero()), Action::Call(address) => if client.code_hash(&address, BlockId::Hash(*parent_hash)).map_or(false, |c| c != KECCAK_EMPTY) { (tx_permissions::CALL, address) } else { diff --git a/ethcore/sync/src/blocks.rs b/ethcore/sync/src/blocks.rs index 125c8d0b9c5..7d9ad428a93 100644 --- a/ethcore/sync/src/blocks.rs +++ b/ethcore/sync/src/blocks.rs @@ -520,7 +520,7 @@ impl BlockCollection { (None, receipt_root) } } else { - (None, H256::new()) + (None, H256::zero()) }; self.parents.insert(*info.header.parent_hash(), hash); diff --git a/ethcore/sync/src/chain/mod.rs b/ethcore/sync/src/chain/mod.rs index ecbc27db79c..8f927236c06 100644 --- a/ethcore/sync/src/chain/mod.rs +++ b/ethcore/sync/src/chain/mod.rs @@ -1154,7 +1154,7 @@ impl ChainSync { if warp_protocol { let manifest = io.snapshot_service().manifest(); let block_number = manifest.as_ref().map_or(0, |m| m.block_number); - let manifest_hash = manifest.map_or(H256::new(), |m| keccak(m.into_rlp())); + let manifest_hash = manifest.map_or(H256::zero(), |m| keccak(m.into_rlp())); packet.append(&manifest_hash); packet.append(&block_number); if private_tx_protocol { diff --git a/ethcore/sync/src/chain/supplier.rs b/ethcore/sync/src/chain/supplier.rs index 7e71e6aeec7..1774fda85f8 100644 --- a/ethcore/sync/src/chain/supplier.rs +++ b/ethcore/sync/src/chain/supplier.rs @@ -412,7 +412,7 @@ mod test { let ss = TestSnapshotService::new(); let io = TestIo::new(&mut client, &ss, &queue, None); - let unknown: H256 = H256::new(); + let unknown: H256 = H256::zero(); let result = SyncSupplier::return_block_headers(&io, &Rlp::new(&make_hash_req(&unknown, 1, 0, false)), 0); assert!(to_header_vec(result).is_empty()); let result = SyncSupplier::return_block_headers(&io, &Rlp::new(&make_hash_req(&unknown, 1, 0, true)), 0); @@ -483,7 +483,7 @@ mod test { fn return_nodes() { let mut client = TestBlockChainClient::new(); let queue = RwLock::new(VecDeque::new()); - let sync = dummy_sync_with_peer(H256::new(), &client); + let sync = dummy_sync_with_peer(H256::zero(), &client); let ss = TestSnapshotService::new(); let mut io = TestIo::new(&mut client, &ss, &queue, None); @@ -527,7 +527,7 @@ mod test { fn return_receipts() { let mut client = TestBlockChainClient::new(); let queue = RwLock::new(VecDeque::new()); - let sync = dummy_sync_with_peer(H256::new(), &client); + let sync = dummy_sync_with_peer(H256::zero(), &client); let ss = TestSnapshotService::new(); let mut io = TestIo::new(&mut client, &ss, &queue, None); diff --git a/ethcore/sync/src/snapshot.rs b/ethcore/sync/src/snapshot.rs index 64e463c7b25..55b6f762024 100644 --- a/ethcore/sync/src/snapshot.rs +++ b/ethcore/sync/src/snapshot.rs @@ -194,9 +194,9 @@ mod test { version: 2, state_hashes: state_chunks.iter().map(|data| keccak(data)).collect(), block_hashes: block_chunks.iter().map(|data| keccak(data)).collect(), - state_root: H256::new(), + state_root: H256::zero(), block_number: 42, - block_hash: H256::new(), + block_hash: H256::zero(), }; let mhash = keccak(manifest.clone().into_rlp()); (manifest, mhash, state_chunks, block_chunks) diff --git a/ethcore/sync/src/tests/snapshot.rs b/ethcore/sync/src/tests/snapshot.rs index a3aa77d36d6..d6d769231c1 100644 --- a/ethcore/sync/src/tests/snapshot.rs +++ b/ethcore/sync/src/tests/snapshot.rs @@ -55,7 +55,7 @@ impl TestSnapshotService { version: 2, state_hashes: state_chunks.iter().map(|data| keccak(data)).collect(), block_hashes: block_chunks.iter().map(|data| keccak(data)).collect(), - state_root: H256::new(), + state_root: H256::zero(), block_number: block_number, block_hash: block_hash, }; @@ -145,7 +145,7 @@ fn snapshot_sync() { let mut config = SyncConfig::default(); config.warp_sync = WarpSync::Enabled; let mut net = TestNet::new_with_config(5, config); - let snapshot_service = Arc::new(TestSnapshotService::new_with_snapshot(16, H256::new(), 500000)); + let snapshot_service = Arc::new(TestSnapshotService::new_with_snapshot(16, H256::zero(), 500000)); for i in 0..4 { net.peer_mut(i).snapshot_service = snapshot_service.clone(); net.peer(i).chain.add_blocks(1, EachBlockWith::Nothing); diff --git a/ethcore/types/src/account_diff.rs b/ethcore/types/src/account_diff.rs index 91e6469b565..a2362465b11 100644 --- a/ethcore/types/src/account_diff.rs +++ b/ethcore/types/src/account_diff.rs @@ -19,7 +19,7 @@ use std::cmp::*; use std::fmt; use std::collections::BTreeMap; -use std::convert::TryInto; +use std::convert::TryFrom; use ethereum_types::{BigEndianHash as _, H256, U256}; use bytes::Bytes; @@ -106,8 +106,7 @@ impl AccountDiff { // TODO: refactor into something nicer. fn interpreted_hash(u: &H256) -> String { let uint = u.into_uint(); - let uint_64: Result = uint.try_into(); - if let Ok(n) = uint_64 { + if let Ok(n) = u64::try_from(uint) { format!("{} = {:#x}", n, n) // } else if u <= &H256::from("0xffffffffffffffffffffffffffffffffffffffff") { // format!("@{}", Address::from(u)) diff --git a/json/src/hash.rs b/json/src/hash.rs index 9c0f08e6974..6f20f6e46a5 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -21,7 +21,6 @@ use std::fmt; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::{Error, Visitor}; use ethereum_types::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, Bloom as Hash2048}; -use uint::Uint; macro_rules! impl_hash { ($name: ident, $inner: ident) => { @@ -87,12 +86,6 @@ macro_rules! impl_hash { } -impl Into for Uint { - fn into(self) -> u64 { - self.0.low_u64() - } -} - impl_hash!(H64, Hash64); impl_hash!(Address, Hash160); impl_hash!(H256, Hash256); diff --git a/json/src/uint.rs b/json/src/uint.rs index 368d3e982f8..3428fd56c40 100644 --- a/json/src/uint.rs +++ b/json/src/uint.rs @@ -32,6 +32,19 @@ impl Into for Uint { } } +impl Into for Uint { + fn into(self) -> u64 { + self.0.low_u64() + } +} + +impl Into for Uint { + fn into(self) -> usize { + self.0.low_u64() as usize + } +} + + impl Serialize for Uint { fn serialize(&self, serializer: S) -> Result where S: Serializer { diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 75e05ce4674..e19277dbc50 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -868,7 +868,7 @@ fn rpc_eth_transaction_receipt() { }, block_hash: H256::from_str("ed76641c68a1c641aee09a94b3b471f4dc0316efe5ac19cf488e2674cf8d05b5").unwrap(), block_number: 0x4510c, - transaction_hash: H256::new(), + transaction_hash: H256::zero(), transaction_index: 0, transaction_log_index: 0, log_index: 1, diff --git a/util/network-devp2p/src/handshake.rs b/util/network-devp2p/src/handshake.rs index 9bf047a8eb6..77b633c401e 100644 --- a/util/network-devp2p/src/handshake.rs +++ b/util/network-devp2p/src/handshake.rs @@ -341,7 +341,7 @@ mod test { fn create_handshake(to: Option<&Public>) -> Handshake { let addr = "127.0.0.1:50556".parse().unwrap(); let socket = TcpStream::connect(&addr).unwrap(); - let nonce = H256::new(); + let nonce = H256::zero(); Handshake::new(0, to, socket, &nonce).unwrap() } diff --git a/util/patricia-trie-ethereum/src/lib.rs b/util/patricia-trie-ethereum/src/lib.rs index ab44f4e8371..ac8479fe333 100644 --- a/util/patricia-trie-ethereum/src/lib.rs +++ b/util/patricia-trie-ethereum/src/lib.rs @@ -63,7 +63,7 @@ pub type RlpCodec = RlpNodeCodec; /// /// fn main() { /// let mut memdb = journaldb::new_memory_db(); -/// let mut root = H256::new(); +/// let mut root = H256::zero(); /// TrieDBMut::new(&mut memdb, &mut root).insert(b"foo", b"bar").unwrap(); /// let t = TrieDB::new(&memdb, &root).unwrap(); /// assert!(t.contains(b"foo").unwrap()); @@ -107,7 +107,7 @@ pub type FatDB<'db> = trie::FatDB<'db, KeccakHasher, RlpCodec>; /// /// fn main() { /// let mut memdb = journaldb::new_memory_db(); -/// let mut root = H256::new(); +/// let mut root = H256::zero(); /// let mut t = TrieDBMut::new(&mut memdb, &mut root); /// assert!(t.is_empty()); /// assert_eq!(*t.root(), KECCAK_NULL_RLP); From 46e3b2dd90e173fcdd2c7390574ac432a3877b23 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 17 May 2019 15:08:58 +0200 Subject: [PATCH 22/90] [parity-ipfs-api] fix compilation error --- ipfs/src/route.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipfs/src/route.rs b/ipfs/src/route.rs index f4a730338bd..1a4b5128f1e 100644 --- a/ipfs/src/route.rs +++ b/ipfs/src/route.rs @@ -56,7 +56,7 @@ impl IpfsHandler { if mh.alg != Hash::Keccak256 { return Err(Error::UnsupportedHash); } - let hash: H256 = mh.digest.into(); + let hash = H256::from_slice(&mh.digest); match cid.codec { Codec::EthereumBlock => self.block(hash), From dce478f8564436d13d90db025a617027841b2969 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 17 May 2019 15:12:01 +0200 Subject: [PATCH 23/90] [ethcore-light] fix compilation errors --- ethcore/light/src/client/header_chain.rs | 32 ++++++++++++++---------- ethcore/light/src/on_demand/request.rs | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ethcore/light/src/client/header_chain.rs b/ethcore/light/src/client/header_chain.rs index b365e71d409..2bcf53cb9f7 100644 --- a/ethcore/light/src/client/header_chain.rs +++ b/ethcore/light/src/client/header_chain.rs @@ -154,8 +154,11 @@ fn pending_transition_key(block_hash: H256) -> H264 { let mut key = H264::default(); - key[0] = LEADING; - key.0[1..].copy_from_slice(&block_hash.0[..]); + { + let bytes = key.as_bytes_mut(); + bytes[0] = LEADING; + bytes[1..].copy_from_slice(block_hash.as_bytes()); + } key } @@ -165,8 +168,11 @@ fn transition_key(block_hash: H256) -> H264 { let mut key = H264::default(); - key[0] = LEADING; - key.0[1..].copy_from_slice(&block_hash.0[..]); + { + let bytes = key.as_bytes_mut(); + bytes[0] = LEADING; + bytes[1..].copy_from_slice(block_hash.as_bytes()); + } key } @@ -237,7 +243,7 @@ impl HeaderChain { for c in &entry.candidates { let key = transition_key(c.hash); - if let Some(proof) = db.get(col, &*key)? { + if let Some(proof) = db.get(col, key.as_bytes())? { live_epoch_proofs.insert(c.hash, EpochTransition { block_hash: c.hash, block_number: cur_number, @@ -431,7 +437,7 @@ impl HeaderChain { } if let Some(transition) = transition { - transaction.put(self.col, &*transition_key(hash), &transition.proof); + transaction.put(self.col, transition_key(hash).as_bytes(), &transition.proof); self.live_epoch_proofs.write().insert(hash, transition); } @@ -508,10 +514,10 @@ impl HeaderChain { for ancient in &era_entry.candidates { let maybe_transition = live_epoch_proofs.remove(&ancient.hash); if let Some(epoch_transition) = maybe_transition { - transaction.delete(self.col, &*transition_key(ancient.hash)); + transaction.delete(self.col, transition_key(ancient.hash).as_bytes()); if ancient.hash == era_entry.canonical_hash { - last_canonical_transition = match self.db.get(self.col, &ancient.hash) { + last_canonical_transition = match self.db.get(self.col, ancient.hash.as_bytes()) { Err(e) => { warn!(target: "chain", "Error reading from DB: {}\n ", e); @@ -526,7 +532,7 @@ impl HeaderChain { } } - transaction.delete(self.col, &ancient.hash); + transaction.delete(self.col, ancient.hash.as_bytes()); } let canon = &era_entry.candidates[0]; @@ -647,7 +653,7 @@ impl HeaderChain { match cache.block_header(&hash) { Some(header) => Some(header), None => { - match self.db.get(self.col, &hash) { + match self.db.get(self.col, hash.as_bytes()) { Ok(db_value) => { db_value.map(|x| x.into_vec()).map(encoded::Header::new) .and_then(|header| { @@ -772,7 +778,7 @@ impl HeaderChain { /// Get block status. pub fn status(&self, hash: &H256) -> BlockStatus { - if self.db.get(self.col, hash).ok().map_or(false, |x| x.is_some()) { + if self.db.get(self.col, hash.as_bytes()).ok().map_or(false, |x| x.is_some()) { BlockStatus::InChain } else { BlockStatus::Unknown @@ -782,13 +788,13 @@ impl HeaderChain { /// Insert a pending transition. pub fn insert_pending_transition(&self, batch: &mut DBTransaction, hash: H256, t: &PendingEpochTransition) { let key = pending_transition_key(hash); - batch.put(self.col, &*key, &*::rlp::encode(t)); + batch.put(self.col, key.as_bytes(), &*::rlp::encode(t)); } /// Get pending transition for a specific block hash. pub fn pending_transition(&self, hash: H256) -> Option { let key = pending_transition_key(hash); - match self.db.get(self.col, &*key) { + match self.db.get(self.col, key.as_bytes()) { Ok(db_fetch) => db_fetch.map(|bytes| ::rlp::decode(&bytes).expect("decoding value from db failed")), Err(e) => { warn!(target: "chain", "Error reading from database: {}", e); diff --git a/ethcore/light/src/on_demand/request.rs b/ethcore/light/src/on_demand/request.rs index a183dcbcabc..56fa124a2aa 100644 --- a/ethcore/light/src/on_demand/request.rs +++ b/ethcore/light/src/on_demand/request.rs @@ -983,7 +983,7 @@ impl Account { let mut db = journaldb::new_memory_db(); for node in proof { db.insert(&node[..]); } - match TrieDB::new(&db, &state_root).and_then(|t| t.get(&keccak(&self.address)))? { + match TrieDB::new(&db, &state_root).and_then(|t| t.get(keccak(&self.address).as_bytes()))? { Some(val) => { let rlp = Rlp::new(&val); Ok(Some(BasicAccount { From 657afa3b7378c3287767ba339106dcd0513192fc Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 17 May 2019 16:55:48 +0200 Subject: [PATCH 24/90] [Cargo.lock] update parity-common --- Cargo.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 529d7f18681..641f20749a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -681,7 +681,7 @@ dependencies = [ [[package]] name = "ethbloom" version = "0.6.4" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1162,7 +1162,7 @@ dependencies = [ [[package]] name = "ethereum-types" version = "0.5.2" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.1.1" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", ] @@ -1736,7 +1736,7 @@ dependencies = [ [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1988,9 +1988,9 @@ dependencies = [ [[package]] name = "keccak-hash" version = "0.1.4" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ - "primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3118,7 +3118,7 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.2.4" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", @@ -3444,7 +3444,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.3.1" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4204,7 +4204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uint" version = "0.7.1" -source = "git+https://github.com/ordian/parity-common#5643ce070cf2be144ebb4076844eeb6f4e62f5bf" +source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", From 3478523e5ff033341eb95ad2fab1505181651824 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 17 May 2019 16:56:10 +0200 Subject: [PATCH 25/90] [ethcore-private-tx] fix some compilation errors --- ethcore/private-tx/src/encryptor.rs | 10 +++++----- ethcore/private-tx/src/key_server_keys.rs | 8 ++++---- ethcore/private-tx/src/lib.rs | 15 ++++++++------- ethcore/private-tx/src/messages.rs | 12 ++++++++---- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/ethcore/private-tx/src/encryptor.rs b/ethcore/private-tx/src/encryptor.rs index 597cc887969..8d5504d34d0 100644 --- a/ethcore/private-tx/src/encryptor.rs +++ b/ethcore/private-tx/src/encryptor.rs @@ -114,7 +114,7 @@ impl SecretStoreEncryptor { 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 contract_address_extended: H256 = (*contract_address).into(); let base_url = self.config.base_url.clone().ok_or_else(|| Error::KeyServerNotSet)?; // prepare request url @@ -156,7 +156,7 @@ impl SecretStoreEncryptor { let decrypted_key = Public::from_slice(&decrypted_bytes); // and now take x coordinate of Public as a key - let key: Bytes = (*decrypted_key)[..INIT_VEC_LEN].into(); + let key: Bytes = decrypted_key.as_bytes()[..INIT_VEC_LEN].into(); // cache the key in the session and clear expired sessions self.sessions.lock().insert(*contract_address, EncryptionSession{ @@ -212,11 +212,11 @@ impl Encryptor for SecretStoreEncryptor { }?; // encrypt data - let mut cypher = Vec::with_capacity(plain_data.len() + initialisation_vector.len()); + let mut cypher = Vec::with_capacity(plain_data.len() + initialisation_vector.as_bytes().len()); cypher.extend(repeat(0).take(plain_data.len())); - crypto::aes::encrypt_128_ctr(&key, initialisation_vector, plain_data, &mut cypher) + crypto::aes::encrypt_128_ctr(&key, initialisation_vector.as_bytes(), plain_data, &mut cypher) .map_err(|e| Error::Encrypt(e.to_string()))?; - cypher.extend_from_slice(&initialisation_vector); + cypher.extend_from_slice(&initialisation_vector.as_bytes()); Ok(cypher) } diff --git a/ethcore/private-tx/src/key_server_keys.rs b/ethcore/private-tx/src/key_server_keys.rs index 28d9b3cb91d..0a5204f9450 100644 --- a/ethcore/private-tx/src/key_server_keys.rs +++ b/ethcore/private-tx/src/key_server_keys.rs @@ -29,15 +29,15 @@ use_contract!(keys_acl_contract, "res/keys_acl.json"); /// Returns the address (of the contract), that corresponds to the key pub fn key_to_address(key: &H256) -> Address { - Address::from_slice(&key.to_vec()[..10]) + Address::from_slice(&key.as_bytes()[..10]) } /// Returns the key from the key server associated with the contract pub fn address_to_key(contract_address: &Address) -> H256 { // Current solution uses contract address extended with 0 as id - let contract_address_extended: H256 = contract_address.into(); + let contract_address_extended: H256 = (*contract_address).into(); - H256::from_slice(&contract_address_extended) + H256::from_slice(contract_address_extended.as_bytes()) } /// Trait for keys server keys provider. @@ -170,4 +170,4 @@ mod tests { keys_data.update_acl_contract(); assert_eq!(keys_data.keys_acl_contract.read().unwrap(), key.address()); } -} \ No newline at end of file +} diff --git a/ethcore/private-tx/src/lib.rs b/ethcore/private-tx/src/lib.rs index aaf44d572b6..181ca905126 100644 --- a/ethcore/private-tx/src/lib.rs +++ b/ethcore/private-tx/src/lib.rs @@ -80,7 +80,7 @@ pub use log::{Logging, TransactionLog, ValidatorLog, PrivateTxStatus, FileLogsSe use std::sync::{Arc, Weak}; use std::collections::{HashMap, HashSet, BTreeMap}; -use ethereum_types::{H128, H256, U256, Address}; +use ethereum_types::{H128, H256, U256, Address, BigEndianHash}; use hash::keccak; use rlp::*; use parking_lot::RwLock; @@ -285,9 +285,10 @@ impl Provider { /// Calculate hash from united private state and contract nonce pub fn calculate_state_hash(&self, state: &Bytes, nonce: U256) -> H256 { let state_hash = keccak(state); + let nonce_h256: H256 = BigEndianHash::from_uint(&nonce); let mut state_buf = [0u8; 64]; - state_buf[..32].clone_from_slice(&state_hash); - state_buf[32..].clone_from_slice(&H256::from(nonce)); + state_buf[..32].clone_from_slice(state_hash.as_bytes()); + state_buf[32..].clone_from_slice(nonce_h256.as_bytes()); keccak(&state_buf.as_ref()) } @@ -481,13 +482,13 @@ impl Provider { fn iv_from_transaction(transaction: &SignedTransaction) -> H128 { let nonce = keccak(&transaction.nonce.rlp_bytes()); - let (iv, _) = nonce.split_at(INIT_VEC_LEN); + let (iv, _) = nonce.as_bytes().split_at(INIT_VEC_LEN); H128::from_slice(iv) } fn iv_from_address(contract_address: &Address) -> H128 { let address = keccak(&contract_address.rlp_bytes()); - let (iv, _) = address.split_at(INIT_VEC_LEN); + let (iv, _) = address.as_bytes().split_at(INIT_VEC_LEN); H128::from_slice(iv) } @@ -536,8 +537,8 @@ impl Provider { // Sort the storage to guarantee the order for all parties let sorted_storage: BTreeMap<&H256, &H256> = storage.iter().collect(); for (key, value) in sorted_storage { - raw.extend_from_slice(key); - raw.extend_from_slice(value); + raw.extend_from_slice(key.as_bytes()); + raw.extend_from_slice(value.as_bytes()); }; raw } diff --git a/ethcore/private-tx/src/messages.rs b/ethcore/private-tx/src/messages.rs index 2990fb9b09f..5130b83e534 100644 --- a/ethcore/private-tx/src/messages.rs +++ b/ethcore/private-tx/src/messages.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 ethereum_types::{H256, U256, Address}; +use ethereum_types::{H256, U256, Address, BigEndianHash}; use bytes::Bytes; use hash::keccak; use rlp::Encodable; @@ -38,7 +38,7 @@ impl PrivateTransaction { PrivateTransaction { encrypted, contract, - hash: 0.into(), + hash: H256::zero(), }.compute_hash() } @@ -87,7 +87,7 @@ impl SignedPrivateTransaction { r: sig.r().into(), s: sig.s().into(), v: add_chain_replay_protection(sig.v() as u64, chain_id), - hash: 0.into(), + hash: H256::zero(), }.compute_hash() } @@ -100,7 +100,11 @@ impl SignedPrivateTransaction { /// Construct a signature object from the sig. pub fn signature(&self) -> Signature { - Signature::from_rsv(&self.r.into(), &self.s.into(), self.standard_v()) + Signature::from_rsv( + &BigEndianHash::from_uint(&self.r), + &BigEndianHash::from_uint(&self.s), + self.standard_v(), + ) } /// Get the hash of of the original transaction. From ad2807769c5e5adae74e79deebee9f6948f83c85 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 20 May 2019 19:05:09 +0200 Subject: [PATCH 26/90] wip --- Cargo.lock | 306 ++++++++++++----------- Cargo.toml | 12 +- accounts/Cargo.toml | 2 +- accounts/ethkey/Cargo.toml | 2 +- accounts/ethstore/Cargo.toml | 2 +- accounts/fake-hardware-wallet/Cargo.toml | 2 +- accounts/hw/Cargo.toml | 2 +- cli-signer/Cargo.toml | 2 +- cli-signer/rpc-client/Cargo.toml | 4 +- ethash/Cargo.toml | 4 +- ethcore/Cargo.toml | 12 +- ethcore/blockchain/Cargo.toml | 6 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 4 +- ethcore/evm/Cargo.toml | 4 +- ethcore/light/Cargo.toml | 6 +- ethcore/node-filter/Cargo.toml | 8 +- ethcore/private-tx/Cargo.toml | 12 +- ethcore/service/Cargo.toml | 2 +- ethcore/sync/Cargo.toml | 6 +- ethcore/types/Cargo.toml | 6 +- ethcore/vm/Cargo.toml | 6 +- ethcore/wasm/Cargo.toml | 2 +- ethcore/wasm/run/Cargo.toml | 2 +- evmbin/Cargo.toml | 2 +- ipfs/Cargo.toml | 4 +- json/Cargo.toml | 3 +- miner/Cargo.toml | 12 +- miner/local-store/Cargo.toml | 2 +- miner/stratum/Cargo.toml | 4 +- rpc/Cargo.toml | 6 +- secret-store/Cargo.toml | 10 +- updater/Cargo.toml | 10 +- updater/hash-fetch/Cargo.toml | 10 +- util/EIP-712/Cargo.toml | 6 +- util/blooms-db/Cargo.toml | 2 +- util/dir/Cargo.toml | 2 +- util/fastmap/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 6 +- util/keccak-hasher/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 6 +- util/network/Cargo.toml | 4 +- util/patricia-trie-ethereum/Cargo.toml | 6 +- util/registrar/Cargo.toml | 8 +- util/rlp-compress/Cargo.toml | 2 +- util/rlp-derive/Cargo.toml | 2 +- util/triehash-ethereum/Cargo.toml | 2 +- util/version/Cargo.toml | 2 +- whisper/Cargo.toml | 4 +- 49 files changed, 270 insertions(+), 265 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 641f20749a8..840bad4dfdd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -261,7 +261,7 @@ dependencies = [ name = "cli-signer" version = "1.4.0" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.12.0", "parity-rpc-client 1.4.0", @@ -300,13 +300,13 @@ dependencies = [ name = "common-types" version = "0.1.0" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "ethkey 0.3.0", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "unexpected 0.1.0", @@ -533,7 +533,7 @@ name = "dir" version = "0.1.2" dependencies = [ "app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", ] @@ -559,12 +559,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "eip-712" version = "0.1.0" dependencies = [ - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -631,11 +631,11 @@ dependencies = [ [[package]] name = "ethabi" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "8.0.0" +source = "git+https://github.com/ordian/ethabi#a8abed8528873112c4fde42b81f454baf4771436" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "rustc-hex 2.0.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)", @@ -645,15 +645,15 @@ dependencies = [ [[package]] name = "ethabi-contract" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "8.0.0" +source = "git+https://github.com/ordian/ethabi#a8abed8528873112c4fde42b81f454baf4771436" [[package]] name = "ethabi-derive" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "8.0.0" +source = "git+https://github.com/ordian/ethabi#a8abed8528873112c4fde42b81f454baf4771436" dependencies = [ - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", "heck 0.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)", @@ -667,8 +667,8 @@ dependencies = [ "criterion 0.2.11 (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.5.2 (git+https://github.com/ordian/parity-common)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -681,11 +681,11 @@ dependencies = [ [[package]] name = "ethbloom" version = "0.6.4" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", - "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", + "impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)", "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -703,9 +703,9 @@ dependencies = [ "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", "ethash 1.12.0", "ethcore-accounts 0.1.0", "ethcore-blockchain 0.1.0", @@ -715,7 +715,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-stratum 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "ethkey 0.3.0", "evm 0.1.0", @@ -725,7 +725,7 @@ dependencies = [ "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)", "journaldb 0.2.0", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -747,7 +747,7 @@ dependencies = [ "patricia-trie-ethereum 0.1.0", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -771,7 +771,7 @@ name = "ethcore-accounts" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-hardware-wallet 0.0.1", @@ -793,18 +793,18 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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.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.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -823,7 +823,7 @@ name = "ethcore-call-contract" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -832,11 +832,11 @@ name = "ethcore-db" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", ] @@ -870,7 +870,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -878,7 +878,7 @@ dependencies = [ "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)", "journaldb 0.2.0", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -889,7 +889,7 @@ dependencies = [ "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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "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)", @@ -924,24 +924,24 @@ dependencies = [ "common-types 0.1.0", "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 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", "ethash 1.12.0", "ethcore-call-contract 0.1.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "linked-hash-map 0.5.1 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", "price-info 1.12.0", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rustc-hex 1.0.0 (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)", @@ -958,14 +958,14 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ipnetwork 0.12.8 (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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "semver 0.9.0 (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)", @@ -982,11 +982,11 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "libc 0.2.48 (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.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -997,7 +997,7 @@ dependencies = [ "parity-snappy 0.1.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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1015,27 +1015,27 @@ 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)", - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", "ethcore 1.12.0", "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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.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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1055,19 +1055,19 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", "ethcore 1.12.0", "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", "jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1100,7 +1100,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1113,10 +1113,10 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -1136,14 +1136,14 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", "ethcore-private-tx 1.0.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ethstore 0.2.1", "fastmap 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -1153,7 +1153,7 @@ dependencies = [ "parity-runtime 0.1.0", "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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", "triehash-ethereum 0.2.0", @@ -1161,14 +1161,14 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.5.2" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +version = "0.6.0" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", - "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", + "impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)", "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", - "primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)", + "primitive-types 0.3.0 (git+https://github.com/ordian/parity-common)", "uint 0.7.1 (git+https://github.com/ordian/parity-common)", ] @@ -1176,7 +1176,7 @@ dependencies = [ name = "ethjson" version = "0.1.0" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "rustc-hex 1.0.0 (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)", @@ -1190,7 +1190,7 @@ 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?branch=rand-0.6)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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", @@ -1224,7 +1224,7 @@ name = "ethstore" version = "0.2.1" dependencies = [ "dir 0.1.2", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1268,9 +1268,9 @@ version = "0.1.0" dependencies = [ "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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", @@ -1289,7 +1289,7 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -1346,7 +1346,7 @@ dependencies = [ name = "fake-hardware-wallet" version = "0.0.1" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", ] @@ -1359,7 +1359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fastmap" version = "0.1.0" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1524,7 +1524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "hardware-wallet" version = "1.12.0" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -1720,23 +1720,23 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "impl-rlp" -version = "0.1.1" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +version = "0.2.0" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", ] [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1841,11 +1841,11 @@ name = "journaldb" version = "0.2.0" dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -1853,7 +1853,7 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -1987,10 +1987,10 @@ dependencies = [ [[package]] name = "keccak-hash" -version = "0.1.4" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +version = "0.2.0" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1998,7 +1998,7 @@ dependencies = [ name = "keccak-hasher" version = "0.1.1" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2364,14 +2364,14 @@ dependencies = [ name = "node-filter" version = "1.12.0" dependencies = [ - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", "ethcore 1.12.0", "ethcore-io 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "kvdb-memorydb 0.1.0 (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.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2580,7 +2580,7 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-service 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-fetch 0.0.1", @@ -2589,7 +2589,7 @@ dependencies = [ "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2614,7 +2614,7 @@ dependencies = [ "pretty_assertions 0.1.2 (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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2633,14 +2633,14 @@ dependencies = [ name = "parity-hash-fetch" version = "1.12.0" dependencies = [ - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2658,12 +2658,12 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2677,7 +2677,7 @@ 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)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2727,7 +2727,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.1", @@ -2742,7 +2742,7 @@ dependencies = [ "jsonrpc-ipc-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)", "jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2755,7 +2755,7 @@ dependencies = [ "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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2774,11 +2774,11 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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", @@ -2836,13 +2836,13 @@ name = "parity-updater" version = "1.12.0" dependencies = [ "common-types 0.1.0", - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", "ethcore 1.12.0", "ethcore-sync 1.12.0", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2862,7 +2862,7 @@ name = "parity-version" version = "2.6.0" dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2884,7 +2884,7 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2897,7 +2897,7 @@ dependencies = [ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2984,14 +2984,14 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "keccak-hasher 0.1.1", "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)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3117,12 +3117,12 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.2.4" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +version = "0.3.0" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", - "impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)", + "impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)", "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", "uint 0.7.1 (git+https://github.com/ordian/parity-common)", ] @@ -3154,7 +3154,7 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3405,11 +3405,11 @@ dependencies = [ name = "registrar" version = "0.0.1" dependencies = [ - "ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -3443,8 +3443,17 @@ dependencies = [ [[package]] name = "rlp" -version = "0.3.1" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +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)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rlp" +version = "0.4.0" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3456,7 +3465,7 @@ version = "0.1.0" dependencies = [ "elastic-array 0.10.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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", ] [[package]] @@ -3465,7 +3474,7 @@ version = "0.1.0" 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)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4169,14 +4178,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "triehash-ethereum" version = "0.2.0" dependencies = [ - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "keccak-hasher 0.1.1", "triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4204,7 +4213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uint" version = "0.7.1" -source = "git+https://github.com/ordian/parity-common#cbd3a0eadbbc464340323067708e990c9f373d54" +source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4344,13 +4353,13 @@ name = "vm" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethjson 0.1.0", - "keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", "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.1 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4395,7 +4404,7 @@ 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.5.2 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "libc 0.2.48 (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)", @@ -4595,11 +4604,11 @@ dependencies = [ "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" "checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6)" = "" -"checksum ethabi 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be9a03ff8f3d495d9b73d59fd166acc91d0fd81779911b0b8b4c87b6024a670a" -"checksum ethabi-contract 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b51f33d0b3998b4330d6b5a4b1b02a03d3c96b5de44d563929e232f4a30ba7e2" -"checksum ethabi-derive 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ae5f5517ad9270a91ea7c86487a4872ded693f5d039b4d3da210237980ddd3bf" +"checksum ethabi 8.0.0 (git+https://github.com/ordian/ethabi)" = "" +"checksum ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)" = "" +"checksum ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)" = "" "checksum ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)" = "" -"checksum ethereum-types 0.5.2 (git+https://github.com/ordian/parity-common)" = "" +"checksum ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)" = "" "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" @@ -4640,7 +4649,7 @@ dependencies = [ "checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" "checksum igd 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a254e265e8810deb357a9de757f784787ec415d056ededf410c0aa460afee9e" "checksum impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)" = "" -"checksum impl-rlp 0.1.1 (git+https://github.com/ordian/parity-common)" = "" +"checksum impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)" = "" "checksum impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)" = "" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "26746cbc2e680af687e88d717f20ff90079bd10fc984ad57d277cd0e37309fa5" @@ -4665,7 +4674,7 @@ dependencies = [ "checksum jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3372b3248a53abcca8f61924f188052bb0c4cd80b482b2b4eaf9f8667efb9f4" "checksum jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c873dac37a601fb88d40ba49eeac3f1aa60953c06b2e99ddbf0569b6f8028478" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" -"checksum keccak-hash 0.1.4 (git+https://github.com/ordian/parity-common)" = "" +"checksum keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)" = "" "checksum keccak-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "af672553b2abac1c86c29fd62c79880638b6abc91d96db4aa42a5baab2bc1ca9" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" @@ -4748,7 +4757,7 @@ dependencies = [ "checksum primal-check 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1" "checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" "checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" -"checksum primitive-types 0.2.4 (git+https://github.com/ordian/parity-common)" = "" +"checksum primitive-types 0.3.0 (git+https://github.com/ordian/parity-common)" = "" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" "checksum protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "52fbc45bf6709565e44ef31847eb7407b3c3c80af811ee884a04da071dcca12b" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" @@ -4781,7 +4790,8 @@ dependencies = [ "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" -"checksum rlp 0.3.1 (git+https://github.com/ordian/parity-common)" = "" +"checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" +"checksum rlp 0.4.0 (git+https://github.com/ordian/parity-common)" = "" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" "checksum rprompt 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1601f32bc5858aae3cbfa1c645c96c4d820cc5c16be0194f089560c00b6eb625" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" diff --git a/Cargo.toml b/Cargo.toml index 297cacb5fba..3a360debd04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,11 +45,12 @@ ethcore-network = { path = "util/network" } ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-service = { path = "ethcore/service" } ethcore-sync = { path = "ethcore/sync" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } + ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } node-filter = { path = "ethcore/node-filter" } -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } cli-signer= { path = "cli-signer" } parity-daemonize = "0.3" parity-hash-fetch = { path = "updater/hash-fetch" } @@ -63,7 +64,7 @@ parity-whisper = { path = "whisper" } parity-path = "0.1" dir = { path = "util/dir" } panic_hook = { path = "util/panic-hook" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } migration-rocksdb = { path = "util/migration-rocksdb" } kvdb = "0.1" kvdb-rocksdb = "0.1.3" @@ -144,10 +145,5 @@ members = [ [patch.crates-io] heapsize = { git = "https://github.com/cheme/heapsize.git", branch = "ec-macfix" } -# TODO: remove when 0.5.3 is published -ethereum-types = { git = "https://github.com/ordian/parity-common" } ethbloom = { git = "https://github.com/ordian/parity-common" } -rlp = { git = "https://github.com/ordian/parity-common" } primitive-types = { git = "https://github.com/ordian/parity-common" } -# TODO: fix keccak-hash upstream -keccak-hash = { git = "https://github.com/ordian/parity-common" } diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index 2aeb5ea549c..bc5a889d835 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -24,5 +24,5 @@ hardware-wallet = { path = "hw" } fake-hardware-wallet = { path = "fake-hardware-wallet" } [dev-dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } tempdir = "0.3" diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index dd764bf71bb..8c2133083fa 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -9,7 +9,7 @@ edit-distance = "2.0" parity-crypto = "0.3.0" # TODO: use master branch after we switch to rand 0.6 eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", branch = "rand-0.6" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } lazy_static = "1.0" log = "0.4" memzero = { path = "../../util/memzero" } diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index d14798396f0..49509639006 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -17,7 +17,7 @@ time = "0.1.34" itertools = "0.5" parking_lot = "0.7" parity-crypto = "0.3.0" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } dir = { path = "../../util/dir" } smallvec = "0.6" parity-wordlist = "1.0" diff --git a/accounts/fake-hardware-wallet/Cargo.toml b/accounts/fake-hardware-wallet/Cargo.toml index ac98a159f0c..8d2c2d2aad5 100644 --- a/accounts/fake-hardware-wallet/Cargo.toml +++ b/accounts/fake-hardware-wallet/Cargo.toml @@ -6,5 +6,5 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethkey = { path = "../../accounts/ethkey" } diff --git a/accounts/hw/Cargo.toml b/accounts/hw/Cargo.toml index 7344425c037..c7a9c202fcd 100644 --- a/accounts/hw/Cargo.toml +++ b/accounts/hw/Cargo.toml @@ -14,7 +14,7 @@ hidapi = { git = "https://github.com/paritytech/hidapi-rs" } libusb = { git = "https://github.com/paritytech/libusb-rs" } trezor-sys = { git = "https://github.com/paritytech/trezor-sys" } ethkey = { path = "../ethkey" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } semver = "0.9" [dev-dependencies] diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index 274db62e608..fe172d81f36 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -7,7 +7,7 @@ name = "cli-signer" version = "1.4.0" [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } 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 bb9ffe746f2..e017f1ecf4c 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -7,7 +7,7 @@ name = "parity-rpc-client" version = "1.4.0" [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } futures = "0.1" log = "0.4" serde = "1.0" @@ -18,4 +18,4 @@ parking_lot = "0.7" jsonrpc-core = "10.0.1" jsonrpc-ws-server = "10.0.1" parity-rpc = { path = "../../rpc" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index 71a742e1af5..0b47c7fb0ef 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -6,8 +6,8 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1.0" either = "1.0.0" -ethereum-types = "0.5.2" -keccak-hash = "0.1.4" +ethereum-types = { git = "https://github.com/ordian/parity-common" } +keccak-hash = { git = "https://github.com/ordian/parity-common" } log = "0.4" memmap = "0.6" parking_lot = "0.7" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 8a8104157bb..83a4ff46c06 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -15,9 +15,9 @@ common-types = { path = "types" } crossbeam = "0.4" derive_more = "0.14.0" env_logger = { version = "0.5", optional = true } -ethabi = "7.0.0" -ethabi-contract = "7.0.0" -ethabi-derive = "7.0.0" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } ethash = { path = "../ethash" } ethcore-blockchain = { path = "./blockchain" } ethcore-bloom-journal = { path = "../util/bloom" } @@ -26,7 +26,7 @@ ethcore-db = { path = "./db" } ethcore-io = { path = "../util/io" } ethcore-miner = { path = "../miner" } ethcore-stratum = { path = "../miner/stratum", optional = true } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } evm = { path = "evm" } @@ -35,7 +35,7 @@ hash-db = "0.11.0" heapsize = "0.4" itertools = "0.5" journaldb = { path = "../util/journaldb" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } keccak-hasher = { path = "../util/keccak-hasher" } kvdb = "0.1" kvdb-memorydb = "0.1" @@ -57,7 +57,7 @@ trie-db = "0.11.0" patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" } rand = "0.4" rayon = "1.0" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } rlp_derive = { path = "../util/rlp-derive" } rustc-hex = "1.0" serde = "1.0" diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index ec76cad02a7..383679684bc 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -12,7 +12,7 @@ ansi_term = "0.10" blooms-db = { path = "../../util/blooms-db" } common-types = { path = "../types" } ethcore-db = { path = "../db" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } heapsize = "0.4" itertools = "0.5" kvdb = "0.1" @@ -20,14 +20,14 @@ log = "0.4" parity-bytes = "0.1" parking_lot = "0.7" rayon = "1.0" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } rlp_compress = { path = "../../util/rlp-compress" } rlp_derive = { path = "../../util/rlp-derive" } [dev-dependencies] env_logger = "0.5" ethkey = { path = "../../accounts/ethkey" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } rustc-hex = "1.0" tempdir = "0.3" kvdb-memorydb = "0.1" diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index 46615e9a024..fbf95a6acad 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -7,5 +7,5 @@ edition = "2018" [dependencies] types = { path = "../types", package = "common-types" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } bytes = { version = "0.1", package = "parity-bytes" } diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index 6837d52e205..612025e446d 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -9,9 +9,9 @@ edition = "2018" [dependencies] common-types = { path = "../types" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } heapsize = "0.4" kvdb = "0.1" parking_lot = "0.7" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } rlp_derive = { path = "../../util/rlp-derive" } diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 82b4c6d42e2..888fadf55d0 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -6,12 +6,12 @@ authors = ["Parity Technologies "] [dependencies] bit-set = "0.4" parity-bytes = "0.1" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } heapsize = "0.4" lazy_static = "1.0" log = "0.4" vm = { path = "../vm" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } parking_lot = "0.7" memory-cache = { path = "../../util/memory-cache" } num-bigint = "0.2" diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index d73e81abe16..d1632fc6ec7 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../types" } ethcore = { path = ".."} ethcore-db = { path = "../db" } ethcore-blockchain = { path = "../blockchain" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } memory-db = "0.11.0" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } @@ -25,7 +25,7 @@ heapsize = "0.4" vm = { path = "../vm" } fastmap = { path = "../../util/fastmap" } failsafe = { version = "0.3.0", default-features = false, features = ["parking_lot_mutex"] } -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } rlp_derive = { path = "../../util/rlp-derive" } smallvec = "0.6" futures = "0.1" @@ -36,7 +36,7 @@ serde = "1.0" serde_derive = "1.0" parking_lot = "0.7" stats = { path = "../../util/stats" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } keccak-hasher = { path = "../../util/keccak-hasher" } triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } kvdb = "0.1" diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index 2c962de1e74..c5d8ca77055 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -10,12 +10,12 @@ authors = ["Parity Technologies "] ethcore = { path = ".."} ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } log = "0.4" parking_lot = "0.7" -ethabi = "7.0.0" -ethabi-derive = "7.0.0" -ethabi-contract = "7.0.0" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } lru-cache = "0.1" [dev-dependencies] diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 4eeb87673b7..85c01611edf 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -8,20 +8,20 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../types" } derive_more = "0.14.0" -ethabi = "7.0.0" -ethabi-contract = "7.0.0" -ethabi-derive = "7.0.0" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } ethcore = { path = ".." } ethcore-call-contract = { path = "../call-contract" } ethcore-io = { path = "../../util/io" } ethcore-miner = { path = "../../miner" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } fetch = { path = "../../util/fetch" } futures = "0.1" heapsize = "0.4" -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } log = "0.4" parity-bytes = "0.1" parity-crypto = "0.3.0" @@ -29,7 +29,7 @@ parking_lot = "0.7" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } rand = "0.3" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } rlp_derive = { path = "../../util/rlp-derive" } rustc-hex = "1.0" serde = "1.0" diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index 985c27eb3be..b12744a500f 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -11,7 +11,7 @@ ethcore-blockchain = { path = "../blockchain" } ethcore-io = { path = "../../util/io" } ethcore-private-tx = { path = "../private-tx" } ethcore-sync = { path = "../sync" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } kvdb = "0.1" log = "0.4" trace-time = "0.1" diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index def0e64c473..20f6670c0f8 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -15,13 +15,13 @@ ethcore-io = { path = "../../util/io" } ethcore-light = { path = "../light" } ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethkey = { path = "../../accounts/ethkey" } ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } hash-db = "0.11.0" heapsize = "0.4" -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } keccak-hasher = { path = "../../util/keccak-hasher" } kvdb = "0.1" log = "0.4" @@ -29,7 +29,7 @@ macros = { path = "../../util/macros" } parity-bytes = "0.1" parking_lot = "0.7" rand = "0.4" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } trace-time = "0.1" triehash-ethereum = {version = "0.2", path = "../../util/triehash-ethereum" } futures = "0.1" diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index 1ca204bab5e..cd7753c7a50 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -5,13 +5,13 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } parity-bytes = "0.1" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } rlp_derive = { path = "../../util/rlp-derive" } unexpected = { path = "../../util/unexpected" } diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 09e6551f01c..34b64a5d446 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -6,10 +6,10 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" parity-bytes = "0.1" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" ethjson = { path = "../../json" } -rlp = { version = "0.3.0", default-features = false } -keccak-hash = "0.1.4" +rlp = { git = "https://github.com/ordian/parity-common" } +keccak-hash = { git = "https://github.com/ordian/parity-common" } diff --git a/ethcore/wasm/Cargo.toml b/ethcore/wasm/Cargo.toml index 60c69925e66..c963be2c40a 100644 --- a/ethcore/wasm/Cargo.toml +++ b/ethcore/wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } log = "0.4" parity-wasm = "0.31" libc = "0.2" diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml index b20235e83b4..538222a530c 100644 --- a/ethcore/wasm/run/Cargo.toml +++ b/ethcore/wasm/run/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] serde = "1" serde_json = "1" serde_derive = "1" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethjson = { path = "../../../json" } vm = { path = "../../vm" } wasm = { path = "../" } diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index 2d7dccce0f8..88f30e27dff 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../ethcore/types" } docopt = "1.0" env_logger = "0.5" ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethjson = { path = "../json" } evm = { path = "../ethcore/evm" } panic_hook = { path = "../util/panic-hook" } diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index a7bc6766aa9..47ca240b608 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -8,10 +8,10 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } parity-bytes = "0.1" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } jsonrpc-core = "10.0.1" jsonrpc-http-server = "10.0.1" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } cid = "0.3" multihash = "0.8" unicase = "2.0" diff --git a/json/Cargo.toml b/json/Cargo.toml index e442039910a..1a6eded8c00 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -4,9 +4,8 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } rustc-hex = "1.0" serde = "1.0" serde_json = "1.0" serde_derive = "1.0" - diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 4b144e9778d..3f66d3e0707 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -17,20 +17,20 @@ url = { version = "1", optional = true } ansi_term = "0.10" common-types = { path = "../ethcore/types" } error-chain = "0.12" -ethabi = "7.0.0" -ethabi-derive = "7.0.0" -ethabi-contract = "7.0.0" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } ethcore-call-contract = { path = "../ethcore/call-contract" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } futures = "0.1" heapsize = "0.4" -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } linked-hash-map = "0.5" log = "0.4" parity-runtime = { path = "../util/runtime" } parking_lot = "0.7" price-info = { path = "./price-info", optional = true } -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/miner/local-store/Cargo.toml b/miner/local-store/Cargo.toml index 23a12df81a7..27e678a3f37 100644 --- a/miner/local-store/Cargo.toml +++ b/miner/local-store/Cargo.toml @@ -9,7 +9,7 @@ common-types = { path = "../../ethcore/types" } ethcore-io = { path = "../../util/io" } kvdb = "0.1" log = "0.4" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/miner/stratum/Cargo.toml b/miner/stratum/Cargo.toml index 218eb5488bc..cd18c6feca4 100644 --- a/miner/stratum/Cargo.toml +++ b/miner/stratum/Cargo.toml @@ -6,8 +6,8 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.5.2" -keccak-hash = "0.1.4" +ethereum-types = { git = "https://github.com/ordian/parity-common" } +keccak-hash = { git = "https://github.com/ordian/parity-common" } jsonrpc-core = "10.0.1" jsonrpc-tcp-server = "10.0.1" log = "0.4" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 1b566b5b77a..6fb672df073 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -44,7 +44,7 @@ ethcore-miner = { path = "../miner" } ethcore-network = { path = "../util/network" } ethcore-private-tx = { path = "../ethcore/private-tx" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } fastmap = { path = "../util/fastmap" } parity-bytes = "0.1" parity-crypto = "0.3.0" @@ -54,11 +54,11 @@ ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } ethstore = { path = "../accounts/ethstore" } fetch = { path = "../util/fetch" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } parity-runtime = { path = "../util/runtime" } parity-updater = { path = "../updater" } parity-version = { path = "../util/version" } -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } stats = { path = "../util/stats" } vm = { path = "../ethcore/vm" } diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index d233b61b0c6..4135097bee6 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -8,18 +8,18 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" common-types = { path = "../ethcore/types" } -ethabi = "7.0.0" -ethabi-contract = "7.0.0" -ethabi-derive = "7.0.0" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } ethcore = { path = "../ethcore" } ethcore-accounts = { path = "../accounts", optional = true} ethcore-call-contract = { path = "../ethcore/call-contract" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethkey = { path = "../accounts/ethkey" } futures = "0.1" hyper = { version = "0.12", default-features = false } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } kvdb = "0.1" lazy_static = "1.0" log = "0.4" diff --git a/updater/Cargo.toml b/updater/Cargo.toml index 5b837433b2c..e914b89f344 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -7,13 +7,13 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../ethcore/types" } -ethabi = "7.0.0" -ethabi-contract = "7.0.0" -ethabi-derive = "7.0.0" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.5.2" -keccak-hash = "0.1.4" +ethereum-types = { git = "https://github.com/ordian/parity-common" } +keccak-hash = { git = "https://github.com/ordian/parity-common" } lazy_static = "1.0" log = "0.4" parity-bytes = "0.1" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index b8bc299f549..c84e30d9562 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -15,14 +15,14 @@ rand = "0.4" rustc-hex = "1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } parity-runtime = { path = "../../util/runtime" } -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } registrar = { path = "../../util/registrar" } -ethabi = "7.0.0" -ethabi-derive = "7.0.0" -ethabi-contract = "7.0.0" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } [dev-dependencies] parking_lot = "0.7" diff --git a/util/EIP-712/Cargo.toml b/util/EIP-712/Cargo.toml index cc266593efc..7cd9342f04d 100644 --- a/util/EIP-712/Cargo.toml +++ b/util/EIP-712/Cargo.toml @@ -14,9 +14,9 @@ edition = "2018" serde_derive = "1.0" serde = "1.0" serde_json = "1.0" -ethabi = "7.0.0" -keccak-hash = "0.1.4" -ethereum-types = "0.5.2" +ethabi = { git = "https://github.com/ordian/ethabi" } +keccak-hash = { git = "https://github.com/ordian/parity-common" } +ethereum-types = { git = "https://github.com/ordian/parity-common" } failure = "0.1" itertools = "0.7" lazy_static = "1.1" diff --git a/util/blooms-db/Cargo.toml b/util/blooms-db/Cargo.toml index b2e2bfacd02..7f0951e79ee 100644 --- a/util/blooms-db/Cargo.toml +++ b/util/blooms-db/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.2" -ethbloom = "0.6.3" +ethbloom = { git = "https://github.com/ordian/parity-common" } parking_lot = "0.7" tiny-keccak = "1.4" diff --git a/util/dir/Cargo.toml b/util/dir/Cargo.toml index 3533018df7e..5d4f171f978 100644 --- a/util/dir/Cargo.toml +++ b/util/dir/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] license = "GPL3" [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } journaldb = { path = "../journaldb" } app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } home = "0.3" diff --git a/util/fastmap/Cargo.toml b/util/fastmap/Cargo.toml index 54831ce3a10..87ff1b36b37 100644 --- a/util/fastmap/Cargo.toml +++ b/util/fastmap/Cargo.toml @@ -6,5 +6,5 @@ description = "Specialized version of `HashMap` with H256 keys and fast hashing license = "GPL-3.0" [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } plain_hasher = "0.2" diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 4a318545c76..7c106690538 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL3" [dependencies] parity-bytes = "0.1" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } hash-db = "0.11.0" heapsize = "0.4" keccak-hasher = { path = "../keccak-hasher" } @@ -16,9 +16,9 @@ log = "0.4" memory-db = "0.11.0" parking_lot = "0.7" fastmap = { path = "../../util/fastmap" } -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } [dev-dependencies] env_logger = "0.5" -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } kvdb-memorydb = "0.1" diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index 8572df536e1..c7b1a04e25a 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -6,7 +6,7 @@ description = "Keccak-256 implementation of the Hasher trait" license = "GPL-3.0" [dependencies] -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } tiny-keccak = "1.4.2" hash-db = "0.11.0" plain_hasher = "0.2" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index 5fc3657570b..106d9748a40 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -23,12 +23,12 @@ ethcore-io = { path = "../io", features = ["mio"] } parity-bytes = "0.1" parity-crypto = "0.3.0" ethcore-network = { path = "../network" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethkey = { path = "../../accounts/ethkey" } -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } parity-path = "0.1" ipnetwork = "0.12.6" -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } parity-snappy = "0.1" serde = "1.0" serde_json = "1.0" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index f9d1bf14b25..3866be567bd 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -10,11 +10,11 @@ authors = ["Parity Technologies "] error-chain = { version = "0.12", default-features = false } parity-crypto = "0.3.0" ethcore-io = { path = "../io" } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethkey = { path = "../../accounts/ethkey" } ipnetwork = "0.12.6" lazy_static = "1.0" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } libc = "0.2" parity-snappy = "0.1" semver = {version="0.9.0", features=["serde"]} diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index bd1eb473851..4aa2af315cc 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -9,12 +9,12 @@ license = "GPL-3.0" trie-db = "0.11.0" keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } hash-db = "0.11.0" -rlp = "0.3.0" +rlp = { git = "https://github.com/ordian/parity-common" } parity-bytes = "0.1" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } elastic-array = "0.10" [dev-dependencies] memory-db = "0.11.0" -keccak-hash = "0.1.4" +keccak-hash = { git = "https://github.com/ordian/parity-common" } journaldb = { path = "../journaldb" } diff --git a/util/registrar/Cargo.toml b/util/registrar/Cargo.toml index 03ce8426727..76e59e058ab 100644 --- a/util/registrar/Cargo.toml +++ b/util/registrar/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] [dependencies] futures = "0.1" -ethabi = "7.0.0" -ethabi-derive = "7.0.0" -ethabi-contract = "7.0.0" -keccak-hash = "0.1.4" +ethabi = { git = "https://github.com/ordian/ethabi" } +ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi-contract = { git = "https://github.com/ordian/ethabi" } +keccak-hash = { git = "https://github.com/ordian/parity-common" } diff --git a/util/rlp-compress/Cargo.toml b/util/rlp-compress/Cargo.toml index 3139a175c44..7ec83eaf2fc 100644 --- a/util/rlp-compress/Cargo.toml +++ b/util/rlp-compress/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } elastic-array = "0.10" lazy_static = "1.0" diff --git a/util/rlp-derive/Cargo.toml b/util/rlp-derive/Cargo.toml index c107d13a49c..1d0e3db49ab 100644 --- a/util/rlp-derive/Cargo.toml +++ b/util/rlp-derive/Cargo.toml @@ -13,4 +13,4 @@ quote = "0.6" proc-macro2 = "0.4" [dev-dependencies] -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index c5fce9ed34c..6a4d2c90ba5 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -7,5 +7,5 @@ license = "GPL-3.0" [dependencies] triehash = { version = "0.4.0", default-features = false } -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } keccak-hasher = { path = "../keccak-hasher" } diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 5e276a163a0..209caec07af 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -23,7 +23,7 @@ goerli = { forkBlock = 0, critical = false } [dependencies] parity-bytes = "0.1" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } target_info = "0.1" [build-dependencies] diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index 39cf83857f8..47d387c7d3a 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -7,7 +7,7 @@ description = "Whisper Protocol implementation for Parity" [dependencies] bitflags = "0.9" byteorder = "1.0.0" -ethereum-types = "0.5.2" +ethereum-types = { git = "https://github.com/ordian/parity-common" } ethcore-network = { path = "../util/network" } ring = "0.14.6" ethkey = { path = "../accounts/ethkey" } @@ -18,7 +18,7 @@ ordered-float = "0.5" parking_lot = "0.7" rand = "0.6" rand_xorshift = "0.1.1" -rlp = { version = "0.3.0", default-features = false } +rlp = { git = "https://github.com/ordian/parity-common" } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" From 1de36351b4a1f558003a2d0000785969b12422a5 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 21 May 2019 12:00:11 +0200 Subject: [PATCH 27/90] [ethcore-private-tx] fix compilation errors --- ethcore/private-tx/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethcore/private-tx/src/lib.rs b/ethcore/private-tx/src/lib.rs index 181ca905126..b5d36d35967 100644 --- a/ethcore/private-tx/src/lib.rs +++ b/ethcore/private-tx/src/lib.rs @@ -622,8 +622,8 @@ impl Provider { v[31] = s.v(); v }).collect::>(), - signatures.iter().map(|s| s.r()).collect::>(), - signatures.iter().map(|s| s.s()).collect::>() + signatures.iter().map(|s| H256::from_slice(s.r())).collect::>(), + signatures.iter().map(|s| H256::from_slice(s.s())).collect::>(), ) } From 73c2c713ac139e7087042acd488bfc16c24d7297 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 22 May 2019 11:18:00 +0200 Subject: [PATCH 28/90] [parity-updater] fix compilation errors --- updater/src/updater.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updater/src/updater.rs b/updater/src/updater.rs index 072d0584af4..ce68fc8171f 100644 --- a/updater/src/updater.rs +++ b/updater/src/updater.rs @@ -159,7 +159,7 @@ pub struct Updater Date: Wed, 22 May 2019 12:22:28 +0200 Subject: [PATCH 29/90] [parity-rpc] fix compilation errors --- rpc/src/v1/helpers/secretstore.rs | 9 ++++++--- rpc/src/v1/impls/eth.rs | 8 ++++---- rpc/src/v1/impls/personal.rs | 2 +- rpc/src/v1/impls/signer.rs | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/rpc/src/v1/helpers/secretstore.rs b/rpc/src/v1/helpers/secretstore.rs index 6e1cbca45de..de563c9ab14 100644 --- a/rpc/src/v1/helpers/secretstore.rs +++ b/rpc/src/v1/helpers/secretstore.rs @@ -37,8 +37,11 @@ pub fn generate_document_key(account_public: Public, server_key_public: Public) let (common_point, encrypted_point) = encrypt_secret(document_key.public(), &server_key_public)?; // ..and now encrypt document key with account public - let encrypted_key = ethkey::crypto::ecies::encrypt(&account_public, &crypto::DEFAULT_MAC, document_key.public()) - .map_err(errors::encryption)?; + let encrypted_key = ethkey::crypto::ecies::encrypt( + &account_public, + &crypto::DEFAULT_MAC, + document_key.public().as_bytes(), + ).map_err(errors::encryption)?; Ok(EncryptedDocumentKey { common_point: common_point.into(), @@ -87,7 +90,7 @@ pub fn decrypt_document(key: Bytes, mut encrypted_document: Bytes) -> Result, encrypted_document: Bytes) -> Result { let key = decrypt_with_shadow_coefficients(decrypted_secret, common_point, shadows)?; - decrypt_document(key.to_vec(), encrypted_document) + decrypt_document(key.as_bytes().to_vec(), encrypted_document) } /// Calculate Keccak(ordered servers set) diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index a24d49d50a0..6dea547a2d0 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::{Address, H64, H160, H256, U64, U256}; +use ethereum_types::{Address, H64, H160, H256, U64, U256, BigEndianHash}; use parking_lot::Mutex; use ethash::{self, SeedHashCompute}; @@ -611,8 +611,8 @@ impl Eth for EthClient< let key2: H256 = storage_index; self.client.prove_storage(key1, keccak(key2), id) .map(|(storage_proof, storage_value)| StorageProof { - key: key2.into(), - value: storage_value.into(), + key: key2.into_uint(), + value: storage_value.into_uint(), proof: storage_proof.into_iter().map(Bytes::new).collect() }) }) @@ -628,7 +628,7 @@ impl Eth for EthClient< let num = num.unwrap_or_default(); try_bf!(check_known(&*self.client, num.clone())); - let res = match self.client.storage_at(&address, &H256::from(position), self.get_state(num)) { + let res = match self.client.storage_at(&address, &BigEndianHash::from_uint(&position), self.get_state(num)) { Some(s) => Ok(s), None => Err(errors::state_pruned()), }; diff --git a/rpc/src/v1/impls/personal.rs b/rpc/src/v1/impls/personal.rs index b6af1f81e5a..e0d6a97fe28 100644 --- a/rpc/src/v1/impls/personal.rs +++ b/rpc/src/v1/impls/personal.rs @@ -223,7 +223,7 @@ impl Personal for PersonalClient { fn ec_recover(&self, data: RpcBytes, signature: H520) -> BoxFuture { let signature: H520 = signature.into(); - let signature = Signature::from_electrum(&signature); + let signature = Signature::from_electrum(signature.as_bytes()); let data: Bytes = data.into(); let hash = eth_data_hash(data); diff --git a/rpc/src/v1/impls/signer.rs b/rpc/src/v1/impls/signer.rs index 4edac1144a4..3672f3c4c66 100644 --- a/rpc/src/v1/impls/signer.rs +++ b/rpc/src/v1/impls/signer.rs @@ -18,7 +18,7 @@ use std::sync::Arc; -use ethereum_types::U256; +use ethereum_types::{U256, H520}; use ethkey; use parity_runtime::Executor; use parking_lot::Mutex; @@ -218,7 +218,7 @@ impl Signer for SignerClient { let expected_hash = eth_data_hash(data); let signature = ethkey::Signature::from_electrum(&bytes.0); match ethkey::verify_address(&address, &signature, &expected_hash) { - Ok(true) => Ok(ConfirmationResponse::Signature(bytes.0.as_slice().into())), + Ok(true) => Ok(ConfirmationResponse::Signature(H520::from_slice(bytes.0.as_slice()))), Ok(false) => Err(errors::invalid_params("Sender address does not match the signature.", ())), Err(err) => Err(errors::invalid_params("Invalid signature received.", err)), } @@ -226,7 +226,7 @@ impl Signer for SignerClient { ConfirmationPayload::SignMessage(address, hash) => { let signature = ethkey::Signature::from_electrum(&bytes.0); match ethkey::verify_address(&address, &signature, &hash) { - Ok(true) => Ok(ConfirmationResponse::Signature(bytes.0.as_slice().into())), + Ok(true) => Ok(ConfirmationResponse::Signature(H520::from_slice(bytes.0.as_slice()))), Ok(false) => Err(errors::invalid_params("Sender address does not match the signature.", ())), Err(err) => Err(errors::invalid_params("Invalid signature received.", err)), } From 8e504a09015dfb2342b593640e8be4163c9fcc8b Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 22 May 2019 12:27:07 +0200 Subject: [PATCH 30/90] [parity-bin] fix other compilation errors --- parity/account_utils.rs | 5 +++-- parity/configuration.rs | 2 +- parity/helpers.rs | 11 ++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/parity/account_utils.rs b/parity/account_utils.rs index 6c11ae23b34..dc6f26e9344 100644 --- a/parity/account_utils.rs +++ b/parity/account_utils.rs @@ -61,6 +61,8 @@ mod accounts { mod accounts { use super::*; use upgrade::upgrade_key_location; + use ethereum_types::H160; + use std::str::FromStr; pub use accounts::AccountProvider; @@ -83,7 +85,7 @@ mod accounts { blacklisted_accounts: match *spec { SpecType::Morden | SpecType::Ropsten | SpecType::Kovan | SpecType::Sokol | SpecType::Dev => vec![], _ => vec![ - "00a329c0648769a73afac7f9381e08fb43dbea72".into() + H160::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").expect("the string is valid hex; qed"), ], }, }; @@ -241,4 +243,3 @@ pub use self::accounts::{ private_tx_signer, accounts_list, }; - diff --git a/parity/configuration.rs b/parity/configuration.rs index 2f0c9df2cf3..7bb46341829 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -743,7 +743,7 @@ impl Configuration { ret.listen_address = Some(format!("{}", listen)); ret.public_address = public.map(|p| format!("{}", p)); ret.use_secret = match self.args.arg_node_key.as_ref() - .map(|s| s.parse::().or_else(|_| Secret::from_unsafe_slice(&keccak(s))).map_err(|e| format!("Invalid key: {:?}", e)) + .map(|s| s.parse::().or_else(|_| Secret::from_unsafe_slice(keccak(s).as_bytes())).map_err(|e| format!("Invalid key: {:?}", e)) ) { None => None, Some(Ok(key)) => Some(key), diff --git a/parity/helpers.rs b/parity/helpers.rs index b68d854d1a9..aa2187fb60b 100644 --- a/parity/helpers.rs +++ b/parity/helpers.rs @@ -19,7 +19,7 @@ use std::io::{Write, BufReader, BufRead}; use std::time::Duration; use std::fs::File; use std::collections::HashSet; -use ethereum_types::{U256, clean_0x, Address}; +use ethereum_types::{U256, Address}; use journaldb::Algorithm; use ethcore::client::{Mode, BlockId, VMType, DatabaseCompactionProfile, ClientConfig, VerifierType}; use ethcore::miner::{PendingSet, Penalization}; @@ -37,6 +37,15 @@ pub fn to_duration(s: &str) -> Result { to_seconds(s).map(Duration::from_secs) } +// TODO: should we bring it back to ethereum-types? +fn clean_0x(s: &str) -> &str { + if s.starts_with("0x") { + &s[2..] + } else { + s + } +} + fn to_seconds(s: &str) -> Result { let bad = |_| { format!("{}: Invalid duration given. See parity --help for more information.", s) From 82dc3ebe050800d3b8de835b384d4935dd546d35 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 23 May 2019 13:11:10 +0200 Subject: [PATCH 31/90] update to new ethereum-types --- Cargo.lock | 20 ++++++++++---------- rpc/src/v1/extractors.rs | 6 +++--- rpc/src/v1/impls/eth.rs | 2 +- updater/src/updater.rs | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6725ee00c1..9bfb63019ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -681,7 +681,7 @@ dependencies = [ [[package]] name = "ethbloom" version = "0.6.4" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1159,7 +1159,7 @@ dependencies = [ [[package]] name = "ethereum-types" version = "0.6.0" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1377,7 +1377,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1692,7 +1692,7 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", ] @@ -1700,7 +1700,7 @@ dependencies = [ [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1952,7 +1952,7 @@ dependencies = [ [[package]] name = "keccak-hash" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3063,7 +3063,7 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.3.0" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", @@ -3393,7 +3393,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.4.0" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4145,7 +4145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uint" version = "0.7.1" -source = "git+https://github.com/ordian/parity-common#2ac84ff6bfc53a753d78658f7d41a501c466a9c8" +source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/rpc/src/v1/extractors.rs b/rpc/src/v1/extractors.rs index d3384c2c1d1..6b880b754b6 100644 --- a/rpc/src/v1/extractors.rs +++ b/rpc/src/v1/extractors.rs @@ -52,7 +52,7 @@ impl HttpMetaExtractor for RpcExtractor { impl ipc::MetaExtractor for RpcExtractor { fn extract(&self, req: &ipc::RequestContext) -> Metadata { Metadata { - origin: Origin::Ipc(req.session_id.into()), + origin: Origin::Ipc(H256::from_low_u64_be(req.session_id)), session: Some(Arc::new(Session::new(req.sender.clone()))), } } @@ -81,10 +81,10 @@ impl ws::MetaExtractor for WsExtractor { let authorization = req.protocols.get(0).and_then(|p| auth_token_hash(&path, p, true)); match authorization { Some(id) => Origin::Signer { session: id }, - None => Origin::Ws { session: id.into() }, + None => Origin::Ws { session: H256::from_low_u64_be(id) }, } }, - None => Origin::Ws { session: id.into() }, + None => Origin::Ws { session: H256::from_low_u64_be(id) }, }; let session = Some(Arc::new(Session::new(req.sender()))); Metadata { diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index 6dea547a2d0..f630a8fc4cf 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -533,7 +533,7 @@ impl Eth for EthClient< fn author(&self) -> Result { let miner = self.miner.authoring_params().author; - if miner == 0.into() { + if miner.is_zero() { (self.accounts)() .first() .cloned() diff --git a/updater/src/updater.rs b/updater/src/updater.rs index ce68fc8171f..6badfa436aa 100644 --- a/updater/src/updater.rs +++ b/updater/src/updater.rs @@ -28,7 +28,7 @@ use target_info::Target; use common_types::BlockNumber; use common_types::filter::Filter; use ethcore::client::{BlockId, BlockChainClient, ChainNotify, NewBlocks}; -use ethereum_types::H256; +use ethereum_types::{H256, H160}; use hash_fetch::{self as fetch, HashFetch}; use parity_path::restrict_permissions_owner; use service::Service; @@ -373,7 +373,7 @@ impl Updater { VersionInfo { track: ReleaseTrack::Stable, version: Version::new(1, 3, 7), - hash: 0.into(), + hash: H160::zero(), } } else { VersionInfo::this() From 1db5897644b8ea55c41ec840f563939fe67b17c0 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 23 May 2019 13:32:15 +0200 Subject: [PATCH 32/90] update keccak-hash --- Cargo.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9bfb63019ef..5b8c3553cef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -681,7 +681,7 @@ dependencies = [ [[package]] name = "ethbloom" version = "0.6.4" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1159,7 +1159,7 @@ dependencies = [ [[package]] name = "ethereum-types" version = "0.6.0" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", @@ -1377,7 +1377,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1692,7 +1692,7 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", ] @@ -1700,7 +1700,7 @@ dependencies = [ [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1952,9 +1952,9 @@ dependencies = [ [[package]] name = "keccak-hash" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "primitive-types 0.3.0 (git+https://github.com/ordian/parity-common)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3063,7 +3063,7 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.3.0" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", @@ -3393,7 +3393,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.4.0" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4145,7 +4145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uint" version = "0.7.1" -source = "git+https://github.com/ordian/parity-common#b9af0852d06d1f8066fd226161ca14f103457ede" +source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", From a6089c8bc437567c6a849183e8351386a483e9a1 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 23 May 2019 16:34:22 +0200 Subject: [PATCH 33/90] [fastmap] fix compilation in tests --- util/fastmap/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/fastmap/src/lib.rs b/util/fastmap/src/lib.rs index 97f7d3b24e7..97c69e7644e 100644 --- a/util/fastmap/src/lib.rs +++ b/util/fastmap/src/lib.rs @@ -36,6 +36,6 @@ mod tests { #[test] fn test_works() { let mut h = H256FastMap::default(); - h.insert(H256::from(123), "abc"); + h.insert(H256::from_low_u64_be(123), "abc"); } } From 1ccc757cd14db601fae0bcc4196aa4eea433e0ec Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 12:00:15 +0200 Subject: [PATCH 34/90] [blooms-db] fix compilation in tests --- util/blooms-db/src/db.rs | 51 ++++++++++++++++++++++++-------------- util/blooms-db/src/file.rs | 4 +-- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/util/blooms-db/src/db.rs b/util/blooms-db/src/db.rs index 7d003f7e27c..7a423d81dbd 100644 --- a/util/blooms-db/src/db.rs +++ b/util/blooms-db/src/db.rs @@ -303,27 +303,32 @@ mod tests { fn test_database() { let tempdir = TempDir::new("").unwrap(); let mut database = Database::open(tempdir.path()).unwrap(); - database.insert_blooms(0, vec![Bloom::from(0), Bloom::from(0x01), Bloom::from(0x10), Bloom::from(0x11)].iter()).unwrap(); - - let matches = database.iterate_matching(0, 3, Some(&Bloom::from(0))).unwrap().collect::, _>>().unwrap(); + database.insert_blooms(0, vec![ + Bloom::from_low_u64_be(0), + Bloom::from_low_u64_be(0x01), + Bloom::from_low_u64_be(0x10), + Bloom::from_low_u64_be(0x11), + ].iter()).unwrap(); + + let matches = database.iterate_matching(0, 3, Some(&Bloom::zero())).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![0, 1, 2, 3]); - let matches = database.iterate_matching(0, 4, Some(&Bloom::from(0))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(0, 4, Some(&Bloom::zero())).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![0, 1, 2, 3]); - let matches = database.iterate_matching(1, 3, Some(&Bloom::from(0))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(1, 3, Some(&Bloom::zero())).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![1, 2, 3]); - let matches = database.iterate_matching(1, 2, Some(&Bloom::from(0))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(1, 2, Some(&Bloom::zero())).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![1, 2]); - let matches = database.iterate_matching(0, 3, Some(&Bloom::from(0x01))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(0, 3, Some(&Bloom::from_low_u64_be(0x01))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![1, 3]); - let matches = database.iterate_matching(0, 3, Some(&Bloom::from(0x10))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(0, 3, Some(&Bloom::from_low_u64_be(0x10))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![2, 3]); - let matches = database.iterate_matching(2, 2, Some(&Bloom::from(0x10))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(2, 2, Some(&Bloom::from_low_u64_be(0x10))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![2]); } @@ -331,31 +336,41 @@ mod tests { fn test_database2() { let tempdir = TempDir::new("").unwrap(); let mut database = Database::open(tempdir.path()).unwrap(); - database.insert_blooms(254, vec![Bloom::from(0x100), Bloom::from(0x01), Bloom::from(0x10), Bloom::from(0x11)].iter()).unwrap(); - - let matches = database.iterate_matching(0, 257, Some(&Bloom::from(0x01))).unwrap().collect::, _>>().unwrap(); + database.insert_blooms(254, vec![ + Bloom::from_low_u64_be(0x100), + Bloom::from_low_u64_be(0x01), + Bloom::from_low_u64_be(0x10), + Bloom::from_low_u64_be(0x11), + ].iter()).unwrap(); + + let matches = database.iterate_matching(0, 257, Some(&Bloom::from_low_u64_be(0x01))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![255, 257]); - let matches = database.iterate_matching(0, 258, Some(&Bloom::from(0x100))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(0, 258, Some(&Bloom::from_low_u64_be(0x100))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![254]); - let matches = database.iterate_matching(0, 256, Some(&Bloom::from(0x01))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(0, 256, Some(&Bloom::from_low_u64_be(0x01))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![255]); - let matches = database.iterate_matching(255, 255, Some(&Bloom::from(0x01))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(255, 255, Some(&Bloom::from_low_u64_be(0x01))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![255]); - let matches = database.iterate_matching(256, 256, Some(&Bloom::from(0x10))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(256, 256, Some(&Bloom::from_low_u64_be(0x10))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![256]); - let matches = database.iterate_matching(256, 257, Some(&Bloom::from(0x10))).unwrap().collect::, _>>().unwrap(); + let matches = database.iterate_matching(256, 257, Some(&Bloom::from_low_u64_be(0x10))).unwrap().collect::, _>>().unwrap(); assert_eq!(matches, vec![256, 257]); } #[test] fn test_db_close() { let tempdir = TempDir::new("").unwrap(); - let blooms = vec![Bloom::from(0x100), Bloom::from(0x01), Bloom::from(0x10), Bloom::from(0x11)]; + let blooms = vec![ + Bloom::from_low_u64_be(0x100), + Bloom::from_low_u64_be(0x01), + Bloom::from_low_u64_be(0x10), + Bloom::from_low_u64_be(0x11), + ]; let mut database = Database::open(tempdir.path()).unwrap(); // Close the DB and ensure inserting blooms errors diff --git a/util/blooms-db/src/file.rs b/util/blooms-db/src/file.rs index e0693af24a1..65644724361 100644 --- a/util/blooms-db/src/file.rs +++ b/util/blooms-db/src/file.rs @@ -146,9 +146,9 @@ mod tests { fn test_file() { let tempdir = TempDir::new("").unwrap(); let mut file = File::open(tempdir.path().join("file")).unwrap(); - file.accrue_bloom(0, &Bloom::from(1)).unwrap(); + file.accrue_bloom(0, &Bloom::from_low_u64_be(1)).unwrap(); file.flush().unwrap(); - assert_eq!(file.read_bloom(0).unwrap(), Bloom::from(1)); + assert_eq!(file.read_bloom(0).unwrap(), Bloom::from_low_u64_be(1)); } } From d501445bf697de2d72786dc0cf10e1d6a2f3c656 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 12:17:31 +0200 Subject: [PATCH 35/90] [common-types] fix compilation in tests --- ethcore/types/src/filter.rs | 59 ++++++++++---------- ethcore/types/src/receipt.rs | 11 ++-- ethcore/types/src/transaction/transaction.rs | 19 ++++--- ethcore/types/src/views/block.rs | 5 +- ethcore/types/src/views/header.rs | 17 +++--- 5 files changed, 58 insertions(+), 53 deletions(-) diff --git a/ethcore/types/src/filter.rs b/ethcore/types/src/filter.rs index 2ab8f4473ed..86f679769bc 100644 --- a/ethcore/types/src/filter.rs +++ b/ethcore/types/src/filter.rs @@ -109,10 +109,11 @@ impl Filter { #[cfg(test)] mod tests { - use ethereum_types::Bloom; + use ethereum_types::{Bloom, Address, H256}; use filter::Filter; use ids::BlockId; use log_entry::LogEntry; + use std::str::FromStr; #[test] fn test_bloom_possibilities_none() { @@ -135,9 +136,9 @@ mod tests { let filter = Filter { from_block: BlockId::Earliest, to_block: BlockId::Latest, - address: Some(vec!["b372018f3be9e171df0581136b59d2faf73a7d5d".into()]), + address: Some(vec![Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5d").unwrap()]), topics: vec![ - Some(vec!["ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into()]), + Some(vec![H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap()]), None, None, None, @@ -146,7 +147,7 @@ mod tests { }; let possibilities = filter.bloom_possibilities(); - assert_eq!(possibilities, vec!["00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000".into()] as Vec); + assert_eq!(possibilities, vec![Bloom::from_str("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000").unwrap()]); } #[test] @@ -154,10 +155,10 @@ mod tests { let filter = Filter { from_block: BlockId::Earliest, to_block: BlockId::Latest, - address: Some(vec!["b372018f3be9e171df0581136b59d2faf73a7d5d".into()]), + address: Some(vec![Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5d").unwrap()]), topics: vec![ - Some(vec!["ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into()]), - Some(vec!["ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into()]), + Some(vec![H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap()]), + Some(vec![H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap()]), None, None, ], @@ -165,7 +166,7 @@ mod tests { }; let possibilities = filter.bloom_possibilities(); - assert_eq!(possibilities, vec!["00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000".into()] as Vec); + assert_eq!(possibilities, vec![Bloom::from_str("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000").unwrap()]); } #[test] @@ -174,19 +175,19 @@ mod tests { from_block: BlockId::Earliest, to_block: BlockId::Latest, address: Some(vec![ - "b372018f3be9e171df0581136b59d2faf73a7d5d".into(), - "b372018f3be9e171df0581136b59d2faf73a7d5d".into(), + Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5d").unwrap(), + Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5d").unwrap(), ]), topics: vec![ Some(vec![ - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into(), - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into() + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap() ]), Some(vec![ - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into(), - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into() + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap() ]), - Some(vec!["ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into()]), + Some(vec![H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap()]), None ], limit: None, @@ -195,7 +196,7 @@ mod tests { // number of possibilites should be equal 2 * 2 * 2 * 1 = 8 let possibilities = filter.bloom_possibilities(); assert_eq!(possibilities.len(), 8); - assert_eq!(possibilities[0], Bloom::from("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000")); + assert_eq!(possibilities[0], Bloom::from_str("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000").unwrap()); } #[test] @@ -203,10 +204,10 @@ mod tests { let filter = Filter { from_block: BlockId::Earliest, to_block: BlockId::Latest, - address: Some(vec!["b372018f3be9e171df0581136b59d2faf73a7d5d".into()]), + address: Some(vec![Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5d").unwrap()]), topics: vec![ - Some(vec!["ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into()]), - Some(vec!["ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23fa".into()]), + Some(vec![H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap()]), + Some(vec![H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23fa").unwrap()]), None, None, ], @@ -214,29 +215,29 @@ mod tests { }; let entry0 = LogEntry { - address: "b372018f3be9e171df0581136b59d2faf73a7d5d".into(), + address: Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5d").unwrap(), topics: vec![ - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into(), - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23fa".into(), - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23fa").unwrap(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap(), ], data: vec![] }; let entry1 = LogEntry { - address: "b372018f3be9e171df0581136b59d2faf73a7d5e".into(), + address: Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5e").unwrap(), topics: vec![ - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into(), - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23fa".into(), - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23fa").unwrap(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap(), ], data: vec![] }; let entry2 = LogEntry { - address: "b372018f3be9e171df0581136b59d2faf73a7d5d".into(), + address: Address::from_str("b372018f3be9e171df0581136b59d2faf73a7d5d").unwrap(), topics: vec![ - "ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9".into(), + H256::from_str("ff74e91598aed6ae5d2fdcf8b24cd2c7be49a0808112a305069355b7160f23f9").unwrap(), ], data: vec![] }; diff --git a/ethcore/types/src/receipt.rs b/ethcore/types/src/receipt.rs index aedb208a78b..797eea81680 100644 --- a/ethcore/types/src/receipt.rs +++ b/ethcore/types/src/receipt.rs @@ -168,8 +168,9 @@ pub struct LocalizedReceipt { #[cfg(test)] mod tests { - use super::{Receipt, TransactionOutcome}; + use super::{Receipt, TransactionOutcome, Address, H256}; use log_entry::LogEntry; + use std::str::FromStr; #[test] fn test_no_state_root() { @@ -178,7 +179,7 @@ mod tests { TransactionOutcome::Unknown, 0x40cae.into(), vec![LogEntry { - address: "dcf421d093428b096ca501a7cd1a740855a7976f".into(), + address: Address::from_str("dcf421d093428b096ca501a7cd1a740855a7976f").unwrap(), topics: vec![], data: vec![0u8; 32] }] @@ -190,10 +191,10 @@ mod tests { fn test_basic() { let expected = ::rustc_hex::FromHex::from_hex("f90162a02f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee83040caeb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000f838f794dcf421d093428b096ca501a7cd1a740855a7976fc0a00000000000000000000000000000000000000000000000000000000000000000").unwrap(); let r = Receipt::new( - TransactionOutcome::StateRoot("2f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee".into()), + TransactionOutcome::StateRoot(H256::from_str("2f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee").unwrap()), 0x40cae.into(), vec![LogEntry { - address: "dcf421d093428b096ca501a7cd1a740855a7976f".into(), + address: Address::from_str("dcf421d093428b096ca501a7cd1a740855a7976f").unwrap(), topics: vec![], data: vec![0u8; 32] }] @@ -211,7 +212,7 @@ mod tests { TransactionOutcome::StatusCode(0), 0x40cae.into(), vec![LogEntry { - address: "dcf421d093428b096ca501a7cd1a740855a7976f".into(), + address: Address::from_str("dcf421d093428b096ca501a7cd1a740855a7976f").unwrap(), topics: vec![], data: vec![0u8; 32] }] diff --git a/ethcore/types/src/transaction/transaction.rs b/ethcore/types/src/transaction/transaction.rs index 86f311960ab..f17bdccfb4c 100644 --- a/ethcore/types/src/transaction/transaction.rs +++ b/ethcore/types/src/transaction/transaction.rs @@ -219,7 +219,7 @@ impl Transaction { r: U256::one(), s: U256::one(), v: 0, - hash: 0.into(), + hash: H256::zero(), }.compute_hash() } @@ -231,7 +231,7 @@ impl Transaction { r: U256::one(), s: U256::one(), v: 0, - hash: H256::default(), + hash: H256::zero(), }.compute_hash(), sender: from, public: None, @@ -555,8 +555,9 @@ impl From for PendingTransaction { #[cfg(test)] mod tests { use super::*; - use ethereum_types::U256; + use ethereum_types::{U256, Address}; use hash::keccak; + use std::str::FromStr; #[test] fn sender_test() { @@ -567,10 +568,10 @@ mod tests { assert_eq!(t.gas_price, U256::from(0x01u64)); assert_eq!(t.nonce, U256::from(0x00u64)); if let Action::Call(ref to) = t.action { - assert_eq!(*to, "095e7baea6a6c7c4c2dfeb977efac326af552d87".into()); + assert_eq!(*to, Address::from_str("095e7baea6a6c7c4c2dfeb977efac326af552d87").unwrap()); } else { panic!(); } assert_eq!(t.value, U256::from(0x0au64)); - assert_eq!(public_to_address(&t.recover_public().unwrap()), "0f65fe9276bc9a24ae7083ae28e2660ef72df99e".into()); + assert_eq!(public_to_address(&t.recover_public().unwrap()), Address::from_str("0f65fe9276bc9a24ae7083ae28e2660ef72df99e").unwrap()); assert_eq!(t.chain_id(), None); } @@ -621,12 +622,12 @@ mod tests { gas: U256::from(50_000), value: U256::from(1), data: b"Hello!".to_vec() - }.fake_sign(Address::from(0x69)); - assert_eq!(Address::from(0x69), t.sender()); + }.fake_sign(Address::from_low_u64_be(0x69)); + assert_eq!(Address::from_low_u64_be(0x69), t.sender()); assert_eq!(t.chain_id(), None); let t = t.clone(); - assert_eq!(Address::from(0x69), t.sender()); + assert_eq!(Address::from_low_u64_be(0x69), t.sender()); assert_eq!(t.chain_id(), None); } @@ -653,7 +654,7 @@ mod tests { let test_vector = |tx_data: &str, address: &'static str| { let signed = rlp::decode(&FromHex::from_hex(tx_data).unwrap()).expect("decoding tx data failed"); let signed = SignedTransaction::new(signed).unwrap(); - assert_eq!(signed.sender(), address.into()); + assert_eq!(signed.sender(), Address::from_str(address).unwrap()); println!("chainid: {:?}", signed.chain_id()); }; diff --git a/ethcore/types/src/views/block.rs b/ethcore/types/src/views/block.rs index 9ad67ddd66b..5909da7398e 100644 --- a/ethcore/types/src/views/block.rs +++ b/ethcore/types/src/views/block.rs @@ -177,7 +177,8 @@ impl<'a> BlockView<'a> { #[cfg(test)] mod tests { use rustc_hex::FromHex; - use super::BlockView; + use super::{BlockView, H256}; + use std::str::FromStr; #[test] fn test_block_view() { @@ -185,7 +186,7 @@ mod tests { let rlp = "f90261f901f9a0d405da4e66f1445d455195229624e133f5baafe72b5cf7b3c36c12c8146e98b7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a05fb2b4bfdef7b314451cb138a534d225c922fc0e5fbe25e451142732c3e25c25a088d2ec6b9860aae1a2c3b299f72b6a5d70d7f7ba4722c78f2c49ba96273c2158a007c6fdfa8eea7e86b81f5b0fc0f78f90cc19f4aa60d323151e0cac660199e9a1b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefba82524d84568e932a80a0a0349d8c3df71f1a48a9df7d03fd5f14aeee7d91332c009ecaff0a71ead405bd88ab4e252a7e8c2a23f862f86002018304cb2f94ec0e71ad0a90ffe1909d27dac207f7680abba42d01801ba03a347e72953c860f32b1eb2c78a680d8734b2ea08085d949d729479796f218d5a047ea6239d9e31ccac8af3366f5ca37184d26e7646e3191a3aeb81c4cf74de500c0".from_hex().unwrap(); let view = view!(BlockView, &rlp); - assert_eq!(view.hash(), "2c9747e804293bd3f1a986484343f23bc88fd5be75dfe9d5c2860aff61e6f259".into()); + assert_eq!(view.hash(), H256::from_str("2c9747e804293bd3f1a986484343f23bc88fd5be75dfe9d5c2860aff61e6f259").unwrap()); assert_eq!(view.transactions_count(), 1); assert_eq!(view.uncles_count(), 0); } diff --git a/ethcore/types/src/views/header.rs b/ethcore/types/src/views/header.rs index 4009892910f..eaf91f17919 100644 --- a/ethcore/types/src/views/header.rs +++ b/ethcore/types/src/views/header.rs @@ -120,8 +120,9 @@ impl<'a> HeaderView<'a> { #[cfg(test)] mod tests { use rustc_hex::FromHex; - use ethereum_types::Bloom; + use ethereum_types::{Bloom, H256, Address}; use super::HeaderView; + use std::str::FromStr; #[test] fn test_header_view() { @@ -131,13 +132,13 @@ mod tests { let nonce = "88ab4e252a7e8c2a23".from_hex().unwrap(); let view = view!(HeaderView, &rlp); - assert_eq!(view.hash(), "2c9747e804293bd3f1a986484343f23bc88fd5be75dfe9d5c2860aff61e6f259".into()); - assert_eq!(view.parent_hash(), "d405da4e66f1445d455195229624e133f5baafe72b5cf7b3c36c12c8146e98b7".into()); - assert_eq!(view.uncles_hash(), "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347".into()); - assert_eq!(view.author(), "8888f1f195afa192cfee860698584c030f4c9db1".into()); - assert_eq!(view.state_root(), "5fb2b4bfdef7b314451cb138a534d225c922fc0e5fbe25e451142732c3e25c25".into()); - assert_eq!(view.transactions_root(), "88d2ec6b9860aae1a2c3b299f72b6a5d70d7f7ba4722c78f2c49ba96273c2158".into()); - assert_eq!(view.receipts_root(), "07c6fdfa8eea7e86b81f5b0fc0f78f90cc19f4aa60d323151e0cac660199e9a1".into()); + assert_eq!(view.hash(), H256::from_str("2c9747e804293bd3f1a986484343f23bc88fd5be75dfe9d5c2860aff61e6f259").unwrap()); + assert_eq!(view.parent_hash(), H256::from_str("d405da4e66f1445d455195229624e133f5baafe72b5cf7b3c36c12c8146e98b7").unwrap()); + assert_eq!(view.uncles_hash(), H256::from_str("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347").unwrap()); + assert_eq!(view.author(), Address::from_str("8888f1f195afa192cfee860698584c030f4c9db1").unwrap()); + assert_eq!(view.state_root(), H256::from_str("5fb2b4bfdef7b314451cb138a534d225c922fc0e5fbe25e451142732c3e25c25").unwrap()); + assert_eq!(view.transactions_root(), H256::from_str("88d2ec6b9860aae1a2c3b299f72b6a5d70d7f7ba4722c78f2c49ba96273c2158").unwrap()); + assert_eq!(view.receipts_root(), H256::from_str("07c6fdfa8eea7e86b81f5b0fc0f78f90cc19f4aa60d323151e0cac660199e9a1").unwrap()); assert_eq!(view.log_bloom(), Bloom::default()); assert_eq!(view.difficulty(), 0x020080.into()); assert_eq!(view.number(), 3); From eae4a6480ba127052efb8010f1409e390b3ee826 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 12:20:02 +0200 Subject: [PATCH 36/90] [triehash-ethereum] fix compilation in tests --- util/triehash-ethereum/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/triehash-ethereum/src/lib.rs b/util/triehash-ethereum/src/lib.rs index 696ed61aba7..27cc2b323e4 100644 --- a/util/triehash-ethereum/src/lib.rs +++ b/util/triehash-ethereum/src/lib.rs @@ -54,15 +54,16 @@ where #[cfg(test)] mod tests { - use super::{trie_root, sec_trie_root, ordered_trie_root}; + use super::{trie_root, sec_trie_root, ordered_trie_root, H256}; use triehash; use keccak_hasher::KeccakHasher; + use std::str::FromStr; #[test] fn simple_test() { assert_eq!(trie_root(vec![ (b"A", b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" as &[u8]) - ]), "d23786fb4a010da3ce639d66d5e904a11dbc02746d1ce25029e53290cabf28ab".into()); + ]), H256::from_str("d23786fb4a010da3ce639d66d5e904a11dbc02746d1ce25029e53290cabf28ab").unwrap()); } #[test] From dbb0b50fbd2eac2872f555ce05704c33db8131df Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 12:28:31 +0200 Subject: [PATCH 37/90] [ethkey] fix compilation in tests --- accounts/ethkey/src/brain_prefix.rs | 2 +- accounts/ethkey/src/extended.rs | 45 ++++++++++++++++++++--------- accounts/ethkey/src/prefix.rs | 2 +- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/accounts/ethkey/src/brain_prefix.rs b/accounts/ethkey/src/brain_prefix.rs index e6c5cb74bca..436a6594f62 100644 --- a/accounts/ethkey/src/brain_prefix.rs +++ b/accounts/ethkey/src/brain_prefix.rs @@ -65,6 +65,6 @@ mod tests { fn prefix_generator() { let prefix = vec![0x00u8]; let keypair = BrainPrefix::new(prefix.clone(), usize::max_value(), 12).generate().unwrap(); - assert!(keypair.address().starts_with(&prefix)); + assert!(keypair.address().as_bytes().starts_with(&prefix)); } } diff --git a/accounts/ethkey/src/extended.rs b/accounts/ethkey/src/extended.rs index 9f382f89ed8..e534d04d583 100644 --- a/accounts/ethkey/src/extended.rs +++ b/accounts/ethkey/src/extended.rs @@ -379,12 +379,13 @@ mod tests { use super::{ExtendedSecret, ExtendedPublic, ExtendedKeyPair}; use secret::Secret; use std::str::FromStr; - use ethereum_types::{H128, H256}; + use ethereum_types::{H128, H256, H512}; use super::{derivation, Derivation}; fn master_chain_basic() -> (H256, H256) { let seed = H128::from_str("000102030405060708090a0b0c0d0e0f") .expect("Seed should be valid H128") + .as_bytes() .to_vec(); derivation::seed_pair(&*seed) @@ -400,27 +401,39 @@ mod tests { #[test] fn smoky() { let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(); - let extended_secret = ExtendedSecret::with_code(secret.clone(), 0u64.into()); + let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::zero()); // hardened assert_eq!(&**extended_secret.as_raw(), &*secret); - assert_eq!(&**extended_secret.derive(2147483648.into()).as_raw(), &"0927453daed47839608e414a3738dfad10aed17c459bbd9ab53f89b026c834b6".into()); - assert_eq!(&**extended_secret.derive(2147483649.into()).as_raw(), &"44238b6a29c6dcbe9b401364141ba11e2198c289a5fed243a1c11af35c19dc0f".into()); + assert_eq!( + **extended_secret.derive(2147483648.into()).as_raw(), + H256::from_str("0927453daed47839608e414a3738dfad10aed17c459bbd9ab53f89b026c834b6").unwrap(), + ); + assert_eq!( + **extended_secret.derive(2147483649.into()).as_raw(), + H256::from_str("44238b6a29c6dcbe9b401364141ba11e2198c289a5fed243a1c11af35c19dc0f").unwrap(), + ); // normal - assert_eq!(&**extended_secret.derive(0.into()).as_raw(), &"bf6a74e3f7b36fc4c96a1e12f31abc817f9f5904f5a8fc27713163d1f0b713f6".into()); - assert_eq!(&**extended_secret.derive(1.into()).as_raw(), &"bd4fca9eb1f9c201e9448c1eecd66e302d68d4d313ce895b8c134f512205c1bc".into()); - assert_eq!(&**extended_secret.derive(2.into()).as_raw(), &"86932b542d6cab4d9c65490c7ef502d89ecc0e2a5f4852157649e3251e2a3268".into()); + assert_eq!(**extended_secret.derive(0.into()).as_raw(), H256::from_str("bf6a74e3f7b36fc4c96a1e12f31abc817f9f5904f5a8fc27713163d1f0b713f6").unwrap()); + assert_eq!(**extended_secret.derive(1.into()).as_raw(), H256::from_str("bd4fca9eb1f9c201e9448c1eecd66e302d68d4d313ce895b8c134f512205c1bc").unwrap()); + assert_eq!(**extended_secret.derive(2.into()).as_raw(), H256::from_str("86932b542d6cab4d9c65490c7ef502d89ecc0e2a5f4852157649e3251e2a3268").unwrap()); let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created"); let derived_public = extended_public.derive(0.into()).expect("First derivation of public should succeed"); - assert_eq!(&*derived_public.public(), &"f7b3244c96688f92372bfd4def26dc4151529747bab9f188a4ad34e141d47bd66522ff048bc6f19a0a4429b04318b1a8796c000265b4fa200dae5f6dda92dd94".into()); + assert_eq!( + *derived_public.public(), + H512::from_str("f7b3244c96688f92372bfd4def26dc4151529747bab9f188a4ad34e141d47bd66522ff048bc6f19a0a4429b04318b1a8796c000265b4fa200dae5f6dda92dd94").unwrap(), + ); let keypair = ExtendedKeyPair::with_secret( Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(), - 064.into(), + H256::zero(), + ); + assert_eq!( + **keypair.derive(2147483648u32.into()).expect("Derivation of keypair should succeed").secret().as_raw(), + H256::from_str("edef54414c03196557cf73774bc97a645c9a1df2164ed34f0c2a78d1375a930c").unwrap(), ); - assert_eq!(&**keypair.derive(2147483648u32.into()).expect("Derivation of keypair should succeed").secret().as_raw(), &"edef54414c03196557cf73774bc97a645c9a1df2164ed34f0c2a78d1375a930c".into()); } #[test] @@ -428,7 +441,7 @@ mod tests { let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(); let derivation_secret = H256::from_str("51eaf04f9dbbc1417dc97e789edd0c37ecda88bac490434e367ea81b71b7b015").unwrap(); - let extended_secret = ExtendedSecret::with_code(secret.clone(), 0u64.into()); + let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::zero()); let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created"); let derived_secret0 = extended_secret.derive(Derivation::Soft(derivation_secret)); @@ -443,15 +456,18 @@ mod tests { fn h256_hard() { let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(); let derivation_secret = H256::from_str("51eaf04f9dbbc1417dc97e789edd0c37ecda88bac490434e367ea81b71b7b015").unwrap(); - let extended_secret = ExtendedSecret::with_code(secret.clone(), 1u64.into()); + let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::from_low_u64_be(1)); - assert_eq!(&**extended_secret.derive(Derivation::Hard(derivation_secret)).as_raw(), &"2bc2d696fb744d77ff813b4a1ef0ad64e1e5188b622c54ba917acc5ebc7c5486".into()); + assert_eq!( + **extended_secret.derive(Derivation::Hard(derivation_secret)).as_raw(), + H256::from_str("2bc2d696fb744d77ff813b4a1ef0ad64e1e5188b622c54ba917acc5ebc7c5486").unwrap(), + ); } #[test] fn match_() { let secret = Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(); - let extended_secret = ExtendedSecret::with_code(secret.clone(), 1.into()); + let extended_secret = ExtendedSecret::with_code(secret.clone(), H256::from_low_u64_be(1)); let extended_public = ExtendedPublic::from_secret(&extended_secret).expect("Extended public should be created"); let derived_secret0 = extended_secret.derive(0.into()); @@ -466,6 +482,7 @@ mod tests { fn test_seeds() { let seed = H128::from_str("000102030405060708090a0b0c0d0e0f") .expect("Seed should be valid H128") + .as_bytes() .to_vec(); // private key from bitcoin test vector diff --git a/accounts/ethkey/src/prefix.rs b/accounts/ethkey/src/prefix.rs index fe4f1692f60..32d92c1862c 100644 --- a/accounts/ethkey/src/prefix.rs +++ b/accounts/ethkey/src/prefix.rs @@ -54,6 +54,6 @@ mod tests { fn prefix_generator() { let prefix = vec![0xffu8]; let keypair = Prefix::new(prefix.clone(), usize::max_value()).generate().unwrap(); - assert!(keypair.address().starts_with(&prefix)); + assert!(keypair.address().as_bytes().starts_with(&prefix)); } } From 76438f775da619d02e2b3b5a298d10f772e773de Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 12:34:12 +0200 Subject: [PATCH 38/90] [pwasm-run-test] fix compilation errors --- ethcore/wasm/run/src/runner.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ethcore/wasm/run/src/runner.rs b/ethcore/wasm/run/src/runner.rs index a69fe6bf674..f43b4fa57f7 100644 --- a/ethcore/wasm/run/src/runner.rs +++ b/ethcore/wasm/run/src/runner.rs @@ -21,7 +21,7 @@ use vm::tests::FakeExt; use std::io::{self, Read}; use std::{fs, path, fmt}; use std::sync::Arc; -use ethereum_types::{U256, H256, H160}; +use ethereum_types::{U256, H256, H160, BigEndianHash}; use rustc_hex::ToHex; fn load_code>(p: P) -> io::Result> { @@ -95,17 +95,17 @@ impl fmt::Display for Fail { write!( f, "Storage key {} value mismatch, expected {}, got: {}", - key.to_vec().to_hex(), - expected.to_vec().to_hex(), - actual.to_vec().to_hex(), + key.as_bytes().to_vec().to_hex(), + expected.as_bytes().to_vec().to_hex(), + actual.as_bytes().to_vec().to_hex(), ), StorageMismatch { ref key, ref expected, actual: None} => write!( f, "No expected storage value for key {} found, expected {}", - key.to_vec().to_hex(), - expected.to_vec().to_hex(), + key.as_bytes().to_vec().to_hex(), + expected.as_bytes().to_vec().to_hex(), ), Nonconformity(SpecNonconformity::Address) => @@ -188,7 +188,7 @@ pub fn run_fixture(fixture: &Fixture) -> Vec { for storage_entry in storage.iter() { let key: U256 = storage_entry.key.into(); let val: U256 = storage_entry.value.into(); - ext.store.insert(key.into(), val.into()); + ext.store.insert(BigEndianHash::from_uint(&key), BigEndianHash::from_uint(&val)); } } From 9292132707e7d52e1d556e5bf07f7c867fbefe87 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 15:28:54 +0200 Subject: [PATCH 39/90] [wasm] fix compilation errors --- ethcore/wasm/src/tests.rs | 48 +++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/ethcore/wasm/src/tests.rs b/ethcore/wasm/src/tests.rs index 9ed7053da18..477d72314a2 100644 --- a/ethcore/wasm/src/tests.rs +++ b/ethcore/wasm/src/tests.rs @@ -16,8 +16,9 @@ use std::sync::Arc; use std::collections::HashMap; +use std::str::FromStr; use byteorder::{LittleEndian, ByteOrder}; -use ethereum_types::{H256, U256, Address}; +use ethereum_types::{H256, U256, Address, BigEndianHash as _}; use super::WasmInterpreter; use vm::{self, Exec, GasLeft, ActionParams, ActionValue, CreateContractAddress}; @@ -134,7 +135,10 @@ fn logger() { "Logger sets 0x03 key to the provided origin" ); assert_eq!( - U256::from(ext.store.get(&"0400000000000000000000000000000000000000000000000000000000000000".parse().unwrap()).expect("storage key to exist")), + ext.store + .get(&"0400000000000000000000000000000000000000000000000000000000000000".parse().unwrap()) + .expect("storage key to exist") + .into_uint(), U256::from(1_000_000_000), "Logger sets 0x04 key to the trasferred value" ); @@ -250,7 +254,7 @@ fn suicide() { params.code = Some(Arc::new(code)); let mut args = vec![127u8]; - args.extend(refund.to_vec()); + args.extend(refund.as_bytes().to_vec()); params.data = Some(args); let mut ext = FakeExt::new().with_wasm(); @@ -311,10 +315,13 @@ fn create() { code_address: None, } )); + let mut salt = [0u8; 32]; + salt[0] = 5; + let salt = H256::from_slice(salt.as_ref()); assert!(ext.calls.contains( &FakeCall { call_type: FakeCallType::Create, - create_scheme: Some(CreateContractAddress::FromSenderSaltAndCodeHash(H256::from([5u8].as_ref()))), + create_scheme: Some(CreateContractAddress::FromSenderSaltAndCodeHash(salt)), gas: U256::from(6039), sender_address: None, receive_address: None, @@ -572,7 +579,8 @@ fn storage_read() { params.gas = U256::from(100_000); params.code = Some(Arc::new(code)); let mut ext = FakeExt::new().with_wasm(); - ext.store.insert("0100000000000000000000000000000000000000000000000000000000000000".into(), address.into()); + let hash = H256::from_str("0100000000000000000000000000000000000000000000000000000000000000").unwrap(); + ext.store.insert(hash, address.into()); let (gas_left, result) = { let mut interpreter = wasm_interpreter(params); @@ -583,7 +591,7 @@ fn storage_read() { } }; - assert_eq!(Address::from(&result[12..32]), address); + assert_eq!(Address::from_slice(&result[12..32]), address); assert_eq!(gas_left, U256::from(98_369)); } @@ -609,7 +617,10 @@ fn keccak() { } }; - assert_eq!(H256::from_slice(&result), H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87")); + assert_eq!( + H256::from_slice(&result), + H256::from_str("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87").unwrap(), + ); assert_eq!(gas_left, U256::from(85_949)); } @@ -786,7 +797,7 @@ fn externs() { number: 0x9999999999u64.into(), author: "efefefefefefefefefefefefefefefefefefefef".parse().unwrap(), timestamp: 0x8888888888u64.into(), - difficulty: H256::from("0f1f2f3f4f5f6f7f8f9fafbfcfdfefff0d1d2d3d4d5d6d7d8d9dadbdcdddedfd").into(), + difficulty: U256::from_str("0f1f2f3f4f5f6f7f8f9fafbfcfdfefff0d1d2d3d4d5d6d7d8d9dadbdcdddedfd").unwrap(), gas_limit: 0x777777777777u64.into(), last_hashes: Default::default(), gas_used: 0.into(), @@ -795,11 +806,11 @@ fn externs() { let mut hashes = HashMap::new(); hashes.insert( U256::from(0), - H256::from("9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d") + H256::from_str("9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d").unwrap(), ); hashes.insert( U256::from(1), - H256::from("7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b") + H256::from_str("7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b").unwrap(), ); hashes } @@ -926,7 +937,10 @@ fn embedded_keccak() { } }; - assert_eq!(H256::from_slice(&result), H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87")); + assert_eq!( + H256::from_slice(&result), + H256::from_str("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87").unwrap(), + ); assert_eq!(gas_left, U256::from(85_949)); } @@ -957,9 +971,15 @@ fn events() { assert_eq!(ext.logs.len(), 1); let log_entry = &ext.logs[0]; assert_eq!(log_entry.topics.len(), 2); - assert_eq!(&log_entry.topics[0], &H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87")); - assert_eq!(&log_entry.topics[1], &H256::from("871d5ea37430753faab7dff7a7187783517d83bd822c02e28a164c887e1d3768")); - assert_eq!(&log_entry.data, b"gnihtemos"); + assert_eq!( + log_entry.topics[0], + H256::from_str("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87").unwrap(), + ); + assert_eq!( + log_entry.topics[1], + H256::from_str("871d5ea37430753faab7dff7a7187783517d83bd822c02e28a164c887e1d3768").unwrap(), + ); + assert_eq!(log_entry.data, b"gnihtemos"); assert_eq!(&result, b"gnihtemos"); assert_eq!(gas_left, U256::from(83_161)); From 6cfc144c96256d82f46094213c91b528eb79f686 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 15:55:17 +0200 Subject: [PATCH 40/90] [ethjson] fix compilation in tests --- json/src/hash.rs | 4 +-- json/src/spec/authority_round.rs | 6 ++++- json/src/spec/basic_authority.rs | 3 ++- json/src/spec/clique.rs | 2 -- json/src/spec/ethash.rs | 43 ++++++++++++++++---------------- json/src/spec/genesis.rs | 10 ++++---- json/src/spec/hardcoded_sync.rs | 5 ++-- json/src/spec/seal.rs | 11 ++++---- json/src/spec/validator_set.rs | 7 +++--- 9 files changed, 49 insertions(+), 42 deletions(-) diff --git a/json/src/hash.rs b/json/src/hash.rs index 6f20f6e46a5..3e364b950e2 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -104,13 +104,13 @@ mod test { let s = r#"["", "5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae"]"#; let deserialized: Vec = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, vec![ - H256(ethereum_types::H256::from(0)), + H256(ethereum_types::H256::zero()), H256(ethereum_types::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap()) ]); } #[test] fn hash_into() { - assert_eq!(ethereum_types::H256::from(0), H256(ethereum_types::H256::from(0)).into()); + assert_eq!(ethereum_types::H256::zero(), H256(ethereum_types::H256::zero()).into()); } } diff --git a/json/src/spec/authority_round.rs b/json/src/spec/authority_round.rs index 61936a5f9a2..fee6202d198 100644 --- a/json/src/spec/authority_round.rs +++ b/json/src/spec/authority_round.rs @@ -76,6 +76,7 @@ mod tests { use hash::Address; use spec::validator_set::ValidatorSet; use spec::authority_round::AuthorityRound; + use std::str::FromStr; #[test] fn authority_round_deserialization() { @@ -95,7 +96,10 @@ mod tests { let deserialized: AuthorityRound = serde_json::from_str(s).unwrap(); assert_eq!(deserialized.params.step_duration, Uint(U256::from(0x02))); - assert_eq!(deserialized.params.validators, ValidatorSet::List(vec![Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b"))])); + assert_eq!( + deserialized.params.validators, + ValidatorSet::List(vec![Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())]), + ); assert_eq!(deserialized.params.start_step, Some(Uint(U256::from(24)))); assert_eq!(deserialized.params.immediate_transitions, None); assert_eq!(deserialized.params.maximum_uncle_count_transition, Some(Uint(10_000_000.into()))); diff --git a/json/src/spec/basic_authority.rs b/json/src/spec/basic_authority.rs index 195b89bebb6..fc552b81a99 100644 --- a/json/src/spec/basic_authority.rs +++ b/json/src/spec/basic_authority.rs @@ -46,6 +46,7 @@ mod tests { use hash::Address; use spec::basic_authority::BasicAuthority; use spec::validator_set::ValidatorSet; + use std::str::FromStr; #[test] fn basic_authority_deserialization() { @@ -61,7 +62,7 @@ mod tests { let deserialized: BasicAuthority = serde_json::from_str(s).unwrap(); assert_eq!(deserialized.params.duration_limit, Uint(U256::from(0x0d))); - let vs = ValidatorSet::List(vec![Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b"))]); + let vs = ValidatorSet::List(vec![Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())]); assert_eq!(deserialized.params.validators, vs); } } diff --git a/json/src/spec/clique.rs b/json/src/spec/clique.rs index 64be9c569ac..cef0ebfb81a 100644 --- a/json/src/spec/clique.rs +++ b/json/src/spec/clique.rs @@ -37,8 +37,6 @@ pub struct Clique { #[cfg(test)] mod tests { use serde_json; - use uint::Uint; - use ethereum_types::U256; use super::*; #[test] diff --git a/json/src/spec/ethash.rs b/json/src/spec/ethash.rs index 6051ac90d8a..57048e96035 100644 --- a/json/src/spec/ethash.rs +++ b/json/src/spec/ethash.rs @@ -115,6 +115,7 @@ mod tests { use ethereum_types::{H160, U256}; use hash::Address; use spec::ethash::{Ethash, EthashParams, BlockReward}; + use std::str::FromStr; #[test] fn ethash_deserialization() { @@ -171,28 +172,28 @@ mod tests { block_reward_contract_code: None, block_reward_contract_transition: None, dao_hardfork_transition: Some(Uint(U256::from(0x08))), - dao_hardfork_beneficiary: Some(Address(H160::from("0xabcabcabcabcabcabcabcabcabcabcabcabcabca"))), + dao_hardfork_beneficiary: Some(Address(H160::from_str("0xabcabcabcabcabcabcabcabcabcabcabcabcabca").unwrap())), dao_hardfork_accounts: Some(vec![ - Address(H160::from("0x304a554a310c7e546dfe434669c62820b7d83490")), - Address(H160::from("0x914d1b8b43e92723e64fd0a06f5bdb8dd9b10c79")), - Address(H160::from("0xfe24cdd8648121a43a7c86d289be4dd2951ed49f")), - Address(H160::from("0x17802f43a0137c506ba92291391a8a8f207f487d")), - Address(H160::from("0xb136707642a4ea12fb4bae820f03d2562ebff487")), - Address(H160::from("0xdbe9b615a3ae8709af8b93336ce9b477e4ac0940")), - Address(H160::from("0xf14c14075d6c4ed84b86798af0956deef67365b5")), - Address(H160::from("0xca544e5c4687d109611d0f8f928b53a25af72448")), - Address(H160::from("0xaeeb8ff27288bdabc0fa5ebb731b6f409507516c")), - Address(H160::from("0xcbb9d3703e651b0d496cdefb8b92c25aeb2171f7")), - Address(H160::from("0xaccc230e8a6e5be9160b8cdf2864dd2a001c28b6")), - Address(H160::from("0x2b3455ec7fedf16e646268bf88846bd7a2319bb2")), - Address(H160::from("0x4613f3bca5c44ea06337a9e439fbc6d42e501d0a")), - Address(H160::from("0xd343b217de44030afaa275f54d31a9317c7f441e")), - Address(H160::from("0x84ef4b2357079cd7a7c69fd7a37cd0609a679106")), - Address(H160::from("0xda2fef9e4a3230988ff17df2165440f37e8b1708")), - Address(H160::from("0xf4c64518ea10f995918a454158c6b61407ea345c")), - Address(H160::from("0x7602b46df5390e432ef1c307d4f2c9ff6d65cc97")), - Address(H160::from("0xbb9bc244d798123fde783fcc1c72d3bb8c189413")), - Address(H160::from("0x807640a13483f8ac783c557fcdf27be11ea4ac7a")), + Address(H160::from_str("0x304a554a310c7e546dfe434669c62820b7d83490").unwrap()), + Address(H160::from_str("0x914d1b8b43e92723e64fd0a06f5bdb8dd9b10c79").unwrap()), + Address(H160::from_str("0xfe24cdd8648121a43a7c86d289be4dd2951ed49f").unwrap()), + Address(H160::from_str("0x17802f43a0137c506ba92291391a8a8f207f487d").unwrap()), + Address(H160::from_str("0xb136707642a4ea12fb4bae820f03d2562ebff487").unwrap()), + Address(H160::from_str("0xdbe9b615a3ae8709af8b93336ce9b477e4ac0940").unwrap()), + Address(H160::from_str("0xf14c14075d6c4ed84b86798af0956deef67365b5").unwrap()), + Address(H160::from_str("0xca544e5c4687d109611d0f8f928b53a25af72448").unwrap()), + Address(H160::from_str("0xaeeb8ff27288bdabc0fa5ebb731b6f409507516c").unwrap()), + Address(H160::from_str("0xcbb9d3703e651b0d496cdefb8b92c25aeb2171f7").unwrap()), + Address(H160::from_str("0xaccc230e8a6e5be9160b8cdf2864dd2a001c28b6").unwrap()), + Address(H160::from_str("0x2b3455ec7fedf16e646268bf88846bd7a2319bb2").unwrap()), + Address(H160::from_str("0x4613f3bca5c44ea06337a9e439fbc6d42e501d0a").unwrap()), + Address(H160::from_str("0xd343b217de44030afaa275f54d31a9317c7f441e").unwrap()), + Address(H160::from_str("0x84ef4b2357079cd7a7c69fd7a37cd0609a679106").unwrap()), + Address(H160::from_str("0xda2fef9e4a3230988ff17df2165440f37e8b1708").unwrap()), + Address(H160::from_str("0xf4c64518ea10f995918a454158c6b61407ea345c").unwrap()), + Address(H160::from_str("0x7602b46df5390e432ef1c307d4f2c9ff6d65cc97").unwrap()), + Address(H160::from_str("0xbb9bc244d798123fde783fcc1c72d3bb8c189413").unwrap()), + Address(H160::from_str("0x807640a13483f8ac783c557fcdf27be11ea4ac7a").unwrap()), ]), difficulty_hardfork_transition: Some(Uint(U256::from(0x59d9))), difficulty_hardfork_bound_divisor: Some(Uint(U256::from(0x0200))), diff --git a/json/src/spec/genesis.rs b/json/src/spec/genesis.rs index 1452bea0c17..424ee874aac 100644 --- a/json/src/spec/genesis.rs +++ b/json/src/spec/genesis.rs @@ -82,17 +82,17 @@ mod tests { let deserialized: Genesis = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, Genesis { seal: Seal::Ethereum(Ethereum { - nonce: H64(Eth64::from("0x00006d6f7264656e")), - mix_hash: H256(Eth256::from("0x0000000000000000000000000000000000000000000000000000000000000000")) + nonce: H64(Eth64::from_str("0x00006d6f7264656e").unwrap()), + mix_hash: H256(Eth256::from_str("0x0000000000000000000000000000000000000000000000000000000000000000").unwrap()) }), difficulty: Uint(U256::from(0x400000000u64)), - author: Some(Address(H160::from("0x1000000000000000000000000000000000000001"))), + author: Some(Address(H160::from_str("0x1000000000000000000000000000000000000001").unwrap())), timestamp: Some(Uint(U256::from(0x07))), - parent_hash: Some(H256(Eth256::from("0x9000000000000000000000000000000000000000000000000000000000000000"))), + parent_hash: Some(H256(Eth256::from_str("0x9000000000000000000000000000000000000000000000000000000000000000").unwrap())), gas_limit: Uint(U256::from(0x1388)), transactions_root: None, receipts_root: None, - state_root: Some(H256(Eth256::from("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544"))), + state_root: Some(H256(Eth256::from_str("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544").unwrap())), gas_used: None, extra_data: Some(Bytes::from_str("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa").unwrap()), }); diff --git a/json/src/spec/hardcoded_sync.rs b/json/src/spec/hardcoded_sync.rs index 381cd1f1acc..68852c0290e 100644 --- a/json/src/spec/hardcoded_sync.rs +++ b/json/src/spec/hardcoded_sync.rs @@ -40,6 +40,7 @@ mod tests { use ethereum_types::{U256, H256 as Eth256}; use hash::H256; use spec::hardcoded_sync::HardcodedSync; + use std::str::FromStr; #[test] fn hardcoded_sync_deserialization() { @@ -56,8 +57,8 @@ mod tests { header: String::from("f901f9a0d405da4e66f1445d455195229624e133f5baafe72b5cf7b3c36c12c8146e98b7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a05fb2b4bfdef7b314451cb138a534d225c922fc0e5fbe25e451142732c3e25c25a088d2ec6b9860aae1a2c3b299f72b6a5d70d7f7ba4722c78f2c49ba96273c2158a007c6fdfa8eea7e86b81f5b0fc0f78f90cc19f4aa60d323151e0cac660199e9a1b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefba82524d84568e932a80a0a0349d8c3df71f1a48a9df7d03fd5f14aeee7d91332c009ecaff0a71ead405bd88ab4e252a7e8c2a23"), total_difficulty: Uint(U256::from(0x400000000u64)), chts: vec![ - H256(Eth256::from("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa")), - H256(Eth256::from("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544")), + H256(Eth256::from_str("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa").unwrap()), + H256(Eth256::from_str("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544").unwrap()), ] }); } diff --git a/json/src/spec/seal.rs b/json/src/spec/seal.rs index e716a05bc26..9a00ba19b08 100644 --- a/json/src/spec/seal.rs +++ b/json/src/spec/seal.rs @@ -76,6 +76,7 @@ mod tests { use uint::Uint; use ethereum_types::{U256, H64 as Eth64, H256 as Eth256, H520 as Eth520}; use spec::{Ethereum, AuthorityRoundSeal, TendermintSeal, Seal}; + use std::str::FromStr; #[test] fn seal_deserialization() { @@ -106,8 +107,8 @@ mod tests { // [0] assert_eq!(deserialized[0], Seal::Ethereum(Ethereum { - nonce: H64(Eth64::from("0x0000000000000042")), - mix_hash: H256(Eth256::from("0x1000000000000000000000000000000000000000000000000000000000000001")) + nonce: H64(Eth64::from_str("0x0000000000000042").unwrap()), + mix_hash: H256(Eth256::from_str("0x1000000000000000000000000000000000000000000000000000000000000001").unwrap()) })); // [1] @@ -118,14 +119,14 @@ mod tests { // [2] assert_eq!(deserialized[2], Seal::AuthorityRound(AuthorityRoundSeal { step: Uint(U256::from(0x0)), - signature: H520(Eth520::from("0x2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002")) + signature: H520(Eth520::from_str("0x2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002").unwrap()) })); // [3] assert_eq!(deserialized[3], Seal::Tendermint(TendermintSeal { round: Uint(U256::from(0x3)), - proposal: H520(Eth520::from("0x3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003")), - precommits: vec![H520(Eth520::from("0x4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004"))] + proposal: H520(Eth520::from_str("0x3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003").unwrap()), + precommits: vec![H520(Eth520::from_str("0x4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004").unwrap())] })); } } diff --git a/json/src/spec/validator_set.rs b/json/src/spec/validator_set.rs index e7e82282c7a..bd3ffbba84b 100644 --- a/json/src/spec/validator_set.rs +++ b/json/src/spec/validator_set.rs @@ -42,6 +42,7 @@ mod tests { use ethereum_types::{H160, U256}; use hash::Address; use spec::validator_set::ValidatorSet; + use std::str::FromStr; #[test] fn validator_set_deserialization() { @@ -62,9 +63,9 @@ mod tests { let deserialized: Vec = serde_json::from_str(s).unwrap(); assert_eq!(deserialized.len(), 4); - assert_eq!(deserialized[0], ValidatorSet::List(vec![Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b"))])); - assert_eq!(deserialized[1], ValidatorSet::SafeContract(Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b")))); - assert_eq!(deserialized[2], ValidatorSet::Contract(Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b")))); + assert_eq!(deserialized[0], ValidatorSet::List(vec![Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())])); + assert_eq!(deserialized[1], ValidatorSet::SafeContract(Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap()))); + assert_eq!(deserialized[2], ValidatorSet::Contract(Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap()))); match deserialized[3] { ValidatorSet::Multi(ref map) => { assert_eq!(map.len(), 3); From 8c3180eafc4d83233994dcb3ddf44ac57051a6e3 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 15:58:54 +0200 Subject: [PATCH 41/90] [eip-712] fix compilation in tests --- util/EIP-712/src/encode.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/EIP-712/src/encode.rs b/util/EIP-712/src/encode.rs index 3feac8a8d0c..5ff621512a6 100644 --- a/util/EIP-712/src/encode.rs +++ b/util/EIP-712/src/encode.rs @@ -360,9 +360,10 @@ mod tests { #[test] fn test_hash_data() { let typed_data = from_str::(JSON).expect("alas error!"); + let hash = hash_structured_data(typed_data).expect("alas error!"); assert_eq!( - hash_structured_data(typed_data).expect("alas error!").to_hex::(), - "be609aee343fb3c4b28e1df9e632fca64fcfaede20f02e86244efddf30957bd2" + &format!("{:x}", hash)[..], + "be609aee343fb3c4b28e1df9e632fca64fcfaede20f02e86244efddf30957bd2", ) } From ba13bc2362ceec08ba992f730cbff848f832d2d4 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 16:53:26 +0200 Subject: [PATCH 42/90] [ethcore-blockchain] fix compilation in tests --- ethcore/blockchain/src/blockchain.rs | 17 ++++++++--------- ethcore/blockchain/src/import_route.rs | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ethcore/blockchain/src/blockchain.rs b/ethcore/blockchain/src/blockchain.rs index 1431b1999ca..3605cdb8c8c 100644 --- a/ethcore/blockchain/src/blockchain.rs +++ b/ethcore/blockchain/src/blockchain.rs @@ -1571,6 +1571,7 @@ mod tests { use keccak_hash::keccak; use rustc_hex::FromHex; use tempdir::TempDir; + use std::str::FromStr; struct TestBlockChainDB { _blooms_dir: TempDir, @@ -1629,8 +1630,6 @@ mod tests { } fn insert_block_batch(batch: &mut DBTransaction, bc: &BlockChain, block: encoded::Block, receipts: Vec) -> ImportRoute { - use crate::ExtrasInsert; - let fork_choice = { let header = block.header_view(); let parent_hash = header.parent_hash(); @@ -2057,7 +2056,7 @@ mod tests { fn find_transaction_by_hash() { let genesis = "f901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0af81e09f8c46ca322193edfda764fa7e88e81923f802f1d325ec0b0308ac2cd0a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830200008083023e38808454c98c8142a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421880102030405060708c0c0".from_hex().unwrap(); let b1 = "f904a8f901faa0ce1f26f798dd03c8782d63b3e42e79a64eaea5694ea686ac5d7ce3df5171d1aea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0a65c2364cd0f1542d761823dc0109c6b072f14c20459598c5455c274601438f4a070616ebd7ad2ed6fb7860cf7e9df00163842351c38a87cac2c1cb193895035a2a05c5b4fc43c2d45787f54e1ae7d27afdb4ad16dfc567c5692070d5c4556e0b1d7b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830200000183023ec683021536845685109780a029f07836e4e59229b3a065913afc27702642c683bba689910b2b2fd45db310d3888957e6d004a31802f902a7f85f800a8255f094aaaf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca0575da4e21b66fa764be5f74da9389e67693d066fb0d1312e19e17e501da00ecda06baf5a5327595f6619dfc2fcb3f2e6fb410b5810af3cb52d0e7508038e91a188f85f010a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba04fa966bf34b93abc1bcd665554b7f316b50f928477b50be0f3285ead29d18c5ba017bba0eeec1625ab433746955e125d46d80b7fdc97386c51266f842d8e02192ef85f020a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca004377418ae981cc32b1312b4a427a1d69a821b28db8584f5f2bd8c6d42458adaa053a1dba1af177fac92f3b6af0a9fa46a22adf56e686c93794b6a012bf254abf5f85f030a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca04fe13febd28a05f4fcb2f451d7ddc2dda56486d9f8c79a62b0ba4da775122615a0651b2382dd402df9ebc27f8cb4b2e0f3cea68dda2dca0ee9603608f0b6f51668f85f040a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba078e6a0ba086a08f8450e208a399bb2f2d2a0d984acd2517c7c7df66ccfab567da013254002cd45a97fac049ae00afbc43ed0d9961d0c56a3b2382c80ce41c198ddf85f050a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba0a7174d8f43ea71c8e3ca9477691add8d80ac8e0ed89d8d8b572041eef81f4a54a0534ea2e28ec4da3b5b944b18c51ec84a5cf35f5b3343c5fb86521fd2d388f506f85f060a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba034bd04065833536a10c77ee2a43a5371bc6d34837088b861dd9d4b7f44074b59a078807715786a13876d3455716a6b9cb2186b7a4887a5c31160fc877454958616c0".from_hex().unwrap(); - let b1_hash: H256 = "f53f268d23a71e85c7d6d83a9504298712b84c1a2ba220441c86eeda0bf0b6e3".into(); + let b1_hash = H256::from_str("f53f268d23a71e85c7d6d83a9504298712b84c1a2ba220441c86eeda0bf0b6e3").unwrap(); let db = new_db(); let bc = new_chain(encoded::Block::new(genesis), db.clone()); @@ -2237,11 +2236,11 @@ mod tests { #[test] fn test_bloom_filter_simple() { - let bloom_b1: Bloom = "00000020000000000000000000000000000000000000000002000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000400000000000000000000002000".into(); + let bloom_b1 = Bloom::from_str("00000020000000000000000000000000000000000000000002000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000400000000000000000000002000").unwrap(); - let bloom_b2: Bloom = "00000000000000000000000000000000000000000000020000001000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into(); + let bloom_b2 = Bloom::from_str("00000000000000000000000000000000000000000000020000001000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); - let bloom_ba: Bloom = "00000000000000000000000000000000000000000000020000000800000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into(); + let bloom_ba = Bloom::from_str("00000000000000000000000000000000000000000000020000000800000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); let genesis = BlockBuilder::genesis(); let b1 = genesis.add_block_with(|| BlockOptions { @@ -2305,11 +2304,11 @@ mod tests { #[test] fn test_insert_unordered() { - let bloom_b1: Bloom = "00000020000000000000000000000000000000000000000002000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000400000000000000000000002000".into(); + let bloom_b1 = Bloom::from_str("00000020000000000000000000000000000000000000000002000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000400000000000000000000002000").unwrap(); - let bloom_b2: Bloom = "00000000000000000000000000000000000000000000020000001000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into(); + let bloom_b2 = Bloom::from_str("00000000000000000000000000000000000000000000020000001000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); - let bloom_b3: Bloom = "00000000000000000000000000000000000000000000020000000800000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into(); + let bloom_b3 = Bloom::from_str("00000000000000000000000000000000000000000000020000000800000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); let genesis = BlockBuilder::genesis(); let b1 = genesis.add_block_with_bloom(bloom_b1); diff --git a/ethcore/blockchain/src/import_route.rs b/ethcore/blockchain/src/import_route.rs index 8c635b4e5ab..46ebc254b4e 100644 --- a/ethcore/blockchain/src/import_route.rs +++ b/ethcore/blockchain/src/import_route.rs @@ -68,7 +68,7 @@ impl From for ImportRoute { #[cfg(test)] mod tests { - use ethereum_types::{H256, U256}; + use ethereum_types::{U256, BigEndianHash}; use crate::block_info::{BlockInfo, BlockLocation, BranchBecomingCanonChainData}; use super::ImportRoute; @@ -84,7 +84,7 @@ mod tests { #[test] fn import_route_branch() { let info = BlockInfo { - hash: H256::from(U256::from(1)), + hash: BigEndianHash::from_uint(&U256::from(1)), number: 0, total_difficulty: U256::from(0), location: BlockLocation::Branch, @@ -93,14 +93,14 @@ mod tests { assert_eq!(ImportRoute::from(info), ImportRoute { retracted: vec![], enacted: vec![], - omitted: vec![H256::from(U256::from(1))], + omitted: vec![BigEndianHash::from_uint(&U256::from(1))], }); } #[test] fn import_route_canon_chain() { let info = BlockInfo { - hash: H256::from(U256::from(1)), + hash: BigEndianHash::from_uint(&U256::from(1)), number: 0, total_difficulty: U256::from(0), location: BlockLocation::CanonChain, @@ -108,7 +108,7 @@ mod tests { assert_eq!(ImportRoute::from(info), ImportRoute { retracted: vec![], - enacted: vec![H256::from(U256::from(1))], + enacted: vec![BigEndianHash::from_uint(&U256::from(1))], omitted: vec![], }); } @@ -116,19 +116,19 @@ mod tests { #[test] fn import_route_branch_becoming_canon_chain() { let info = BlockInfo { - hash: H256::from(U256::from(2)), + hash: BigEndianHash::from_uint(&U256::from(2)), number: 0, total_difficulty: U256::from(0), location: BlockLocation::BranchBecomingCanonChain(BranchBecomingCanonChainData { - ancestor: H256::from(U256::from(0)), - enacted: vec![H256::from(U256::from(1))], - retracted: vec![H256::from(U256::from(3)), H256::from(U256::from(4))], + ancestor: BigEndianHash::from_uint(&U256::from(0)), + enacted: vec![BigEndianHash::from_uint(&U256::from(1))], + retracted: vec![BigEndianHash::from_uint(&U256::from(3)), BigEndianHash::from_uint(&U256::from(4))], }) }; assert_eq!(ImportRoute::from(info), ImportRoute { - retracted: vec![H256::from(U256::from(3)), H256::from(U256::from(4))], - enacted: vec![H256::from(U256::from(1)), H256::from(U256::from(2))], + retracted: vec![BigEndianHash::from_uint(&U256::from(3)), BigEndianHash::from_uint(&U256::from(4))], + enacted: vec![BigEndianHash::from_uint(&U256::from(1)), BigEndianHash::from_uint(&U256::from(2))], omitted: vec![], }); } From 410e9c0e5f9d9bb24874064cb5333b15860c74e8 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 16:58:01 +0200 Subject: [PATCH 43/90] [ethstore] fix compilation in tests --- accounts/ethstore/Cargo.toml | 1 + accounts/ethstore/src/ethstore.rs | 2 +- accounts/ethstore/tests/api.rs | 17 ++++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 49509639006..52a5cce1fc1 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -26,5 +26,6 @@ lazy_static = "1.2.0" [dev-dependencies] matches = "0.1" +ethereum-types = { git = "https://github.com/ordian/parity-common" } [lib] diff --git a/accounts/ethstore/src/ethstore.rs b/accounts/ethstore/src/ethstore.rs index 92eb949673f..9c79ae0e7b5 100644 --- a/accounts/ethstore/src/ethstore.rs +++ b/accounts/ethstore/src/ethstore.rs @@ -1090,7 +1090,7 @@ mod tests { SecretVaultRef::Root, &address, &"test".into(), - Derivation::HardHash(H256::from(0)), + Derivation::HardHash(H256::zero()), ).unwrap(); // there should be 2 accounts in the store diff --git a/accounts/ethstore/tests/api.rs b/accounts/ethstore/tests/api.rs index c274737522b..74d66a66665 100644 --- a/accounts/ethstore/tests/api.rs +++ b/accounts/ethstore/tests/api.rs @@ -16,6 +16,7 @@ extern crate rand; extern crate ethstore; +extern crate ethereum_types; mod util; @@ -23,6 +24,8 @@ use ethstore::{EthStore, SimpleSecretStore, SecretVaultRef, StoreAccountRef}; use ethstore::ethkey::{Random, Generator, Secret, KeyPair, verify_address}; use ethstore::accounts_dir::RootDiskDirectory; use util::TransientDir; +use ethereum_types::Address; +use std::str::FromStr; #[test] fn secret_store_create() { @@ -114,9 +117,9 @@ fn secret_store_laod_geth_files() { let dir = RootDiskDirectory::at(test_path()); let store = EthStore::open(Box::new(dir)).unwrap(); assert_eq!(store.accounts().unwrap(), vec![ - StoreAccountRef::root("3f49624084b67849c7b4e805c5988c21a430f9d9".into()), - StoreAccountRef::root("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf".into()), - StoreAccountRef::root("63121b431a52f8043c16fcf0d1df9cb7b5f66649".into()), + StoreAccountRef::root(Address::from_str("3f49624084b67849c7b4e805c5988c21a430f9d9").unwrap()), + StoreAccountRef::root(Address::from_str("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf").unwrap()), + StoreAccountRef::root(Address::from_str("63121b431a52f8043c16fcf0d1df9cb7b5f66649").unwrap()), ]); } @@ -125,8 +128,8 @@ fn secret_store_load_pat_files() { let dir = RootDiskDirectory::at(pat_path()); let store = EthStore::open(Box::new(dir)).unwrap(); assert_eq!(store.accounts().unwrap(), vec![ - StoreAccountRef::root("3f49624084b67849c7b4e805c5988c21a430f9d9".into()), - StoreAccountRef::root("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf".into()), + StoreAccountRef::root(Address::from_str("3f49624084b67849c7b4e805c5988c21a430f9d9").unwrap()), + StoreAccountRef::root(Address::from_str("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf").unwrap()), ]); } @@ -140,8 +143,8 @@ fn test_decrypting_files_with_short_ciphertext() { let store = EthStore::open(Box::new(dir)).unwrap(); let accounts = store.accounts().unwrap(); assert_eq!(accounts, vec![ - StoreAccountRef::root("31e9d1e6d844bd3a536800ef8d8be6a9975db509".into()), - StoreAccountRef::root("d1e64e5480bfaf733ba7d48712decb8227797a4e".into()), + StoreAccountRef::root(Address::from_str("31e9d1e6d844bd3a536800ef8d8be6a9975db509").unwrap()), + StoreAccountRef::root(Address::from_str("d1e64e5480bfaf733ba7d48712decb8227797a4e").unwrap()), ]); let message = Default::default(); From b0a465150e7892915048d9240dc92f798f41677e Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 17:02:02 +0200 Subject: [PATCH 44/90] [ethstore-accounts] fix compilation in tests --- accounts/src/lib.rs | 8 ++++---- accounts/src/stores.rs | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/accounts/src/lib.rs b/accounts/src/lib.rs index 1cc083cf6d2..9f31e8f536e 100644 --- a/accounts/src/lib.rs +++ b/accounts/src/lib.rs @@ -528,7 +528,7 @@ mod tests { let derived_addr = ap.derive_account( &kp.address(), None, - Derivation::SoftHash(H256::from(999)), + Derivation::SoftHash(H256::from_low_u64_be(999)), false, ).expect("Derivation should not fail"); @@ -546,7 +546,7 @@ mod tests { let derived_addr = ap.derive_account( &kp.address(), None, - Derivation::SoftHash(H256::from(999)), + Derivation::SoftHash(H256::from_low_u64_be(999)), true, ).expect("Derivation should not fail"); @@ -567,7 +567,7 @@ mod tests { let derived_addr = ap.derive_account( &kp.address(), None, - Derivation::SoftHash(H256::from(1999)), + Derivation::SoftHash(H256::from_low_u64_be(1999)), true, ).expect("Derivation should not fail"); ap.unlock_account_permanently(derived_addr, "base".into()) @@ -579,7 +579,7 @@ mod tests { let signed_msg2 = ap.sign_derived( &kp.address(), None, - Derivation::SoftHash(H256::from(1999)), + Derivation::SoftHash(H256::from_low_u64_be(1999)), msg, ).expect("Derived signing with existing unlocked account should not fail"); diff --git a/accounts/src/stores.rs b/accounts/src/stores.rs index baa26cc48bb..739714dfa23 100644 --- a/accounts/src/stores.rs +++ b/accounts/src/stores.rs @@ -153,7 +153,7 @@ impl DiskMap { #[cfg(test)] mod tests { - use super::AddressBook; + use super::{AddressBook, Address}; use std::collections::HashMap; use tempdir::TempDir; use crate::account_data::AccountMeta; @@ -162,12 +162,12 @@ mod tests { fn should_save_and_reload_address_book() { let tempdir = TempDir::new("").unwrap(); let mut b = AddressBook::new(tempdir.path()); - b.set_name(1.into(), "One".to_owned()); - b.set_meta(1.into(), "{1:1}".to_owned()); + b.set_name(Address::from_low_u64_be(1), "One".to_owned()); + b.set_meta(Address::from_low_u64_be(1), "{1:1}".to_owned()); let b = AddressBook::new(tempdir.path()); assert_eq!(b.get(), vec![ - (1, AccountMeta {name: "One".to_owned(), meta: "{1:1}".to_owned(), uuid: None}) - ].into_iter().map(|(a, b)| (a.into(), b)).collect::>()); + (Address::from_low_u64_be(1), AccountMeta {name: "One".to_owned(), meta: "{1:1}".to_owned(), uuid: None}) + ].into_iter().collect::>()); } #[test] @@ -175,15 +175,15 @@ mod tests { let tempdir = TempDir::new("").unwrap(); let mut b = AddressBook::new(tempdir.path()); - b.set_name(1.into(), "One".to_owned()); - b.set_name(2.into(), "Two".to_owned()); - b.set_name(3.into(), "Three".to_owned()); - b.remove(2.into()); + b.set_name(Address::from_low_u64_be(1), "One".to_owned()); + b.set_name(Address::from_low_u64_be(2), "Two".to_owned()); + b.set_name(Address::from_low_u64_be(3), "Three".to_owned()); + b.remove(Address::from_low_u64_be(2).into()); let b = AddressBook::new(tempdir.path()); assert_eq!(b.get(), vec![ - (1, AccountMeta{name: "One".to_owned(), meta: "{}".to_owned(), uuid: None}), - (3, AccountMeta{name: "Three".to_owned(), meta: "{}".to_owned(), uuid: None}), - ].into_iter().map(|(a, b)| (a.into(), b)).collect::>()); + (Address::from_low_u64_be(1), AccountMeta{name: "One".to_owned(), meta: "{}".to_owned(), uuid: None}), + (Address::from_low_u64_be(3), AccountMeta{name: "Three".to_owned(), meta: "{}".to_owned(), uuid: None}), + ].into_iter().collect::>()); } } From e368698398eb2badd778056002e434740ba7614a Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 17:18:34 +0200 Subject: [PATCH 45/90] [parity-hash-fetch] fix compilation in tests --- updater/hash-fetch/src/client.rs | 15 ++++++++------- updater/hash-fetch/src/urlhint.rs | 12 +++++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/updater/hash-fetch/src/client.rs b/updater/hash-fetch/src/client.rs index d208ff8d4dc..f68095c195b 100644 --- a/updater/hash-fetch/src/client.rs +++ b/updater/hash-fetch/src/client.rs @@ -196,7 +196,8 @@ mod tests { use parking_lot::Mutex; use parity_runtime::Executor; use urlhint::tests::{FakeRegistrar, URLHINT}; - use super::{Error, Client, HashFetch, random_temp_path}; + use super::{Error, Client, HashFetch, random_temp_path, H256}; + use std::str::FromStr; fn registrar() -> FakeRegistrar { let mut registrar = FakeRegistrar::new(); @@ -216,7 +217,7 @@ mod tests { // when let (tx, rx) = mpsc::channel(); - client.fetch(2.into(), Default::default(), Box::new(move |result| { + client.fetch(H256::from_low_u64_be(2), Default::default(), Box::new(move |result| { tx.send(result).unwrap(); })); @@ -234,7 +235,7 @@ mod tests { // when let (tx, rx) = mpsc::channel(); - client.fetch(2.into(), Default::default(), Box::new(move |result| { + client.fetch(H256::from_low_u64_be(2), Default::default(), Box::new(move |result| { tx.send(result).unwrap(); })); @@ -255,14 +256,14 @@ mod tests { // when let (tx, rx) = mpsc::channel(); - client.fetch(2.into(), Default::default(), Box::new(move |result| { + client.fetch(H256::from_low_u64_be(2), Default::default(), Box::new(move |result| { tx.send(result).unwrap(); })); // then let result = rx.recv().unwrap(); - let hash = "0x2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e".into(); - assert_eq!(result.unwrap_err(), Error::HashMismatch { expected: 2.into(), got: hash }); + let hash = H256::from_str("2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e").unwrap(); + assert_eq!(result.unwrap_err(), Error::HashMismatch { expected: H256::from_low_u64_be(2), got: hash }); assert!(!path.exists(), "Temporary file should be removed."); } @@ -275,7 +276,7 @@ mod tests { // when let (tx, rx) = mpsc::channel(); - client.fetch("0x2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e".into(), + client.fetch(H256::from_str("2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e").unwrap(), Default::default(), Box::new(move |result| { tx.send(result).unwrap(); })); diff --git a/updater/hash-fetch/src/urlhint.rs b/updater/hash-fetch/src/urlhint.rs index 73520fd3b77..6ac78d193cd 100644 --- a/updater/hash-fetch/src/urlhint.rs +++ b/updater/hash-fetch/src/urlhint.rs @@ -249,6 +249,12 @@ pub mod tests { } } + fn h256_from_short_str(s: &str) -> H256 { + let mut bytes = s.as_bytes().to_vec(); + bytes.resize(32usize, 0u8); + H256::from_slice(bytes.as_ref()) + } + #[test] fn should_call_registrar_and_urlhint_contracts() { // given @@ -263,7 +269,7 @@ pub mod tests { let urlhint = URLHintContract::new(Arc::new(registrar)); // when - let res = urlhint.resolve("test".as_bytes().into()).wait().unwrap(); + let res = urlhint.resolve(h256_from_short_str("test")).wait().unwrap(); let calls = calls.lock(); let call0 = calls.get(0).expect("Registrar resolve called"); let call1 = calls.get(1).expect("URLHint Resolve called"); @@ -291,7 +297,7 @@ pub mod tests { let urlhint = URLHintContract::new(Arc::new(registrar)); // when - let res = urlhint.resolve("test".as_bytes().into()).wait().unwrap(); + let res = urlhint.resolve(h256_from_short_str("test")).wait().unwrap(); // then assert_eq!(res, Some(URLHintResult::Dapp(GithubApp { @@ -313,7 +319,7 @@ pub mod tests { let urlhint = URLHintContract::new(Arc::new(registrar)); // when - let res = urlhint.resolve("test".as_bytes().into()).wait().unwrap(); + let res = urlhint.resolve(h256_from_short_str("test")).wait().unwrap(); // then assert_eq!(res, Some(URLHintResult::Content(Content { From 3ff136880312b470c18f7a3c3908b5c7affd5346 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 17:23:25 +0200 Subject: [PATCH 46/90] [parity-whisper] fix compilation in tests --- whisper/src/message.rs | 4 ++-- whisper/src/net/tests.rs | 2 +- whisper/src/rpc/crypto.rs | 8 +++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/whisper/src/message.rs b/whisper/src/message.rs index 94d780c1313..ad50e3d9bf0 100644 --- a/whisper/src/message.rs +++ b/whisper/src/message.rs @@ -530,9 +530,9 @@ mod tests { #[test] fn work_factor() { // 256 leading zeros -> 2^256 / 1 - assert_eq!(work_factor_proved(1, 1, H256::from(0)), 115792089237316200000000000000000000000000000000000000000000000000000000000000.0); + assert_eq!(work_factor_proved(1, 1, H256::zero()), 115792089237316200000000000000000000000000000000000000000000000000000000000000.0); // 255 leading zeros -> 2^255 / 1 - assert_eq!(work_factor_proved(1, 1, H256::from(1)), 57896044618658100000000000000000000000000000000000000000000000000000000000000.0); + assert_eq!(work_factor_proved(1, 1, H256::from_low_u64_be(1)), 57896044618658100000000000000000000000000000000000000000000000000000000000000.0); // 0 leading zeros -> 2^0 / 1 assert_eq!(work_factor_proved(1, 1, serde_json::from_str::("\"0xff00000000000000000000000000000000000000000000000000000000000000\"").unwrap()), 1.0); } diff --git a/whisper/src/net/tests.rs b/whisper/src/net/tests.rs index 7af0cb8d380..fc4534dcc6e 100644 --- a/whisper/src/net/tests.rs +++ b/whisper/src/net/tests.rs @@ -114,7 +114,7 @@ impl<'a> Context for TestContext<'a> { fn node_key(&self, peer: PeerId) -> Option { let mut id = NodeId::default(); - id[0] = peer as _; + id.as_bytes_mut()[0] = peer as _; Some(id) } diff --git a/whisper/src/rpc/crypto.rs b/whisper/src/rpc/crypto.rs index 2cf8636d7ac..418f4037413 100644 --- a/whisper/src/rpc/crypto.rs +++ b/whisper/src/rpc/crypto.rs @@ -186,6 +186,8 @@ impl DecryptionInstance { #[cfg(test)] mod tests { use super::*; + use rand::{Rng, rngs::OsRng}; + #[test] fn encrypt_asymmetric() { @@ -213,8 +215,6 @@ mod tests { #[test] fn encrypt_symmetric() { - use rand::{Rng, OsRng}; - let mut rng = OsRng::new().unwrap(); let mut test_message = move |message: &[u8]| { let key = Memzero::from(rng.gen::<[u8; 32]>()); @@ -239,12 +239,10 @@ mod tests { #[test] fn encrypt_broadcast() { - use rand::{Rng, OsRng}; - let mut rng = OsRng::new().unwrap(); let mut test_message = move |message: &[u8]| { - let all_topics = (0..5).map(|_| rng.gen()).collect::>(); + let all_topics = (0..5).map(|_| H256::random_using(&mut rng)).collect::>(); let known_idx = 2; let known_topic = all_topics[2]; let key = Memzero::from(rng.gen::<[u8; 32]>()); From 96453bdf7cdb9d3e318a6748c51ca6a8d7fba6fa Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 17:25:42 +0200 Subject: [PATCH 47/90] [ethcore-miner] fix compilation in tests --- miner/src/external.rs | 8 ++++---- miner/src/pool/listener.rs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/miner/src/external.rs b/miner/src/external.rs index f68e065abd0..6355e5a2b71 100644 --- a/miner/src/external.rs +++ b/miner/src/external.rs @@ -84,7 +84,7 @@ mod tests { // given let m = miner(); assert_eq!(m.hashrate(), U256::from(0)); - m.submit_hashrate(U256::from(10), H256::from(1)); + m.submit_hashrate(U256::from(10), H256::from_low_u64_be(1)); assert_eq!(m.hashrate(), U256::from(10)); // when @@ -99,12 +99,12 @@ mod tests { // given let m = miner(); assert_eq!(m.hashrate(), U256::from(0)); - m.submit_hashrate(U256::from(10), H256::from(1)); + m.submit_hashrate(U256::from(10), H256::from_low_u64_be(1)); assert_eq!(m.hashrate(), U256::from(10)); // when - m.submit_hashrate(U256::from(15), H256::from(1)); - m.submit_hashrate(U256::from(20), H256::from(2)); + m.submit_hashrate(U256::from(15), H256::from_low_u64_be(1)); + m.submit_hashrate(U256::from(20), H256::from_low_u64_be(2)); // then assert_eq!(m.hashrate(), U256::from(35)); diff --git a/miner/src/pool/listener.rs b/miner/src/pool/listener.rs index 0f53afb834b..464f73be190 100644 --- a/miner/src/pool/listener.rs +++ b/miner/src/pool/listener.rs @@ -183,6 +183,7 @@ mod tests { use parking_lot::Mutex; use types::transaction; use txpool::Listener; + use ethereum_types::Address; #[test] fn should_notify_listeners() { @@ -217,7 +218,7 @@ mod tests { gas: 21_000.into(), gas_price: 5.into(), value: 0.into(), - }.fake_sign(5.into()); + }.fake_sign(Address::from_low_u64_be(5)); Arc::new(Transaction::from_pending_block_transaction(signed)) } From 5d7dfa35871844b39ea9c3a857f53ddb837cd7c7 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 17:59:55 +0200 Subject: [PATCH 48/90] [ethcore-network-devp2p] fix compilation in tests --- util/network-devp2p/src/connection.rs | 10 +++++----- util/network-devp2p/src/discovery.rs | 6 +++--- util/network-devp2p/src/handshake.rs | 28 ++++++++++++++++++--------- util/network-devp2p/src/host.rs | 3 ++- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/util/network-devp2p/src/connection.rs b/util/network-devp2p/src/connection.rs index b8e530f8af5..37a1bb60416 100644 --- a/util/network-devp2p/src/connection.rs +++ b/util/network-devp2p/src/connection.rs @@ -497,14 +497,14 @@ pub fn test_encryption() { let after = H128::from_str("89464c6b04e7c99e555c81d3f7266a05").unwrap(); let after2 = H128::from_str("85c070030589ef9c7a2879b3a8489316").unwrap(); - let mut got = H128::new(); + let mut got = H128::zero(); - let mut encoder = EcbEncryptor::new(AesSafe256Encryptor::new(&key), NoPadding); - encoder.encrypt(&mut RefReadBuffer::new(&before), &mut RefWriteBuffer::new(&mut got), true).unwrap(); + let mut encoder = EcbEncryptor::new(AesSafe256Encryptor::new(key.as_bytes()), NoPadding); + encoder.encrypt(&mut RefReadBuffer::new(before.as_bytes()), &mut RefWriteBuffer::new(got.as_bytes_mut()), true).unwrap(); encoder.reset(); assert_eq!(got, after); - got = H128::new(); - encoder.encrypt(&mut RefReadBuffer::new(&before2), &mut RefWriteBuffer::new(&mut got), true).unwrap(); + got = H128::zero(); + encoder.encrypt(&mut RefReadBuffer::new(before2.as_bytes()), &mut RefWriteBuffer::new(got.as_bytes_mut()), true).unwrap(); encoder.reset(); assert_eq!(got, after2); } diff --git a/util/network-devp2p/src/discovery.rs b/util/network-devp2p/src/discovery.rs index bdbc021d2fa..2bc859d665c 100644 --- a/util/network-devp2p/src/discovery.rs +++ b/util/network-devp2p/src/discovery.rs @@ -970,7 +970,7 @@ mod tests { } } - let results = discovery_handlers[0].nearest_node_entries(&NodeId::new()); + let results = discovery_handlers[0].nearest_node_entries(&NodeId::zero()); assert_eq!(results.len(), 4); } @@ -1073,10 +1073,10 @@ mod tests { let mut discovery = Discovery::new(&key, ep.clone(), IpFilter::default()); for _ in 0..(16 + 10) { - let entry = BucketEntry::new(NodeEntry { id: NodeId::new(), endpoint: ep.clone() }); + let entry = BucketEntry::new(NodeEntry { id: NodeId::zero(), endpoint: ep.clone() }); discovery.node_buckets[0].nodes.push_back(entry); } - let nearest = discovery.nearest_node_entries(&NodeId::new()); + let nearest = discovery.nearest_node_entries(&NodeId::zero()); assert_eq!(nearest.len(), 16) } diff --git a/util/network-devp2p/src/handshake.rs b/util/network-devp2p/src/handshake.rs index 77b633c401e..4e44db8eaa0 100644 --- a/util/network-devp2p/src/handshake.rs +++ b/util/network-devp2p/src/handshake.rs @@ -320,21 +320,31 @@ impl Handshake { mod test { use rustc_hex::FromHex; use super::*; - use ethereum_types::H256; + use ethereum_types::{H256, H512}; use io::*; use mio::tcp::TcpStream; use ethkey::Public; + use std::str::FromStr; fn check_auth(h: &Handshake, version: u64) { - assert_eq!(h.id, "fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877".into()); - assert_eq!(h.remote_nonce, "7e968bba13b6c50e2c4cd7f241cc0d64d1ac25c7f5952df231ac6a2bda8ee5d6".into()); - assert_eq!(h.remote_ephemeral, "654d1044b69c577a44e5f01a1209523adb4026e70c62d1c13a067acabc09d2667a49821a0ad4b634554d330a15a58fe61f8a8e0544b310c6de7b0c8da7528a8d".into()); + assert_eq!( + h.id, + H512::from_str("fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877").unwrap(), + ); + assert_eq!(h.remote_nonce, H256::from_str("7e968bba13b6c50e2c4cd7f241cc0d64d1ac25c7f5952df231ac6a2bda8ee5d6").unwrap()); + assert_eq!( + h.remote_ephemeral, + H512::from_str("654d1044b69c577a44e5f01a1209523adb4026e70c62d1c13a067acabc09d2667a49821a0ad4b634554d330a15a58fe61f8a8e0544b310c6de7b0c8da7528a8d").unwrap(), + ); assert_eq!(h.remote_version, version); } fn check_ack(h: &Handshake, version: u64) { - assert_eq!(h.remote_nonce, "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd".into()); - assert_eq!(h.remote_ephemeral, "b6d82fa3409da933dbf9cb0140c5dde89f4e64aec88d476af648880f4a10e1e49fe35ef3e69e93dd300b4797765a747c6384a6ecf5db9c2690398607a86181e4".into()); + assert_eq!(h.remote_nonce, H256::from_str("559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd").unwrap()); + assert_eq!( + h.remote_ephemeral, + H512::from_str("b6d82fa3409da933dbf9cb0140c5dde89f4e64aec88d476af648880f4a10e1e49fe35ef3e69e93dd300b4797765a747c6384a6ecf5db9c2690398607a86181e4").unwrap(), + ); assert_eq!(h.remote_version, version); } @@ -428,7 +438,7 @@ mod test { #[test] fn test_handshake_ack_plain() { - let remote = "fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877".into(); + let remote = H512::from_str("fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877").unwrap(); let mut h = create_handshake(Some(&remote)); let secret = "49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee".parse().unwrap(); let ack = @@ -448,7 +458,7 @@ mod test { #[test] fn test_handshake_ack_eip8() { - let remote = "fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877".into(); + let remote = H512::from_str("fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877").unwrap(); let mut h = create_handshake(Some(&remote)); let secret = "49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee".parse().unwrap(); let ack = @@ -477,7 +487,7 @@ mod test { #[test] fn test_handshake_ack_eip8_2() { - let remote = "fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877".into(); + let remote = H512::from_str("fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877").unwrap(); let mut h = create_handshake(Some(&remote)); let secret = "49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee".parse().unwrap(); let ack = diff --git a/util/network-devp2p/src/host.rs b/util/network-devp2p/src/host.rs index 6b55e5317e4..3394008c075 100644 --- a/util/network-devp2p/src/host.rs +++ b/util/network-devp2p/src/host.rs @@ -1223,7 +1223,8 @@ fn save_key(path: &Path, key: &Secret) { if let Err(e) = restrict_permissions_owner(path, true, false) { warn!(target: "network", "Failed to modify permissions of the file ({})", e); } - if let Err(e) = file.write(&format!("{:x}", key).into_bytes()[2..]) { + // TODO: verify + if let Err(e) = file.write(&format!("{:x}", key).into_bytes()) { warn!("Error writing key file: {:?}", e); } } From 14ba9f7454d26c5d4717d8645ea1672269c9ee57 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 18:26:09 +0200 Subject: [PATCH 49/90] [*] upgrade rand to 0.6 --- Cargo.lock | 16 ++++++++-------- accounts/ethstore/Cargo.toml | 2 +- accounts/ethstore/cli/Cargo.toml | 2 +- accounts/ethstore/src/random.rs | 4 ++-- ethcore/Cargo.toml | 4 ++-- ethcore/light/Cargo.toml | 2 +- ethcore/src/client/client.rs | 4 ++-- ethcore/src/snapshot/consensus/work.rs | 4 ++-- ethcore/src/snapshot/mod.rs | 2 +- ethcore/sync/Cargo.toml | 2 +- ethcore/sync/src/chain/mod.rs | 8 ++++---- ethcore/sync/src/chain/propagator.rs | 2 +- ethcore/sync/src/light_sync/mod.rs | 4 ++-- rpc/Cargo.toml | 2 +- rpc/src/authcodes.rs | 5 ++--- rpc/src/v1/helpers/secretstore.rs | 2 +- rpc/src/v1/helpers/subscribers.rs | 7 +++---- updater/Cargo.toml | 2 +- updater/hash-fetch/Cargo.toml | 2 +- updater/hash-fetch/src/client.rs | 6 +++--- util/network-devp2p/Cargo.toml | 2 +- 21 files changed, 41 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b8c3553cef..ad2c6d125ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -745,7 +745,7 @@ dependencies = [ "parity-snappy 0.1.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)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", @@ -885,7 +885,7 @@ dependencies = [ "parity-bytes 0.1.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)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_derive 0.1.0", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -993,7 +993,7 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -1149,7 +1149,7 @@ dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", "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)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -1231,7 +1231,7 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2592,7 +2592,7 @@ dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", "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)", + "rand 0.6.1 (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)", ] @@ -2699,7 +2699,7 @@ dependencies = [ "parity-version 2.6.0", "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)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -2796,7 +2796,7 @@ dependencies = [ "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-version 2.6.0", "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)", + "rand 0.6.1 (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)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 52a5cce1fc1..b0a72fd29f1 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] log = "0.4" libc = "0.2" -rand = "0.4" +rand = "0.6" ethkey = { path = "../ethkey" } serde = "1.0" serde_json = "1.0" diff --git a/accounts/ethstore/cli/Cargo.toml b/accounts/ethstore/cli/Cargo.toml index 82858eaa762..80fcb65397f 100644 --- a/accounts/ethstore/cli/Cargo.toml +++ b/accounts/ethstore/cli/Cargo.toml @@ -21,4 +21,4 @@ path = "src/main.rs" doc = false [dev-dependencies] -tempdir = "0.3.5" +tempdir = "0.3" diff --git a/accounts/ethstore/src/random.rs b/accounts/ethstore/src/random.rs index 969c8a366d5..3e2df33b61a 100644 --- a/accounts/ethstore/src/random.rs +++ b/accounts/ethstore/src/random.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 rand::{Rng, OsRng}; +use rand::{Rng, RngCore, rngs::OsRng, distributions::Alphanumeric}; pub trait Random { fn random() -> Self where Self: Sized; @@ -41,5 +41,5 @@ impl Random for [u8; 32] { /// Generate a random string of given length. pub fn random_string(length: usize) -> String { let mut rng = OsRng::new().expect("Not able to operate without random source."); - rng.gen_ascii_chars().take(length).collect() + rng.sample_iter(&Alphanumeric).take(length).collect() } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 83a4ff46c06..62a9a224297 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -55,7 +55,7 @@ parity-snappy = "0.1" parking_lot = "0.7" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" } -rand = "0.4" +rand = "0.6" rayon = "1.0" rlp = { git = "https://github.com/ordian/parity-common" } rlp_derive = { path = "../util/rlp-derive" } @@ -63,7 +63,7 @@ rustc-hex = "1.0" serde = "1.0" serde_derive = "1.0" stats = { path = "../util/stats" } -tempdir = {version="0.3", optional = true} +tempdir = { version = "0.3", optional = true } time-utils = { path = "../util/time-utils" } trace-time = "0.1" triehash-ethereum = { version = "0.2", path = "../util/triehash-ethereum" } diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index d1632fc6ec7..20dec8fdb4c 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -29,7 +29,7 @@ rlp = { git = "https://github.com/ordian/parity-common" } rlp_derive = { path = "../../util/rlp-derive" } smallvec = "0.6" futures = "0.1" -rand = "0.4" +rand = "0.6" itertools = "0.5" bincode = "0.8.0" serde = "1.0" diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 360ba46fd1b..2aa1dd95617 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -33,7 +33,7 @@ use itertools::Itertools; use journaldb; use kvdb::{DBValue, KeyValueDB, DBTransaction}; use parking_lot::{Mutex, RwLock}; -use rand::OsRng; +use rand::rngs::OsRng; use types::transaction::{self, LocalizedTransaction, UnverifiedTransaction, SignedTransaction, Action}; use trie::{TrieSpec, TrieFactory, Trie}; use types::ancestry_action::AncestryAction; @@ -456,7 +456,7 @@ impl Importer { { trace_time!("import_old_block"); // verify the block, passing the chain for updating the epoch verifier. - let mut rng = OsRng::new()?; + let mut rng = OsRng::new().map_err(|e| format!("{}", e))?; self.ancient_verifier.verify(&mut rng, &unverified.header, &chain)?; // Commit results diff --git a/ethcore/src/snapshot/consensus/work.rs b/ethcore/src/snapshot/consensus/work.rs index 106fe4474c0..a3d4da1c2ef 100644 --- a/ethcore/src/snapshot/consensus/work.rs +++ b/ethcore/src/snapshot/consensus/work.rs @@ -34,7 +34,7 @@ use ethereum_types::H256; use kvdb::KeyValueDB; use bytes::Bytes; use rlp::{RlpStream, Rlp}; -use rand::OsRng; +use rand::rngs::OsRng; use types::encoded; /// Snapshot creation and restoration for PoW chains. @@ -210,7 +210,7 @@ impl PowRebuilder { Ok(PowRebuilder { chain: chain, db: db, - rng: OsRng::new()?, + rng: OsRng::new().map_err(|e| format!("{}", e))?, disconnected: Vec::new(), best_number: manifest.block_number, best_hash: manifest.block_hash, diff --git a/ethcore/src/snapshot/mod.rs b/ethcore/src/snapshot/mod.rs index feaca7688c9..155182ed516 100644 --- a/ethcore/src/snapshot/mod.rs +++ b/ethcore/src/snapshot/mod.rs @@ -51,7 +51,7 @@ use super::state_db::StateDB; use super::state::Account as StateAccount; use crossbeam::scope; -use rand::{Rng, OsRng}; +use rand::{Rng, rngs::OsRng}; pub use self::error::Error; diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 20f6670c0f8..c9d0991a3b4 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -28,7 +28,7 @@ log = "0.4" macros = { path = "../../util/macros" } parity-bytes = "0.1" parking_lot = "0.7" -rand = "0.4" +rand = "0.6" rlp = { git = "https://github.com/ordian/parity-common" } trace-time = "0.1" triehash-ethereum = {version = "0.2", path = "../../util/triehash-ethereum" } diff --git a/ethcore/sync/src/chain/mod.rs b/ethcore/sync/src/chain/mod.rs index 8f927236c06..8456fb74f48 100644 --- a/ethcore/sync/src/chain/mod.rs +++ b/ethcore/sync/src/chain/mod.rs @@ -113,7 +113,7 @@ use ethcore::snapshot::{RestorationStatus}; use sync_io::SyncIo; use super::{WarpSync, SyncConfig}; use block_sync::{BlockDownloader, DownloadAction}; -use rand::Rng; +use rand::{Rng, seq::SliceRandom}; use snapshot::{Snapshot}; use api::{EthProtocolInfo as PeerInfoDigest, WARP_SYNC_PROTOCOL_ID, PriorityTask}; use private_tx::PrivateTxHandler; @@ -360,7 +360,7 @@ impl PeerInfo { #[cfg(not(test))] pub mod random { use rand; - pub fn new() -> rand::ThreadRng { rand::thread_rng() } + pub fn new() -> rand::rngs::ThreadRng { rand::thread_rng() } } #[cfg(test)] pub mod random { @@ -559,7 +559,7 @@ impl ChainSync { let mut count = (peers.len() as f64).powf(0.5).round() as usize; count = cmp::min(count, MAX_PEERS_PROPAGATION); count = cmp::max(count, MIN_PEERS_PROPAGATION); - random::new().shuffle(&mut peers); + peers.shuffle(&mut random::new()); peers.truncate(count); peers } @@ -908,7 +908,7 @@ impl ChainSync { self.active_peers.len(), peers.len(), self.peers.len() ); - random::new().shuffle(&mut peers); // TODO (#646): sort by rating + peers.shuffle(&mut random::new()); // TODO (#646): sort by rating // prefer peers with higher protocol version peers.sort_by(|&(_, ref v1), &(_, ref v2)| v1.cmp(v2)); diff --git a/ethcore/sync/src/chain/propagator.rs b/ethcore/sync/src/chain/propagator.rs index c3654553ffd..bb85fc95d2e 100644 --- a/ethcore/sync/src/chain/propagator.rs +++ b/ethcore/sync/src/chain/propagator.rs @@ -22,7 +22,7 @@ use ethereum_types::H256; use fastmap::H256FastSet; use network::client_version::ClientCapabilities; use network::PeerId; -use rand::Rng; +use rand::RngCore; use rlp::{Encodable, RlpStream}; use sync_io::SyncIo; use types::transaction::SignedTransaction; diff --git a/ethcore/sync/src/light_sync/mod.rs b/ethcore/sync/src/light_sync/mod.rs index ccb1ec50489..c37042544d6 100644 --- a/ethcore/sync/src/light_sync/mod.rs +++ b/ethcore/sync/src/light_sync/mod.rs @@ -50,7 +50,7 @@ use light::request::{self, CompleteHeadersRequest as HeadersRequest}; use network::PeerId; use ethereum_types::{H256, U256}; use parking_lot::{Mutex, RwLock}; -use rand::{Rng, OsRng}; +use rand::{rngs::OsRng, seq::SliceRandom}; use futures::sync::mpsc; use self::sync_round::{AbortReason, SyncRound, ResponseContext}; @@ -637,7 +637,7 @@ impl LightSync { // naive request dispatcher: just give to any peer which says it will // give us responses. but only one request per peer per state transition. let dispatcher = move |req: HeadersRequest| { - rng.shuffle(&mut peer_ids); + peer_ids.shuffle(&mut *rng); let request = { let mut builder = request::Builder::default(); diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 6fb672df073..2bc1b4febaa 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -15,7 +15,7 @@ log = "0.4" multihash = "0.8" order-stat = "0.1" parking_lot = "0.7" -rand = "0.4" +rand = "0.6" rustc-hex = "1.0" semver = "0.9" serde = "1.0" diff --git a/rpc/src/authcodes.rs b/rpc/src/authcodes.rs index b348dfd729d..a4f440a71a5 100644 --- a/rpc/src/authcodes.rs +++ b/rpc/src/authcodes.rs @@ -19,8 +19,7 @@ use std::path::Path; use std::{fs, time, mem}; use itertools::Itertools; -use rand::Rng; -use rand::os::OsRng; +use rand::{Rng, rngs::OsRng, distributions::Alphanumeric}; use hash::keccak; use ethereum_types::H256; @@ -175,7 +174,7 @@ impl AuthCodes { /// Generates and returns a new code that can be used by `SignerUIs` pub fn generate_new(&mut self) -> io::Result { let mut rng = OsRng::new()?; - let code = rng.gen_ascii_chars().take(TOKEN_LENGTH).collect::(); + let code = rng.sample_iter(&Alphanumeric).take(TOKEN_LENGTH).collect::(); let readable_code = code.as_bytes() .chunks(4) .filter_map(|f| String::from_utf8(f.to_vec()).ok()) diff --git a/rpc/src/v1/helpers/secretstore.rs b/rpc/src/v1/helpers/secretstore.rs index de563c9ab14..6b90246cde3 100644 --- a/rpc/src/v1/helpers/secretstore.rs +++ b/rpc/src/v1/helpers/secretstore.rs @@ -15,7 +15,7 @@ // along with Parity Ethereum. If not, see . use std::collections::BTreeSet; -use rand::{Rng, OsRng}; +use rand::{RngCore, rngs::OsRng}; use ethereum_types::{H256, H512}; use ethkey::{self, Public, Secret, Random, Generator, math}; use crypto; diff --git a/rpc/src/v1/helpers/subscribers.rs b/rpc/src/v1/helpers/subscribers.rs index 9483d8e3216..e9bd9de0239 100644 --- a/rpc/src/v1/helpers/subscribers.rs +++ b/rpc/src/v1/helpers/subscribers.rs @@ -20,7 +20,7 @@ use std::{ops, str}; use std::collections::HashMap; use jsonrpc_pubsub::{typed::{Subscriber, Sink}, SubscriptionId}; use ethereum_types::H64; -use rand::{Rng, StdRng}; +use rand::{RngCore, rngs::EntropyRng}; #[derive(Debug, Clone, Hash, Eq, PartialEq)] pub struct Id(H64); @@ -42,16 +42,15 @@ impl Id { } } -#[derive(Clone)] pub struct Subscribers { - rand: StdRng, + rand: EntropyRng, subscriptions: HashMap, } impl Default for Subscribers { fn default() -> Self { Subscribers { - rand: StdRng::new().expect("Valid random source is required."), + rand: EntropyRng::new(), subscriptions: HashMap::new(), } } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index e914b89f344..b15a2094a94 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -21,7 +21,7 @@ parity-hash-fetch = { path = "hash-fetch" } parity-path = "0.1" parity-version = { path = "../util/version" } parking_lot = "0.7" -rand = "0.4" +rand = "0.6" semver = "0.9" target_info = "0.1" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index c84e30d9562..55b61479a69 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -11,7 +11,7 @@ futures = "0.1" log = "0.4" mime = "0.3" mime_guess = "2.0.0-alpha.2" -rand = "0.4" +rand = "0.6" rustc-hex = "1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" diff --git a/updater/hash-fetch/src/client.rs b/updater/hash-fetch/src/client.rs index f68095c195b..4b8c781e0dc 100644 --- a/updater/hash-fetch/src/client.rs +++ b/updater/hash-fetch/src/client.rs @@ -177,11 +177,11 @@ impl HashFetch for Client { } fn random_temp_path() -> PathBuf { - use ::rand::Rng; + use rand::{Rng, rngs::OsRng, distributions::Alphanumeric}; use ::std::env; - let mut rng = ::rand::OsRng::new().expect("Reliable random source is required to work."); - let file: String = rng.gen_ascii_chars().take(12).collect(); + let mut rng = OsRng::new().expect("Reliable random source is required to work."); + let file: String = rng.sample_iter(&Alphanumeric).take(12).collect(); let mut path = env::temp_dir(); path.push(file); diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index 106d9748a40..8379bd4c993 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] log = "0.4" mio = "0.6.8" bytes = "0.4" -rand = "0.4" +rand = "0.6" tiny-keccak = "1.4" rust-crypto = "0.2.34" slab = "0.2" From 47f3dbdfe2d55be38d5016ea760ed205e0027496 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 19:27:49 +0200 Subject: [PATCH 50/90] [evm] get rid of num-bigint conversions --- Cargo.lock | 11 -------- ethcore/evm/Cargo.toml | 1 - ethcore/evm/src/interpreter/mod.rs | 40 +++++++++++------------------- ethcore/evm/src/lib.rs | 1 - 4 files changed, 15 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad2c6d125ba..a14b741bfeb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1271,7 +1271,6 @@ dependencies = [ "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", - "num-bigint 0.2.2 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2351,15 +2350,6 @@ dependencies = [ "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "num-bigint" -version = "0.2.2" -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)", -] - [[package]] name = "num-integer" version = "0.1.39" @@ -4644,7 +4634,6 @@ dependencies = [ "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" "checksum num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" -"checksum num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "57450397855d951f1a41305e54851b1a7b8f5d2e349543a02a2effe25459f718" "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "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" diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 888fadf55d0..985921d2e05 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -14,7 +14,6 @@ vm = { path = "../vm" } keccak-hash = { git = "https://github.com/ordian/parity-common" } parking_lot = "0.7" memory-cache = { path = "../../util/memory-cache" } -num-bigint = "0.2" [dev-dependencies] rustc-hex = "1.0" diff --git a/ethcore/evm/src/interpreter/mod.rs b/ethcore/evm/src/interpreter/mod.rs index 4ff6dad88ca..492f6b59731 100644 --- a/ethcore/evm/src/interpreter/mod.rs +++ b/ethcore/evm/src/interpreter/mod.rs @@ -26,10 +26,11 @@ mod shared_cache; use std::marker::PhantomData; use std::{cmp, mem}; use std::sync::Arc; +use std::convert::TryFrom; use hash::keccak; use bytes::Bytes; -use ethereum_types::{U256, H256, Address, BigEndianHash}; -use num_bigint::BigUint; +use ethereum_types::{U256, U512, H256, Address, BigEndianHash}; + use vm::{ self, ActionParams, ParamsType, ActionValue, CallType, MessageCallResult, @@ -62,17 +63,6 @@ const TWO_POW_96: U256 = U256([0, 0x100000000, 0, 0]); //0x1 00000000 00000000 0 const TWO_POW_224: U256 = U256([0, 0, 0, 0x100000000]); //0x1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 const TWO_POW_248: U256 = U256([0, 0, 0, 0x100000000000000]); //0x1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000000 -fn to_biguint(x: U256) -> BigUint { - let mut bytes = [0u8; 32]; - x.to_little_endian(&mut bytes); - BigUint::from_bytes_le(&bytes) -} - -fn from_biguint(x: BigUint) -> U256 { - let bytes = x.to_bytes_le(); - U256::from_little_endian(&bytes) -} - /// Abstraction over raw vector of Bytes. Easier state management of PC. struct CodeReader { position: ProgramCounter, @@ -1021,12 +1011,12 @@ impl Interpreter { let c = self.stack.pop_back(); self.stack.push(if !c.is_zero() { - let a_num = to_biguint(a); - let b_num = to_biguint(b); - let c_num = to_biguint(c); - let res = a_num + b_num; - let x = res % c_num; - from_biguint(x) + let a_512 = U512::from(a); + let b_512 = U512::from(b); + let c_512 = U512::from(c); + let res = a_512 + b_512; + let x = res % c_512; + U256::try_from(x).expect("U512 % U256 fits U256; qed") } else { U256::zero() }); @@ -1037,12 +1027,12 @@ impl Interpreter { let c = self.stack.pop_back(); self.stack.push(if !c.is_zero() { - let a_num = to_biguint(a); - let b_num = to_biguint(b); - let c_num = to_biguint(c); - let res = a_num * b_num; - let x = res % c_num; - from_biguint(x) + let a_512 = U512::from(a); + let b_512 = U512::from(b); + let c_512 = U512::from(c); + let res = a_512 * b_512; + let x = res % c_512; + U256::try_from(x).expect("U512 % U256 fits U256; qed") } else { U256::zero() }); diff --git a/ethcore/evm/src/lib.rs b/ethcore/evm/src/lib.rs index 03871864d54..3548a1fe5e5 100644 --- a/ethcore/evm/src/lib.rs +++ b/ethcore/evm/src/lib.rs @@ -24,7 +24,6 @@ extern crate vm; extern crate keccak_hash as hash; extern crate memory_cache; extern crate parity_bytes as bytes; -extern crate num_bigint; #[macro_use] extern crate lazy_static; From 3abcbc263a1e1a6f61c297f7b94aec86107f1e07 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 20:55:00 +0200 Subject: [PATCH 51/90] [ethcore] downgrade trie-standardmap and criterion --- Cargo.lock | 344 +++++++++++++++++++++++++++++++++++---------- ethcore/Cargo.toml | 2 +- 2 files changed, 271 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a14b741bfeb..a2611a6884f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,6 +32,15 @@ dependencies = [ "xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "argon2rs" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "arrayref" version = "0.3.5" @@ -146,6 +155,15 @@ name = "bitflags" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "block-buffer" version = "0.3.3" @@ -312,40 +330,56 @@ dependencies = [ "unexpected 0.1.0", ] +[[package]] +name = "constant_time_eq" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "criterion" -version = "0.2.11" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion-plot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-stats 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "csv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.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)", - "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "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.3 (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)", - "tinytemplate 1.0.2 (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.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "criterion-plot" -version = "0.3.1" +version = "0.2.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)", "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion-stats" +version = "0.2.5" +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.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)", ] [[package]] @@ -538,6 +572,16 @@ dependencies = [ "journaldb 0.2.0", ] +[[package]] +name = "dirs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "docopt" version = "1.0.2" @@ -664,7 +708,7 @@ dependencies = [ name = "ethash" version = "1.12.0" dependencies = [ - "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "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.6.0 (git+https://github.com/ordian/parity-common)", @@ -678,6 +722,18 @@ dependencies = [ "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethbloom" +version = "0.5.3" +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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.2.5 (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)", +] + [[package]] name = "ethbloom" version = "0.6.4" @@ -699,7 +755,7 @@ dependencies = [ "bn 0.4.4 (git+https://github.com/paritytech/bn)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", - "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", @@ -758,7 +814,7 @@ dependencies = [ "time-utils 0.1.0", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-standardmap 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-standardmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "triehash-ethereum 0.2.0", "unexpected 0.1.0", "using_queue 0.1.0", @@ -1156,6 +1212,19 @@ dependencies = [ "triehash-ethereum 0.2.0", ] +[[package]] +name = "ethereum-types" +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.3 (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.5 (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" version = "0.6.0" @@ -1169,6 +1238,14 @@ dependencies = [ "uint 0.7.1 (git+https://github.com/ordian/parity-common)", ] +[[package]] +name = "ethereum-types-serialize" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ethjson" version = "0.1.0" @@ -1264,7 +1341,7 @@ name = "evm" version = "0.1.0" dependencies = [ "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion 0.2.11 (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.6.0 (git+https://github.com/ordian/parity-common)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", @@ -1373,6 +1450,16 @@ dependencies = [ "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fixed-hash" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fixed-hash" version = "0.3.2" @@ -1509,22 +1596,24 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "hash-db" -version = "0.11.0" +name = "handlebars" +version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "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.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 = "hash-db" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hash256-std-hasher" -version = "0.12.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "heapsize" @@ -1750,11 +1839,11 @@ dependencies = [ ] [[package]] -name = "itertools" -version = "0.8.0" +name = "itertools-num" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1948,6 +2037,15 @@ dependencies = [ "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "keccak-hash" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "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)", +] + [[package]] name = "keccak-hash" version = "0.2.0" @@ -1967,16 +2065,6 @@ dependencies = [ "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "keccak-hasher" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hash256-std-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "kernel32-sys" version = "0.2.2" @@ -2935,6 +3023,21 @@ name = "percent-encoding" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "pest" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pest_derive" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "petgraph" version = "0.4.13" @@ -3109,6 +3212,11 @@ name = "quick-error" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "quote" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "quote" version = "0.6.8" @@ -3240,15 +3348,6 @@ dependencies = [ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_xoshiro" -version = "0.1.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)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rayon" version = "1.0.3" @@ -3291,6 +3390,17 @@ dependencies = [ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "redox_users" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "regex" version = "0.2.11" @@ -3371,6 +3481,17 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rlp" +version = "0.2.4" +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.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rlp" version = "0.3.0" @@ -3500,6 +3621,11 @@ name = "scoped-tls" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "scopeguard" version = "0.3.3" @@ -3583,6 +3709,16 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "simplelog" +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.6 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "siphasher" version = "0.1.3" @@ -3668,6 +3804,16 @@ name = "strsim" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "syn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "0.15.26" @@ -3678,6 +3824,14 @@ dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "synom" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "synstructure" version = "0.10.1" @@ -3703,6 +3857,16 @@ dependencies = [ "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "term" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "term_size" version = "0.3.1" @@ -3757,6 +3921,11 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "thread-scoped" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "thread_local" version = "0.3.6" @@ -3803,15 +3972,6 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tinytemplate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "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 = "tokio" version = "0.1.11" @@ -4086,12 +4246,13 @@ dependencies = [ [[package]] name = "trie-standardmap" -version = "0.12.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hasher 0.12.2 (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)", ] [[package]] @@ -4132,6 +4293,17 @@ name = "ucd-util" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "uint" +version = "0.4.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)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "uint" version = "0.7.1" @@ -4186,6 +4358,11 @@ name = "unicode-width" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -4465,6 +4642,7 @@ dependencies = [ "checksum ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b3568b48b7cefa6b8ce125f9bb4989e52fbcc29ebea88df04cc7c5f12f70455" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)" = "" +"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae7d751998c189c1d4468cf0a39bb2eae052a9c58d50ebb3b9591ee3813ad50" @@ -4481,6 +4659,7 @@ dependencies = [ "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" +"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" "checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum bn 0.4.4 (git+https://github.com/paritytech/bn)" = "" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" @@ -4496,8 +4675,10 @@ dependencies = [ "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" "checksum combine 3.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc1d011beeed29187b8db2ac3925c8dd4d3e87db463dc9d2d2833985388fc5bc" -"checksum criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0363053954f3e679645fc443321ca128b7b950a6fe288cf5f9335cc22ee58394" -"checksum criterion-plot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76f9212ddf2f4a9eb2d401635190600656a1f88a932ef53d06e7fa4c7e02fb8e" +"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" +"checksum criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c47d2b548c5647e1a436dc0cb78d4ebf51b6bf7ab101ed76662828bdd4d3a24a" +"checksum criterion-plot 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5f81689739e463ece7a6b62c6ec63bdab5c4e28fe05ff451769e87d1511411" +"checksum criterion-stats 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ff43cac80562f91ead0b617c1be74edf350adfaa195809d355de98dfc8f9237d" "checksum crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7408247b1b87f480890f28b670c5f8d9a8a4274833433fe74dc0dfd46d33650" "checksum crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b85741761b7f160bc5e7e0c14986ef685b7f8bf9b7ad081c60c604bb4649827" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" @@ -4518,6 +4699,7 @@ dependencies = [ "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 dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" "checksum docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db2906c2579b5b7207fc1e328796a9a8835dc44e22dbe8e460b1d636f9a7b225" "checksum edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3bd26878c3d921f89797a4e1a1711919f999a9f6946bb6f5a4ffda126d297b7e" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" @@ -4529,13 +4711,17 @@ dependencies = [ "checksum ethabi 8.0.0 (git+https://github.com/ordian/ethabi)" = "" "checksum ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)" = "" "checksum ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)" = "" +"checksum ethbloom 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6294da962646baa738414e8e718d1a1f0360a51d92de89ccbf91870418f5360" "checksum ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)" = "" +"checksum ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e742184dc63a01c8ea0637369f8faa27c40f537949908a237f95c05e68d2c96" "checksum ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)" = "" +"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" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" +"checksum fixed-hash 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7afe6ce860afb14422711595a7b26ada9ed7de2f43c0b2ab79d09ee196287273" "checksum fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)" = "" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" @@ -4553,9 +4739,8 @@ dependencies = [ "checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865" "checksum h2 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "a27e7ed946e8335bdf9a191bc1b9b14a03ba822d013d2f58437f4fabcbd7fc2c" "checksum hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1" +"checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd" "checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" -"checksum hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ba7fb417e5c470acdd61068c79767d0e65962e70836cf6c9dfd2409f06345ce0" -"checksum hash256-std-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b2027c19ec91eb304999abae7307d225cf93be42af53b0039f76e98ed5af86" "checksum heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)" = "" "checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" "checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa" @@ -4579,7 +4764,7 @@ dependencies = [ "checksum ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)" = "70783119ac90828aaba91eae39db32c6c1b8838deea3637e5238efa0130801ab" "checksum itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4833d6978da405305126af4ac88569b5d71ff758581ce5a987dbfa3755f694fc" "checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" -"checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" +"checksum itertools-num 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a872a22f9e6f7521ca557660adb96dd830e54f0f490fa115bb55dd69d38b27e7" "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum jemalloc-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "bfc62c8e50e381768ce8ee0428ee53741929f7ebd73e4d83f669bcf7693e00ae" "checksum jemallocator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9f0cd42ac65f758063fea55126b0148b1ce0a6354ff78e07a4d6806bc65c4ab3" @@ -4595,8 +4780,8 @@ dependencies = [ "checksum jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3372b3248a53abcca8f61924f188052bb0c4cd80b482b2b4eaf9f8667efb9f4" "checksum jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c873dac37a601fb88d40ba49eeac3f1aa60953c06b2e99ddbf0569b6f8028478" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" +"checksum keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "253bbe643c32c816bf58fa5a88248fafedeebb139705ad17a62add3517854a86" "checksum keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)" = "" -"checksum keccak-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "af672553b2abac1c86c29fd62c79880638b6abc91d96db4aa42a5baab2bc1ca9" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" "checksum kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45bcdf5eb083602cff61a6f8438dce2a7900d714e893fc48781c39fb119d37aa" @@ -4663,6 +4848,8 @@ dependencies = [ "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" +"checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc" +"checksum pest_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3294f437119209b084c797604295f40227cffa35c57220b1e99a6ff3bf8ee4" "checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" "checksum phf 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "cec29da322b242f4c3098852c77a0ca261c9c01b806cae85a5572a1eb94db9a6" "checksum phf_codegen 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "7d187f00cd98d5afbcd8898f6cf181743a449162aeb329dcd2f3849009e605ad" @@ -4680,6 +4867,7 @@ dependencies = [ "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" "checksum pwasm-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e9135bed7b452e20dbb395a2d519abaf0c46d60e7ecc02daeeab447d29bada1" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" @@ -4694,12 +4882,12 @@ dependencies = [ "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" "checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929" "checksum rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "373814f27745b2686b350dd261bfd24576a6fb0e2c5919b3a2b6005f820b0473" "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "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 redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828" "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" "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" @@ -4707,6 +4895,7 @@ dependencies = [ "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" +"checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" "checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" "checksum rlp 0.4.0 (git+https://github.com/ordian/parity-common)" = "" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" @@ -4722,6 +4911,7 @@ dependencies = [ "checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" "checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c" "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" +"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "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" @@ -4733,6 +4923,7 @@ dependencies = [ "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" "checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" +"checksum simplelog 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e95345f185d5adeb8ec93459d2dc99654e294cc6ccf5b75414d8ea262de9a13" "checksum siphasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "833011ca526bd88f16778d32c699d325a9ad302fa06381cd66f7be63351d3f6d" "checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum skeptic 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24ebf8a06f5f8bae61ae5bbc7af7aac4ef6907ae975130faba1199e5fe82256a" @@ -4746,22 +4937,25 @@ dependencies = [ "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" +"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9" +"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" "checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" +"checksum thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcbb6aa301e5d3b0b5ef639c9a9c7e2f1c944f177b460c04dc24c69b1fa2bd99" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" "checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" "checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" -"checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" @@ -4786,12 +4980,13 @@ dependencies = [ "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 trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" -"checksum trie-standardmap 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e4e24277af05f38f3aaf03ac78e3a154be83f13db9c8ef0cb95bb1aa764a477b" +"checksum trie-standardmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e26f52976a57a0859616d6fcec87092ac35d08eabbd78dc3dabee93b480ea5f" "checksum triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d26efb4ddf87870fc08dc9a6580dc3061be350d7b9d0eb30aef1c8b4227aa46" "checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" +"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" "checksum uint 0.7.1 (git+https://github.com/ordian/parity-common)" = "" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" @@ -4799,6 +4994,7 @@ dependencies = [ "checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" "checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 62a9a224297..71d981bd227 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -82,7 +82,7 @@ kvdb-rocksdb = "0.1.3" parity-runtime = { path = "../util/runtime" } rlp_compress = { path = "../util/rlp-compress" } tempdir = "0.3" -trie-standardmap = "0.12.2" +trie-standardmap = "0.1.1" [features] parity = ["work-notify", "price-info", "stratum"] From cde92b894c32bae783d06ff5cda6656b4fc52253 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 24 May 2019 21:08:52 +0200 Subject: [PATCH 52/90] [ethcore] fix some warnings --- Cargo.lock | 1 + ethcore/Cargo.toml | 1 + ethcore/src/lib.rs | 2 ++ ethcore/src/miner/miner.rs | 1 - ethcore/src/snapshot/tests/helpers.rs | 1 - ethcore/src/snapshot/tests/state.rs | 3 ++- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2611a6884f..eb08e972ffe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -802,6 +802,7 @@ dependencies = [ "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "rlp_compress 0.1.0", diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 71d981bd227..892a5f9bb91 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -71,6 +71,7 @@ unexpected = { path = "../util/unexpected" } using_queue = { path = "../miner/using-queue" } vm = { path = "vm" } wasm = { path = "wasm" } +rand_xorshift = "0.1.1" [dev-dependencies] blooms-db = { path = "../util/blooms-db" } diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 463d22fd427..315cd0bb5ed 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -107,6 +107,8 @@ extern crate using_queue; extern crate vm; extern crate wasm; +#[cfg(test)] +extern crate rand_xorshift; #[cfg(test)] extern crate ethcore_accounts as accounts; #[cfg(feature = "stratum")] diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index ec269c03e12..c8764ef2ddb 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -1737,7 +1737,6 @@ mod tests { #[cfg(feature = "price-info")] fn dynamic_gas_pricer() -> GasPricer { - use std::time::Duration; use parity_runtime::Executor; use fetch::Client as FetchClient; use ethcore_miner::gas_price_calibrator::{GasPriceCalibrator, GasPriceCalibratorOptions}; diff --git a/ethcore/src/snapshot/tests/helpers.rs b/ethcore/src/snapshot/tests/helpers.rs index 817e0249986..5d2e8616b00 100644 --- a/ethcore/src/snapshot/tests/helpers.rs +++ b/ethcore/src/snapshot/tests/helpers.rs @@ -157,7 +157,6 @@ pub fn restore( genesis: &[u8], ) -> Result<(), ::error::Error> { use std::sync::atomic::AtomicBool; - use snappy; let flag = AtomicBool::new(true); let components = engine.snapshot_components().unwrap(); diff --git a/ethcore/src/snapshot/tests/state.rs b/ethcore/src/snapshot/tests/state.rs index 7855b3d68eb..3b0a0dd042a 100644 --- a/ethcore/src/snapshot/tests/state.rs +++ b/ethcore/src/snapshot/tests/state.rs @@ -28,7 +28,8 @@ use super::helpers::StateProducer; use error::Error; -use rand::{XorShiftRng, SeedableRng}; +use rand::SeedableRng; +use rand_xorshift::XorShiftRng; use ethereum_types::H256; use journaldb::{self, Algorithm}; use kvdb_rocksdb::{Database, DatabaseConfig}; From f4d16d72d913da6ddbe9d0787bafd1198c963822 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 27 May 2019 11:15:15 +0200 Subject: [PATCH 53/90] [ethcore] fix compilation in tests --- Cargo.lock | 7 +- accounts/ethstore/tests/util/transient_dir.rs | 2 +- ethcore/evm/src/interpreter/mod.rs | 9 +- ethcore/evm/src/tests.rs | 8 +- ethcore/light/src/net/tests/mod.rs | 16 +- ethcore/light/src/on_demand/request.rs | 6 +- ethcore/light/src/types/request/batch.rs | 6 +- ethcore/node-filter/src/lib.rs | 14 +- ethcore/private-tx/src/log.rs | 29 +- ethcore/private-tx/tests/private_contract.rs | 2 +- ethcore/src/block.rs | 2 +- ethcore/src/client/client.rs | 13 +- ethcore/src/engines/authority_round/mod.rs | 6 +- ethcore/src/engines/block_reward.rs | 19 +- ethcore/src/engines/clique/tests.rs | 6 +- ethcore/src/engines/validator_set/contract.rs | 4 +- ethcore/src/ethereum/ethash.rs | 10 +- ethcore/src/ethereum/mod.rs | 23 +- ethcore/src/executive.rs | 54 +-- ethcore/src/externalities.rs | 15 +- ethcore/src/json_tests/executive.rs | 5 +- ethcore/src/json_tests/test_common.rs | 1 + ethcore/src/machine/impls.rs | 3 +- ethcore/src/miner/miner.rs | 2 +- ethcore/src/pod_account.rs | 31 +- ethcore/src/pod_state.rs | 28 +- ethcore/src/snapshot/block.rs | 4 +- ethcore/src/snapshot/tests/helpers.rs | 1 + .../src/snapshot/tests/proof_of_authority.rs | 2 +- ethcore/src/snapshot/tests/state.rs | 6 +- ethcore/src/snapshot/watcher.rs | 4 +- ethcore/src/spec/spec.rs | 9 +- ethcore/src/state/account.rs | 39 +- ethcore/src/state/mod.rs | 406 +++++++++--------- ethcore/src/state/substate.rs | 12 +- ethcore/src/tests/evm.rs | 16 +- ethcore/src/tests/trace.rs | 5 +- ethcore/src/trace/db.rs | 38 +- ethcore/src/trace/types/filter.rs | 106 ++--- ethcore/src/tx_filter.rs | 17 +- ethcore/src/verification/verification.rs | 4 +- ethcore/sync/Cargo.toml | 1 + ethcore/sync/src/chain/mod.rs | 4 +- ethcore/sync/src/lib.rs | 1 + 44 files changed, 524 insertions(+), 472 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb08e972ffe..d42461c7d57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1207,6 +1207,7 @@ dependencies = [ "parity-runtime 0.1.0", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", "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)", @@ -3281,7 +3282,7 @@ name = "rand_chacha" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3308,7 +3309,7 @@ name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3346,7 +3347,7 @@ name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/accounts/ethstore/tests/util/transient_dir.rs b/accounts/ethstore/tests/util/transient_dir.rs index 67511a9b99b..90fe7303b07 100644 --- a/accounts/ethstore/tests/util/transient_dir.rs +++ b/accounts/ethstore/tests/util/transient_dir.rs @@ -16,7 +16,7 @@ use std::path::PathBuf; use std::{env, fs}; -use rand::{Rng, OsRng}; +use rand::{RngCore, rngs::OsRng}; use ethstore::accounts_dir::{KeyDirectory, RootDiskDirectory}; use ethstore::{Error, SafeAccount}; diff --git a/ethcore/evm/src/interpreter/mod.rs b/ethcore/evm/src/interpreter/mod.rs index 492f6b59731..d81891d6e1b 100644 --- a/ethcore/evm/src/interpreter/mod.rs +++ b/ethcore/evm/src/interpreter/mod.rs @@ -1189,6 +1189,7 @@ mod tests { use factory::Factory; use vm::{self, Exec, ActionParams, ActionValue}; use vm::tests::{FakeExt, test_finalize}; + use ethereum_types::Address; fn interpreter(params: ActionParams, ext: &vm::Ext) -> Box { Factory::new(VMType::Interpreter, 1).create(params, ext.schedule(), ext.depth()) @@ -1199,13 +1200,13 @@ mod tests { let code = "7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000620f120660406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055".from_hex().unwrap(); let mut params = ActionParams::default(); - params.address = 5.into(); + params.address = Address::from_low_u64_be(5); params.gas = 300_000.into(); params.gas_price = 1.into(); params.value = ActionValue::Transfer(100_000.into()); params.code = Some(Arc::new(code)); let mut ext = FakeExt::new(); - ext.balances.insert(5.into(), 1_000_000_000.into()); + ext.balances.insert(Address::from_low_u64_be(5), 1_000_000_000.into()); ext.tracing = true; let gas_left = { @@ -1222,12 +1223,12 @@ mod tests { let code = "6001600160000360003e00".from_hex().unwrap(); let mut params = ActionParams::default(); - params.address = 5.into(); + params.address = Address::from_low_u64_be(5); params.gas = 300_000.into(); params.gas_price = 1.into(); params.code = Some(Arc::new(code)); let mut ext = FakeExt::new_byzantium(); - ext.balances.insert(5.into(), 1_000_000_000.into()); + ext.balances.insert(Address::from_low_u64_be(5), 1_000_000_000.into()); ext.tracing = true; let err = { diff --git a/ethcore/evm/src/tests.rs b/ethcore/evm/src/tests.rs index c33db5c0d63..245b68b69fe 100644 --- a/ethcore/evm/src/tests.rs +++ b/ethcore/evm/src/tests.rs @@ -726,8 +726,8 @@ evm_test!{test_calls: test_calls_int} fn test_calls(factory: super::Factory) { let code = "600054602d57600160005560006000600060006050610998610100f160006000600060006050610998610100f25b".from_hex().unwrap(); - let address = Address::from(0x155); - let code_address = Address::from(0x998); + let address = Address::from_low_u64_be(0x155); + let code_address = Address::from_low_u64_be(0x998); let mut params = ActionParams::default(); params.gas = U256::from(150_000); params.code = Some(Arc::new(code)); @@ -772,7 +772,7 @@ evm_test!{test_create_in_staticcall: test_create_in_staticcall_int} fn test_create_in_staticcall(factory: super::Factory) { let code = "600060006064f000".from_hex().unwrap(); - let address = Address::from(0x155); + let address = Address::from_low_u64_be(0x155); let mut params = ActionParams::default(); params.gas = U256::from(100_000); params.code = Some(Arc::new(code)); @@ -1066,5 +1066,5 @@ fn assert_set_contains(set: &HashSet, val: } fn assert_store(ext: &FakeExt, pos: u64, val: &str) { - assert_eq!(ext.store.get(&H256::from(pos)).unwrap(), &H256::from_str(val).unwrap()); + assert_eq!(ext.store.get(&H256::from_low_u64_be(pos)).unwrap(), &H256::from_str(val).unwrap()); } diff --git a/ethcore/light/src/net/tests/mod.rs b/ethcore/light/src/net/tests/mod.rs index 2ca7477f2b7..95fb21adc14 100644 --- a/ethcore/light/src/net/tests/mod.rs +++ b/ethcore/light/src/net/tests/mod.rs @@ -22,7 +22,7 @@ use common_types::encoded; use common_types::ids::BlockId; use common_types::transaction::{Action, PendingTransaction}; use ethcore::client::{EachBlockWith, TestBlockChainClient}; -use ethereum_types::{H256, U256, Address}; +use ethereum_types::{H256, U256, Address, BigEndianHash}; use net::context::IoContext; use net::load_timer::MOVING_SAMPLE_SIZE; use net::status::{Capabilities, Status}; @@ -158,7 +158,7 @@ impl Provider for TestProvider { fn contract_code(&self, req: request::CompleteCodeRequest) -> Option { Some(CodeResponse { - code: req.block_hash.iter().chain(req.code_hash.iter()).cloned().collect(), + code: req.block_hash.as_bytes().iter().chain(req.code_hash.as_bytes().iter()).cloned().collect(), }) } @@ -472,8 +472,8 @@ fn get_state_proofs() { } let req_id = 112; - let key1: H256 = U256::from(11223344).into(); - let key2: H256 = U256::from(99988887).into(); + let key1: H256 = BigEndianHash::from_uint(U256::from(11223344)); + let key2: H256 = BigEndianHash::from_uint(U256::from(99988887)); let mut builder = Builder::default(); builder.push(Request::Account(IncompleteAccountRequest { @@ -529,8 +529,8 @@ fn get_contract_code() { } let req_id = 112; - let key1: H256 = U256::from(11223344).into(); - let key2: H256 = U256::from(99988887).into(); + let key1: H256 = BigEndianHash::from_uint(U256::from(11223344)); + let key2: H256 = BigEndianHash::from_uint(U256::from(99988887)); let request = Request::Code(IncompleteCodeRequest { block_hash: key1.into(), @@ -541,7 +541,7 @@ fn get_contract_code() { let request_body = make_packet(req_id, &requests); let response = { let response = vec![Response::Code(CodeResponse { - code: key1.iter().chain(key2.iter()).cloned().collect(), + code: key1.as_bytes().iter().chain(key2.as_bytes().iter()).cloned().collect(), })]; let new_creds = *flow_params.limit() - flow_params.compute_cost_multi(requests.requests()).unwrap(); @@ -755,7 +755,7 @@ fn get_transaction_index() { } let req_id = 112; - let key1: H256 = U256::from(11223344).into(); + let key1: H256 = BigEndianHash::from_uint(U256::from(11223344)); let request = Request::TransactionIndex(IncompleteTransactionIndexRequest { hash: key1.into(), diff --git a/ethcore/light/src/on_demand/request.rs b/ethcore/light/src/on_demand/request.rs index 56fa124a2aa..33a30c69699 100644 --- a/ethcore/light/src/on_demand/request.rs +++ b/ethcore/light/src/on_demand/request.rs @@ -1298,17 +1298,17 @@ mod tests { let mut trie = SecTrieDBMut::new(&mut db, &mut root); for _ in 0..100 { let address = Address::random(); - trie.insert(&*address, &rand_acc()).unwrap(); + trie.insert(address.as_bytes(), &rand_acc()).unwrap(); } - trie.insert(&*addr, &rand_acc()).unwrap(); + trie.insert(addr.as_bytes(), &rand_acc()).unwrap(); } let proof = { let trie = SecTrieDB::new(&db, &root).unwrap(); let mut recorder = Recorder::new(); - trie.get_with(&*addr, &mut recorder).unwrap().unwrap(); + trie.get_with(addr.as_bytes(), &mut recorder).unwrap().unwrap(); recorder.drain().into_iter().map(|r| r.data).collect::>() }; diff --git a/ethcore/light/src/types/request/batch.rs b/ethcore/light/src/types/request/batch.rs index 63641b5daa8..f9df01a4ed2 100644 --- a/ethcore/light/src/types/request/batch.rs +++ b/ethcore/light/src/types/request/batch.rs @@ -267,7 +267,7 @@ mod tests { })).unwrap(); let mut batch = builder.build(); - batch.requests[1].fill(|_req_idx, _out_idx| Ok(Output::Hash(42.into()))); + batch.requests[1].fill(|_req_idx, _out_idx| Ok(Output::Hash(H256::from_low_u64_be(42)))); assert!(batch.next_complete().is_some()); batch.answered += 1; @@ -289,7 +289,7 @@ mod tests { assert!(batch.next_complete().is_some()); let hdr_proof_res = header_proof::Response { proof: vec![], - hash: 12.into(), + hash: H256::from_low_u64_be(12), td: 21.into(), }; batch.supply_response_unchecked(&hdr_proof_res); @@ -308,7 +308,7 @@ mod tests { })).unwrap(); let mut batch = builder.build(); - batch.requests[1].fill(|_req_idx, _out_idx| Ok(Output::Hash(42.into()))); + batch.requests[1].fill(|_req_idx, _out_idx| Ok(Output::Hash(H256::from_low_u64_be(42)))); assert!(batch.next_complete().is_some()); batch.answered += 1; diff --git a/ethcore/node-filter/src/lib.rs b/ethcore/node-filter/src/lib.rs index db158cbe740..17b46c6a5f3 100644 --- a/ethcore/node-filter/src/lib.rs +++ b/ethcore/node-filter/src/lib.rs @@ -135,11 +135,13 @@ mod test { use io::IoChannel; use super::NodeFilter; use tempdir::TempDir; + use ethereum_types::Address; + use std::str::FromStr; /// Contract code: https://gist.github.com/arkpar/467dbcc73cbb85b0997a7a10ffa0695f #[test] fn node_filter() { - let contract_addr = "0000000000000000000000000000000000000005".into(); + let contract_addr = Address::from_str("0000000000000000000000000000000000000005").unwrap(); let data = include_bytes!("../res/node_filter.json"); let tempdir = TempDir::new("").unwrap(); let spec = Spec::load(&tempdir.path(), &data[..]).unwrap(); @@ -153,11 +155,11 @@ mod test { IoChannel::disconnected(), ).unwrap(); let filter = NodeFilter::new(Arc::downgrade(&client) as Weak, contract_addr); - let self1: NodeId = "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002".into(); - let self2: NodeId = "00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003".into(); - let node1: NodeId = "00000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000012".into(); - let node2: NodeId = "00000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000022".into(); - let nodex: NodeId = "77000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into(); + let self1 = NodeId::from_str("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002").unwrap(); + let self2 = NodeId::from_str("00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003").unwrap(); + let node1 = NodeId::from_str("00000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000012").unwrap(); + let node2 = NodeId::from_str("00000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000022").unwrap(); + let nodex = NodeId::from_str("77000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); assert!(filter.connection_allowed(&self1, &node1, ConnectionDirection::Inbound)); assert!(filter.connection_allowed(&self1, &nodex, ConnectionDirection::Inbound)); diff --git a/ethcore/private-tx/src/log.rs b/ethcore/private-tx/src/log.rs index d836dfa3654..3663dd32917 100644 --- a/ethcore/private-tx/src/log.rs +++ b/ethcore/private-tx/src/log.rs @@ -292,10 +292,11 @@ impl Drop for Logging { mod tests { use serde_json; use error::Error; - use ethereum_types::H256; + use ethereum_types::{H256, Address}; use std::collections::{HashMap, BTreeMap}; use std::sync::Arc; use std::time::{SystemTime, Duration}; + use std::str::FromStr; use types::transaction::Transaction; use parking_lot::RwLock; use super::{TransactionLog, Logging, PrivateTxStatus, LogsSerializer, ValidatorLog}; @@ -360,8 +361,8 @@ mod tests { let logger = Logging::new(Arc::new(StringLogSerializer::new("".into()))); let private_tx = Transaction::default(); let hash = private_tx.hash(None); - logger.private_tx_created(&hash, &vec!["0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1".into()]); - logger.signature_added(&hash, &"0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1".into()); + logger.private_tx_created(&hash, &vec![Address::from_str("0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()]); + logger.signature_added(&hash, &Address::from_str("0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()); logger.tx_deployed(&hash, &hash); let tx_log = logger.tx_log(&hash).unwrap(); assert_eq!(tx_log.status, PrivateTxStatus::Deployed); @@ -371,38 +372,38 @@ mod tests { fn serialization() { let current_timestamp = SystemTime::now(); let initial_validator_log = ValidatorLog { - account: "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1".into(), + account: Address::from_str("0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap(), validation_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(1)).unwrap()), }; let initial_log = TransactionLog { - tx_hash: "0x64f648ca7ae7f4138014f860ae56164d8d5732969b1cea54d8be9d144d8aa6f6".into(), + tx_hash: H256::from_str("0x64f648ca7ae7f4138014f860ae56164d8d5732969b1cea54d8be9d144d8aa6f6").unwrap(), status: PrivateTxStatus::Deployed, creation_timestamp: current_timestamp, validators: vec![initial_validator_log], deployment_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(2)).unwrap()), - public_tx_hash: Some("0x69b9c691ede7993effbcc88911c309af1c82be67b04b3882dd446b808ae146da".into()), + public_tx_hash: Some(H256::from_str("0x69b9c691ede7993effbcc88911c309af1c82be67b04b3882dd446b808ae146da").unwrap()), }; let serializer = Arc::new(StringLogSerializer::new(serde_json::to_string(&vec![initial_log.clone()]).unwrap())); let logger = Logging::new(serializer.clone()); - let hash: H256 = "0x63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6".into(); - logger.private_tx_created(&hash, &vec!["0x7ffbe3512782069be388f41be4d8eb350672d3a5".into()]); - logger.signature_added(&hash, &"0x7ffbe3512782069be388f41be4d8eb350672d3a5".into()); - logger.tx_deployed(&hash, &"0xde2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7".into()); + let hash = H256::from_str("0x63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6").unwrap(); + logger.private_tx_created(&hash, &vec![Address::from_str("0x7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap()]); + logger.signature_added(&hash, &Address::from_str("0x7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap()); + logger.tx_deployed(&hash, &H256::from_str("0xde2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7").unwrap()); drop(logger); let added_validator_log = ValidatorLog { - account: "0x7ffbe3512782069be388f41be4d8eb350672d3a5".into(), + account: Address::from_str("0x7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap(), validation_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(7)).unwrap()), }; let added_log = TransactionLog { - tx_hash: "0x63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6".into(), + tx_hash: H256::from_str("0x63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6").unwrap(), status: PrivateTxStatus::Deployed, creation_timestamp: current_timestamp.checked_add(Duration::from_secs(6)).unwrap(), validators: vec![added_validator_log], deployment_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(8)).unwrap()), - public_tx_hash: Some("0xde2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7".into()), + public_tx_hash: Some(H256::from_str("0xde2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7").unwrap()), }; let should_be_final = vec![added_log, initial_log]; let deserialized_logs: Vec = serde_json::from_str(&serializer.log()).unwrap(); assert_eq!(deserialized_logs, should_be_final); } -} \ No newline at end of file +} diff --git a/ethcore/private-tx/tests/private_contract.rs b/ethcore/private-tx/tests/private_contract.rs index 5d760fe0706..3bb854285b3 100644 --- a/ethcore/private-tx/tests/private_contract.rs +++ b/ethcore/private-tx/tests/private_contract.rs @@ -231,7 +231,7 @@ fn call_other_private_contract() { trace!("Creating private contract B"); // Build constructor data let mut deploy_data = "6060604052341561000f57600080fd5b6040516020806101c583398101604052808051906020019091905050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061014a8061007b6000396000f300606060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680635197c7aa14610046575b600080fd5b341561005157600080fd5b61005961006f565b6040518082815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c55699c6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156100fe57600080fd5b6102c65a03f1151561010f57600080fd5b505050604051805190509050905600a165627a7a723058207f8994e02725b47d76ec73e5c54a338d27b306dd1c830276bff2d75fcd1a5c920029000000000000000000000000".to_string(); - deploy_data.push_str(&address_a.to_vec().to_hex()); + deploy_data.push_str(&address_a.as_bytes().to_vec().to_hex()); let private_contract_b_test = deploy_data.from_hex().unwrap(); let mut private_create_tx2 = Transaction::default(); private_create_tx2.action = Action::Create; diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs index 613929f4ddc..fcecc53ab88 100644 --- a/ethcore/src/block.rs +++ b/ethcore/src/block.rs @@ -603,7 +603,7 @@ mod tests { db, parent, last_hashes, - Address::new(), + Address::zero(), (3141562.into(), 31415620.into()), vec![], false, diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 2aa1dd95617..597e94ed62c 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -2602,6 +2602,7 @@ fn transaction_receipt( #[cfg(test)] mod tests { + use ethereum_types::{H256, Address}; #[test] fn should_not_cache_details_before_commit() { @@ -2677,19 +2678,19 @@ mod tests { use types::transaction::{Transaction, LocalizedTransaction, Action}; // given - let key = KeyPair::from_secret_slice(&keccak("test")).unwrap(); + let key = KeyPair::from_secret_slice(keccak("test").as_bytes()).unwrap(); let secret = key.secret(); let machine = ::ethereum::new_frontier_test_machine(); let block_number = 1; - let block_hash = 5.into(); - let state_root = 99.into(); + let block_hash = H256::from_low_u64_be(5); + let state_root = H256::from_low_u64_be(99); let gas_used = 10.into(); let raw_tx = Transaction { nonce: 0.into(), gas_price: 0.into(), gas: 21000.into(), - action: Action::Call(10.into()), + action: Action::Call(Address::from_low_u64_be(10)), value: 0.into(), data: vec![], }; @@ -2702,11 +2703,11 @@ mod tests { cached_sender: Some(tx1.sender()), }; let logs = vec![LogEntry { - address: 5.into(), + address: Address::from_low_u64_be(5), topics: vec![], data: vec![], }, LogEntry { - address: 15.into(), + address: Address::from_low_u64_be(15), topics: vec![], data: vec![], }]; diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index b3ea7c1210d..1564087d53e 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -2090,7 +2090,7 @@ mod tests { let signature = tap.sign(addr1, Some("1".into()), header.bare_hash()).unwrap(); // empty step with invalid step - let empty_steps = vec![SealedEmptyStep { signature: 0.into(), step: 2 }]; + let empty_steps = vec![SealedEmptyStep { signature: H520::zero(), step: 2 }]; set_empty_steps_seal(&mut header, 2, &signature, &empty_steps); assert_insufficient_proof( @@ -2099,7 +2099,7 @@ mod tests { ); // empty step with invalid signature - let empty_steps = vec![SealedEmptyStep { signature: 0.into(), step: 1 }]; + let empty_steps = vec![SealedEmptyStep { signature: H520::zero(), step: 1 }]; set_empty_steps_seal(&mut header, 2, &signature, &empty_steps); assert_insufficient_proof( @@ -2241,7 +2241,7 @@ mod tests { p.maximum_empty_steps = 0; }); - let parent_hash: H256 = 1.into(); + let parent_hash = H256::from_low_u64_be(1); let signature = H520::default(); let step = |step: u64| EmptyStep { step, diff --git a/ethcore/src/engines/block_reward.rs b/ethcore/src/engines/block_reward.rs index 58b55408ebe..42b08560fe8 100644 --- a/ethcore/src/engines/block_reward.rs +++ b/ethcore/src/engines/block_reward.rs @@ -177,8 +177,9 @@ pub fn apply_block_rewards( #[cfg(test)] mod test { + use std::str::FromStr; use client::PrepareOpenBlock; - use ethereum_types::U256; + use ethereum_types::{U256, Address}; use spec::Spec; use test_helpers::generate_dummy_client_with_spec; @@ -193,12 +194,12 @@ mod test { // the spec has a block reward contract defined at the given address let block_reward_contract = BlockRewardContract::new_from_address( - "0000000000000000000000000000000000000042".into(), + Address::from_str("0000000000000000000000000000000000000042").unwrap(), ); let mut call = |to, data| { let mut block = client.prepare_open_block( - "0000000000000000000000000000000000000001".into(), + Address::from_str("0000000000000000000000000000000000000001").unwrap(), (3141562.into(), 31415620.into()), vec![], ).unwrap(); @@ -223,16 +224,16 @@ mod test { // the contract rewards (1000 + kind) for each benefactor let beneficiaries = vec![ - ("0000000000000000000000000000000000000033".into(), RewardKind::Author), - ("0000000000000000000000000000000000000034".into(), RewardKind::Uncle(1)), - ("0000000000000000000000000000000000000035".into(), RewardKind::EmptyStep), + (Address::from_str("0000000000000000000000000000000000000033").unwrap(), RewardKind::Author), + (Address::from_str("0000000000000000000000000000000000000034").unwrap(), RewardKind::Uncle(1)), + (Address::from_str("0000000000000000000000000000000000000035").unwrap(), RewardKind::EmptyStep), ]; let rewards = block_reward_contract.reward(&beneficiaries, &mut call).unwrap(); let expected = vec![ - ("0000000000000000000000000000000000000033".into(), U256::from(1000)), - ("0000000000000000000000000000000000000034".into(), U256::from(1000 + 101)), - ("0000000000000000000000000000000000000035".into(), U256::from(1000 + 2)), + (Address::from_str("0000000000000000000000000000000000000033").unwrap(), U256::from(1000)), + (Address::from_str("0000000000000000000000000000000000000034").unwrap(), U256::from(1000 + 101)), + (Address::from_str("0000000000000000000000000000000000000035").unwrap(), U256::from(1000 + 2)), ]; assert_eq!(expected, rewards); diff --git a/ethcore/src/engines/clique/tests.rs b/ethcore/src/engines/clique/tests.rs index f1189dbd4e5..76140284f6d 100644 --- a/ethcore/src/engines/clique/tests.rs +++ b/ethcore/src/engines/clique/tests.rs @@ -70,10 +70,10 @@ impl CliqueTester { let mut extra_data = vec![0; VANITY_LENGTH]; for &signer in SIGNER_TAGS.iter() { - let secret = Secret::from(H256::from(signer as u64)); + let secret = Secret::from(H256::from_low_u64_be(signer as u64)); let keypair = KeyPair::from_secret(secret).unwrap(); if initial_signers.contains(&signer) { - extra_data.extend(&*keypair.address()); + extra_data.extend(keypair.address().as_bytes()); } signers.insert(signer, keypair); } @@ -151,7 +151,7 @@ impl CliqueTester { CliqueBlockType::Checkpoint => { let signers = self.clique.state(&last_header).unwrap().signers().clone(); for signer in signers { - extra_data.extend(&*signer); + extra_data.extend(signer.as_bytes()); } } CliqueBlockType::Vote(v) => seal = v.as_rlp(), diff --git a/ethcore/src/engines/validator_set/contract.rs b/ethcore/src/engines/validator_set/contract.rs index f0064a8c206..dbf92ce4b59 100644 --- a/ethcore/src/engines/validator_set/contract.rs +++ b/ethcore/src/engines/validator_set/contract.rs @@ -175,7 +175,7 @@ mod tests { // Check a block that is a bit in future, reject it but don't report the validator. let mut header = Header::default(); - let seal = vec![encode(&4u8), encode(&(&H520::default() as &[u8]))]; + let seal = vec![encode(&4u8), encode(&H520::zero().as_bytes())]; header.set_seal(seal); header.set_author(v1); header.set_number(2); @@ -186,7 +186,7 @@ mod tests { // Now create one that is more in future. That one should be rejected and validator should be reported. let mut header = Header::default(); - let seal = vec![encode(&8u8), encode(&(&H520::default() as &[u8]))]; + let seal = vec![encode(&8u8), encode(&H520::zero().as_bytes())]; header.set_seal(seal); header.set_author(v1); header.set_number(2); diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index f2fb0703828..f2f0d000364 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -591,7 +591,7 @@ mod tests { let last_hashes = Arc::new(vec![genesis_header.hash()]); let mut b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap(); let mut uncle = Header::new(); - let uncle_author: Address = "ef2d6d194084c2de36e0dabfce45d046b37d1106".into(); + let uncle_author = Address::from_str("ef2d6d194084c2de36e0dabfce45d046b37d1106").unwrap(); uncle.set_author(uncle_author); b.push_uncle(uncle).unwrap(); @@ -610,8 +610,8 @@ mod tests { let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap(); let b = b.close().unwrap(); - let ubi_contract: Address = "00efdd5883ec628983e9063c7d969fe268bbf310".into(); - let dev_contract: Address = "00756cf8159095948496617f5fb17ed95059f536".into(); + let ubi_contract = Address::from_str("00efdd5883ec628983e9063c7d969fe268bbf310").unwrap(); + let dev_contract = Address::from_str("00756cf8159095948496617f5fb17ed95059f536").unwrap(); assert_eq!(b.state.balance(&Address::zero()).unwrap(), U256::from_str("d8d726b7177a80000").unwrap()); assert_eq!(b.state.balance(&ubi_contract).unwrap(), U256::from_str("2b5e3af16b1880000").unwrap()); assert_eq!(b.state.balance(&dev_contract).unwrap(), U256::from_str("c249fdd327780000").unwrap()); @@ -721,7 +721,7 @@ mod tests { fn can_do_proof_of_work_unordered_verification_fail() { let engine = test_spec().engine; let mut header: Header = Header::default(); - header.set_seal(vec![rlp::encode(&H256::from("b251bd2e0283d0658f2cadfdc8ca619b5de94eca5742725e2e757dd13ed7503d")), rlp::encode(&H64::zero())]); + header.set_seal(vec![rlp::encode(&H256::from_str("b251bd2e0283d0658f2cadfdc8ca619b5de94eca5742725e2e757dd13ed7503d").unwrap()), rlp::encode(&H64::zero())]); header.set_difficulty(U256::from_str("ffffffffffffffffffffffffffffffffffffffffffffaaaaaaaaaaaaaaaaaaaa").unwrap()); let verify_result = engine.verify_block_unordered(&header); @@ -914,7 +914,7 @@ mod tests { let tempdir = TempDir::new("").unwrap(); let ethash = Ethash::new(tempdir.path(), ethparams, machine, None); let mut header = Header::default(); - header.set_seal(vec![rlp::encode(&H256::from("b251bd2e0283d0658f2cadfdc8ca619b5de94eca5742725e2e757dd13ed7503d")), rlp::encode(&H64::zero())]); + header.set_seal(vec![rlp::encode(&H256::from_str("b251bd2e0283d0658f2cadfdc8ca619b5de94eca5742725e2e757dd13ed7503d").unwrap()), rlp::encode(&H64::zero())]); let info = ethash.extra_info(&header); assert_eq!(info["nonce"], "0x0000000000000000"); assert_eq!(info["mixHash"], "0xb251bd2e0283d0658f2cadfdc8ca619b5de94eca5742725e2e757dd13ed7503d"); diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index d85fbf9b7b2..38bf970a825 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -187,7 +187,8 @@ pub fn new_kovan_wasm_test_machine() -> EthereumMachine { load_machine(include_b #[cfg(test)] mod tests { - use ethereum_types::U256; + use std::str::FromStr; + use ethereum_types::{U256, H256, Address}; use state::*; use super::*; use test_helpers::get_temp_state_db; @@ -201,21 +202,21 @@ mod tests { let genesis_header = spec.genesis_header(); let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap(); let s = State::from_existing(db, genesis_header.state_root().clone(), engine.account_start_nonce(0), Default::default()).unwrap(); - assert_eq!(s.balance(&"0000000000000000000000000000000000000001".into()).unwrap(), 1u64.into()); - assert_eq!(s.balance(&"0000000000000000000000000000000000000002".into()).unwrap(), 1u64.into()); - assert_eq!(s.balance(&"0000000000000000000000000000000000000003".into()).unwrap(), 1u64.into()); - assert_eq!(s.balance(&"0000000000000000000000000000000000000004".into()).unwrap(), 1u64.into()); - assert_eq!(s.balance(&"102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c".into()).unwrap(), U256::from(1u64) << 200); - assert_eq!(s.balance(&"0000000000000000000000000000000000000000".into()).unwrap(), 0u64.into()); + assert_eq!(s.balance(&Address::from_str("0000000000000000000000000000000000000001").unwrap()).unwrap(), 1u64.into()); + assert_eq!(s.balance(&Address::from_str("0000000000000000000000000000000000000002").unwrap()).unwrap(), 1u64.into()); + assert_eq!(s.balance(&Address::from_str("0000000000000000000000000000000000000003").unwrap()).unwrap(), 1u64.into()); + assert_eq!(s.balance(&Address::from_str("0000000000000000000000000000000000000004").unwrap()).unwrap(), 1u64.into()); + assert_eq!(s.balance(&Address::from_str("102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c").unwrap()).unwrap(), U256::from(1u64) << 200); + assert_eq!(s.balance(&Address::from_str("0000000000000000000000000000000000000000").unwrap()).unwrap(), 0u64.into()); } #[test] fn morden() { let morden = new_morden(&::std::env::temp_dir()); - assert_eq!(morden.state_root(), "f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9".into()); + assert_eq!(morden.state_root(), H256::from_str("f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9").unwrap()); let genesis = morden.genesis_block(); - assert_eq!(view!(BlockView, &genesis).header_view().hash(), "0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303".into()); + assert_eq!(view!(BlockView, &genesis).header_view().hash(), H256::from_str("0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303").unwrap()); let _ = morden.engine; } @@ -224,9 +225,9 @@ mod tests { fn frontier() { let frontier = new_foundation(&::std::env::temp_dir()); - assert_eq!(frontier.state_root(), "d7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544".into()); + assert_eq!(frontier.state_root(), H256::from_str("d7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544").unwrap()); let genesis = frontier.genesis_block(); - assert_eq!(view!(BlockView, &genesis).header_view().hash(), "d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3".into()); + assert_eq!(view!(BlockView, &genesis).header_view().hash(), H256::from_str("d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3").unwrap()); let _ = frontier.engine; } diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index 8bebc46af03..4f0aaee64ab 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -1175,7 +1175,7 @@ mod tests { use rustc_hex::FromHex; use ethkey::{Generator, Random}; use super::*; - use ethereum_types::{H256, U256, U512, Address}; + use ethereum_types::{H256, U256, U512, Address, BigEndianHash}; use vm::{ActionParams, ActionValue, CallType, EnvInfo, CreateContractAddress}; use evm::{Factory, VMType}; use error::ExecutionError; @@ -1230,7 +1230,7 @@ mod tests { }; assert_eq!(gas_left, U256::from(79_975)); - assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), H256::from(&U256::from(0xf9u64))); + assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), BigEndianHash::from_uint(&U256::from(0xf9u64))); assert_eq!(state.balance(&sender).unwrap(), U256::from(0xf9)); assert_eq!(state.balance(&address).unwrap(), U256::from(0x7)); assert_eq!(substate.contracts_created.len(), 0); @@ -1332,8 +1332,8 @@ mod tests { assert_eq!(tracer.drain(), vec![FlatTrace { action: trace::Action::Call(trace::Call { - from: "4444444444444444444444444444444444444444".into(), - to: "5555555555555555555555555555555555555555".into(), + from: Address::from_str("4444444444444444444444444444444444444444").unwrap(), + to: Address::from_str("5555555555555555555555555555555555555555").unwrap(), value: 100.into(), gas: 100_000.into(), input: vec![], @@ -1347,8 +1347,8 @@ mod tests { trace_address: Default::default() }, FlatTrace { action: trace::Action::Call(trace::Call { - from: "5555555555555555555555555555555555555555".into(), - to: "0000000000000000000000000000000000000003".into(), + from: Address::from_str("5555555555555555555555555555555555555555").unwrap(), + to: Address::from_str("0000000000000000000000000000000000000003").unwrap(), value: 1.into(), gas: 66560.into(), input: vec![], @@ -1422,8 +1422,8 @@ mod tests { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "cd1722f3947def4cf144679da39c4c32bdc35681".into(), - to: "b010143a42d5980c7e5ef0e4a4416dc098a4fed3".into(), + from: Address::from_str("cd1722f3947def4cf144679da39c4c32bdc35681").unwrap(), + to: Address::from_str("b010143a42d5980c7e5ef0e4a4416dc098a4fed3").unwrap(), value: 100.into(), gas: 100000.into(), input: vec![], @@ -1437,7 +1437,7 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Create(trace::Create { - from: "b010143a42d5980c7e5ef0e4a4416dc098a4fed3".into(), + from: Address::from_str("b010143a42d5980c7e5ef0e4a4416dc098a4fed3").unwrap(), value: 23.into(), gas: 67979.into(), init: vec![96, 16, 128, 96, 12, 96, 0, 57, 96, 0, 243, 0, 96, 0, 53, 84, 21, 96, 9, 87, 0, 91, 96, 32, 53, 96, 0, 53, 85] @@ -1538,8 +1538,8 @@ mod tests { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "cd1722f3947def4cf144679da39c4c32bdc35681".into(), - to: "b010143a42d5980c7e5ef0e4a4416dc098a4fed3".into(), + from: Address::from_str("cd1722f3947def4cf144679da39c4c32bdc35681").unwrap(), + to: Address::from_str("b010143a42d5980c7e5ef0e4a4416dc098a4fed3").unwrap(), value: 100.into(), gas: 100_000.into(), input: vec![], @@ -1553,7 +1553,7 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Create(trace::Create { - from: "b010143a42d5980c7e5ef0e4a4416dc098a4fed3".into(), + from: Address::from_str("b010143a42d5980c7e5ef0e4a4416dc098a4fed3").unwrap(), value: 23.into(), gas: 66_917.into(), init: vec![0x60, 0x01, 0x60, 0x00, 0xfd] @@ -1804,7 +1804,13 @@ mod tests { }; assert_eq!(gas_left, U256::from(73_237)); - assert_eq!(state.storage_at(&address_a, &H256::from(&U256::from(0x23))).unwrap(), H256::from(&U256::from(1))); + assert_eq!( + state.storage_at( + &address_a, + &BigEndianHash::from_uint(&U256::from(0x23)), + ).unwrap(), + BigEndianHash::from_uint(&U256::from(1)), + ); } // test is incorrect, mk @@ -1849,8 +1855,8 @@ mod tests { }; assert_eq!(gas_left, U256::from(59_870)); - assert_eq!(state.storage_at(&address, &H256::from(&U256::zero())).unwrap(), H256::from(&U256::from(1))); - assert_eq!(state.storage_at(&address, &H256::from(&U256::one())).unwrap(), H256::from(&U256::from(1))); + assert_eq!(state.storage_at(&address, &BigEndianHash::from_uint(&U256::zero())).unwrap(), BigEndianHash::from_uint(&U256::from(1))); + assert_eq!(state.storage_at(&address, &BigEndianHash::from_uint(&U256::one())).unwrap(), BigEndianHash::from_uint(&U256::from(1))); } // test is incorrect, mk @@ -1891,7 +1897,7 @@ mod tests { assert_eq!(state.balance(&sender).unwrap(), U256::from(1)); assert_eq!(state.balance(&contract).unwrap(), U256::from(17)); assert_eq!(state.nonce(&sender).unwrap(), U256::from(1)); - assert_eq!(state.storage_at(&contract, &H256::zero()).unwrap(), H256::from(&U256::from(1))); + assert_eq!(state.storage_at(&contract, &H256::zero()).unwrap(), BigEndianHash::from_uint(&U256::from(1))); } evm_test!{test_transact_invalid_nonce: test_transact_invalid_nonce_int} @@ -2060,16 +2066,16 @@ mod tests { assert_eq!(result, U256::from(1)); assert_eq!(output[..], returns[..]); - assert_eq!(state.storage_at(&contract_address, &H256::from(&U256::zero())).unwrap(), H256::from(&U256::from(0))); + assert_eq!(state.storage_at(&contract_address, &H256::zero()).unwrap(), H256::zero()); } evm_test!{test_eip1283: test_eip1283_int} fn test_eip1283(factory: Factory) { - let x1 = Address::from(0x1000); - let x2 = Address::from(0x1001); - let y1 = Address::from(0x2001); - let y2 = Address::from(0x2002); - let operating_address = Address::from(0); + let x1 = Address::from_low_u64_be(0x1000); + let x2 = Address::from_low_u64_be(0x1001); + let y1 = Address::from_low_u64_be(0x2001); + let y2 = Address::from_low_u64_be(0x2002); + let operating_address = Address::zero(); let k = H256::zero(); let mut state = get_temp_state_with_factory(factory.clone()); @@ -2086,7 +2092,7 @@ mod tests { let machine = ::ethereum::new_constantinople_test_machine(); let schedule = machine.schedule(info.number); - assert_eq!(state.storage_at(&operating_address, &k).unwrap(), H256::from(U256::from(0))); + assert_eq!(state.storage_at(&operating_address, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0))); // Test a call via top-level -> y1 -> x1 let (FinalizationResult { gas_left, .. }, refund, gas) = { let gas = U256::from(0xffffffffffu64); @@ -2104,7 +2110,7 @@ mod tests { assert_eq!(gas_used, U256::from(41860)); assert_eq!(refund, 19800); - assert_eq!(state.storage_at(&operating_address, &k).unwrap(), H256::from(U256::from(1))); + assert_eq!(state.storage_at(&operating_address, &k).unwrap(), BigEndianHash::from_uint(&U256::from(1))); // Test a call via top-level -> y2 -> x2 let (FinalizationResult { gas_left, .. }, refund, gas) = { let gas = U256::from(0xffffffffffu64); diff --git a/ethcore/src/externalities.rs b/ethcore/src/externalities.rs index 4dab9b3d5b5..050605aaa6c 100644 --- a/ethcore/src/externalities.rs +++ b/ethcore/src/externalities.rs @@ -429,6 +429,7 @@ mod tests { use test_helpers::get_temp_state; use super::*; use trace::{NoopTracer, NoopVMTracer}; + use std::str::FromStr; fn get_test_origin() -> OriginInfo { OriginInfo { @@ -442,7 +443,7 @@ mod tests { fn get_test_env_info() -> EnvInfo { EnvInfo { number: 100, - author: 0.into(), + author: Address::from_low_u64_be(0), timestamp: 0, difficulty: 0.into(), last_hashes: Arc::new(vec![]), @@ -510,7 +511,7 @@ mod tests { #[test] fn can_return_block_hash() { - let test_hash = H256::from("afafafafafafafafafafafbcbcbcbcbcbcbcbcbcbeeeeeeeeeeeeedddddddddd"); + let test_hash = H256::from_str("afafafafafafafafafafafbcbcbcbcbcbcbcbcbcbeeeeeeeeeeeeedddddddddd").unwrap(); let test_env_number = 0x120001; let mut setup = TestSetup::new(); @@ -547,11 +548,11 @@ mod tests { // this should panic because we have no balance on any account ext.call( &"0000000000000000000000000000000000000000000000000000000000120000".parse::().unwrap(), - &Address::new(), - &Address::new(), + &Address::zero(), + &Address::zero(), Some("0000000000000000000000000000000000000000000000000000000000150000".parse::().unwrap()), &[], - &Address::new(), + &Address::zero(), CallType::Call, false, ).ok().unwrap(); @@ -560,7 +561,7 @@ mod tests { #[test] fn can_log() { let log_data = vec![120u8, 110u8]; - let log_topics = vec![H256::from("af0fa234a6af46afa23faf23bcbc1c1cb4bcb7bcbe7e7e7ee3ee2edddddddddd")]; + let log_topics = vec![H256::from_str("af0fa234a6af46afa23faf23bcbc1c1cb4bcb7bcbe7e7e7ee3ee2edddddddddd").unwrap()]; let mut setup = TestSetup::new(); let state = &mut setup.state; @@ -578,7 +579,7 @@ mod tests { #[test] fn can_suicide() { - let refund_account = &Address::new(); + let refund_account = &Address::zero(); let mut setup = TestSetup::new(); let state = &mut setup.state; diff --git a/ethcore/src/json_tests/executive.rs b/ethcore/src/json_tests/executive.rs index cd9e8f2aece..dafc29e41fd 100644 --- a/ethcore/src/json_tests/executive.rs +++ b/ethcore/src/json_tests/executive.rs @@ -35,6 +35,7 @@ use ethtrie; use rlp::RlpStream; use hash::keccak; use machine::EthereumMachine as Machine; +use ethereum_types::BigEndianHash; use super::HookType; @@ -339,8 +340,8 @@ fn do_json_test_for(vm_type: &VMType, json_data: &[u8] for (k, v) in account.storage { let key: U256 = k.into(); let value: U256 = v.into(); - let found_storage = try_fail!(state.storage_at(&address, &From::from(key))); - fail_unless(found_storage == From::from(value), "storage is incorrect"); + let found_storage = try_fail!(state.storage_at(&address, &BigEndianHash::from_uint(&key))); + fail_unless(found_storage == BigEndianHash::from_uint(&value), "storage is incorrect"); } } diff --git a/ethcore/src/json_tests/test_common.rs b/ethcore/src/json_tests/test_common.rs index 7e3842ecb75..521b6d4eca1 100644 --- a/ethcore/src/json_tests/test_common.rs +++ b/ethcore/src/json_tests/test_common.rs @@ -111,6 +111,7 @@ macro_rules! test { } } +/// Declares a test #[macro_export] macro_rules! declare_test { (skip => $arr: expr, $id: ident, $name: expr) => { diff --git a/ethcore/src/machine/impls.rs b/ethcore/src/machine/impls.rs index 17959506070..4962f1ea25f 100644 --- a/ethcore/src/machine/impls.rs +++ b/ethcore/src/machine/impls.rs @@ -462,12 +462,13 @@ fn round_block_gas_limit(gas_limit: U256, lower_limit: U256, upper_limit: U256) #[cfg(test)] mod tests { use super::*; + use std::str::FromStr; fn get_default_ethash_extensions() -> EthashExtensions { EthashExtensions { homestead_transition: 1150000, dao_hardfork_transition: u64::max_value(), - dao_hardfork_beneficiary: "0000000000000000000000000000000000000001".into(), + dao_hardfork_beneficiary: Address::from_str("0000000000000000000000000000000000000001").unwrap(), dao_hardfork_accounts: Vec::new(), } } diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index c8764ef2ddb..7eacdb45692 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -1491,7 +1491,7 @@ mod tests { // when new block is imported let client = generate_dummy_client(2); - let imported = [0.into()]; + let imported = [H256::zero()]; let empty = &[]; miner.chain_new_blocks(&*client, &imported, empty, &imported, empty, false); diff --git a/ethcore/src/pod_account.rs b/ethcore/src/pod_account.rs index b4d1586208d..c02074f95f9 100644 --- a/ethcore/src/pod_account.rs +++ b/ethcore/src/pod_account.rs @@ -184,6 +184,7 @@ mod test { use std::collections::BTreeMap; use types::account_diff::*; use super::{PodAccount, diff_pod}; + use ethereum_types::H256; #[test] fn existence() { @@ -227,24 +228,40 @@ mod test { balance: 0.into(), nonce: 0.into(), code: Some(vec![]), - storage: map_into![1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 0, 6 => 0, 7 => 0] + storage: map![ + H256::from_low_u64_be(1) => H256::from_low_u64_be(1), + H256::from_low_u64_be(2) => H256::from_low_u64_be(2), + H256::from_low_u64_be(3) => H256::from_low_u64_be(3), + H256::from_low_u64_be(4) => H256::from_low_u64_be(4), + H256::from_low_u64_be(5) => H256::from_low_u64_be(0), + H256::from_low_u64_be(6) => H256::from_low_u64_be(0), + H256::from_low_u64_be(7) => H256::from_low_u64_be(0) + ], }; let b = PodAccount { balance: 0.into(), nonce: 0.into(), code: Some(vec![]), - storage: map_into![1 => 1, 2 => 3, 3 => 0, 5 => 0, 7 => 7, 8 => 0, 9 => 9] + storage: map![ + H256::from_low_u64_be(1) => H256::from_low_u64_be(1), + H256::from_low_u64_be(2) => H256::from_low_u64_be(3), + H256::from_low_u64_be(3) => H256::from_low_u64_be(0), + H256::from_low_u64_be(5) => H256::from_low_u64_be(0), + H256::from_low_u64_be(7) => H256::from_low_u64_be(7), + H256::from_low_u64_be(8) => H256::from_low_u64_be(0), + H256::from_low_u64_be(9) => H256::from_low_u64_be(9) + ] }; assert_eq!(diff_pod(Some(&a), Some(&b)), Some(AccountDiff { balance: Diff::Same, nonce: Diff::Same, code: Diff::Same, storage: map![ - 2.into() => Diff::new(2.into(), 3.into()), - 3.into() => Diff::new(3.into(), 0.into()), - 4.into() => Diff::new(4.into(), 0.into()), - 7.into() => Diff::new(0.into(), 7.into()), - 9.into() => Diff::new(0.into(), 9.into()) + H256::from_low_u64_be(2) => Diff::new(H256::from_low_u64_be(2), H256::from_low_u64_be(3)), + H256::from_low_u64_be(3) => Diff::new(H256::from_low_u64_be(3), H256::from_low_u64_be(0)), + H256::from_low_u64_be(4) => Diff::new(H256::from_low_u64_be(4), H256::from_low_u64_be(0)), + H256::from_low_u64_be(7) => Diff::new(H256::from_low_u64_be(0), H256::from_low_u64_be(7)), + H256::from_low_u64_be(9) => Diff::new(H256::from_low_u64_be(0), H256::from_low_u64_be(9)) ], })); } diff --git a/ethcore/src/pod_state.rs b/ethcore/src/pod_state.rs index c1130faa726..1c5ecc8400e 100644 --- a/ethcore/src/pod_state.rs +++ b/ethcore/src/pod_state.rs @@ -90,12 +90,12 @@ mod test { use types::state_diff::*; use types::account_diff::*; use pod_account::PodAccount; - use super::PodState; + use super::{PodState, Address}; #[test] fn create_delete() { let a = PodState::from(map![ - 1.into() => PodAccount { + Address::from_low_u64_be(1) => PodAccount { balance: 69.into(), nonce: 0.into(), code: Some(Vec::new()), @@ -103,7 +103,7 @@ mod test { } ]); assert_eq!(super::diff_pod(&a, &PodState::new()), StateDiff { raw: map![ - 1.into() => AccountDiff{ + Address::from_low_u64_be(1) => AccountDiff{ balance: Diff::Died(69.into()), nonce: Diff::Died(0.into()), code: Diff::Died(vec![]), @@ -111,7 +111,7 @@ mod test { } ]}); assert_eq!(super::diff_pod(&PodState::new(), &a), StateDiff{ raw: map![ - 1.into() => AccountDiff{ + Address::from_low_u64_be(1) => AccountDiff{ balance: Diff::Born(69.into()), nonce: Diff::Born(0.into()), code: Diff::Born(vec![]), @@ -123,7 +123,7 @@ mod test { #[test] fn create_delete_with_unchanged() { let a = PodState::from(map![ - 1.into() => PodAccount { + Address::from_low_u64_be(1) => PodAccount { balance: 69.into(), nonce: 0.into(), code: Some(Vec::new()), @@ -131,13 +131,13 @@ mod test { } ]); let b = PodState::from(map![ - 1.into() => PodAccount { + Address::from_low_u64_be(1) => PodAccount { balance: 69.into(), nonce: 0.into(), code: Some(Vec::new()), storage: map![], }, - 2.into() => PodAccount { + Address::from_low_u64_be(2) => PodAccount { balance: 69.into(), nonce: 0.into(), code: Some(Vec::new()), @@ -145,7 +145,7 @@ mod test { } ]); assert_eq!(super::diff_pod(&a, &b), StateDiff { raw: map![ - 2.into() => AccountDiff{ + Address::from_low_u64_be(2) => AccountDiff{ balance: Diff::Born(69.into()), nonce: Diff::Born(0.into()), code: Diff::Born(vec![]), @@ -153,7 +153,7 @@ mod test { } ]}); assert_eq!(super::diff_pod(&b, &a), StateDiff { raw: map![ - 2.into() => AccountDiff{ + Address::from_low_u64_be(2) => AccountDiff{ balance: Diff::Died(69.into()), nonce: Diff::Died(0.into()), code: Diff::Died(vec![]), @@ -165,13 +165,13 @@ mod test { #[test] fn change_with_unchanged() { let a = PodState::from(map![ - 1.into() => PodAccount { + Address::from_low_u64_be(1) => PodAccount { balance: 69.into(), nonce: 0.into(), code: Some(Vec::new()), storage: map![], }, - 2.into() => PodAccount { + Address::from_low_u64_be(2) => PodAccount { balance: 69.into(), nonce: 0.into(), code: Some(Vec::new()), @@ -179,13 +179,13 @@ mod test { } ]); let b = PodState::from(map![ - 1.into() => PodAccount { + Address::from_low_u64_be(1) => PodAccount { balance: 69.into(), nonce: 1.into(), code: Some(Vec::new()), storage: map![], }, - 2.into() => PodAccount { + Address::from_low_u64_be(2) => PodAccount { balance: 69.into(), nonce: 0.into(), code: Some(Vec::new()), @@ -193,7 +193,7 @@ mod test { } ]); assert_eq!(super::diff_pod(&a, &b), StateDiff { raw: map![ - 1.into() => AccountDiff{ + Address::from_low_u64_be(1) => AccountDiff{ balance: Diff::Same, nonce: Diff::Changed(0.into(), 1.into()), code: Diff::Same, diff --git a/ethcore/src/snapshot/block.rs b/ethcore/src/snapshot/block.rs index 08dce8cf6ac..f19b2611be4 100644 --- a/ethcore/src/snapshot/block.rs +++ b/ethcore/src/snapshot/block.rs @@ -177,7 +177,7 @@ mod tests { gas: U256::from(50_000), value: U256::from(1), data: b"Hello!".to_vec() - }.fake_sign(Address::from(0x69)); + }.fake_sign(Address::from_low_u64_be(0x69)); let t2 = Transaction { action: Action::Create, @@ -186,7 +186,7 @@ mod tests { gas: U256::from(300000), value: U256::from(1000000000), data: "Eep!".into(), - }.fake_sign(Address::from(0x55)); + }.fake_sign(Address::from_low_u64_be(0x55)); b.transactions.push(t1.into()); b.transactions.push(t2.into()); diff --git a/ethcore/src/snapshot/tests/helpers.rs b/ethcore/src/snapshot/tests/helpers.rs index 5d2e8616b00..55ed8d8109e 100644 --- a/ethcore/src/snapshot/tests/helpers.rs +++ b/ethcore/src/snapshot/tests/helpers.rs @@ -124,6 +124,7 @@ pub fn fill_storage(mut db: AccountDBMut, root: &mut H256, seed: &mut H256) { SecTrieDBMut::from_existing(&mut db, root).unwrap() }; + // TODO: upgrade trie_standardmap for (k, v) in map.make_with(seed) { trie.insert(&k, &v).unwrap(); } diff --git a/ethcore/src/snapshot/tests/proof_of_authority.rs b/ethcore/src/snapshot/tests/proof_of_authority.rs index f1610e6ccda..f16357b0f37 100644 --- a/ethcore/src/snapshot/tests/proof_of_authority.rs +++ b/ethcore/src/snapshot/tests/proof_of_authority.rs @@ -126,7 +126,7 @@ fn make_chain(accounts: Arc, blocks_beyond: usize, transitions: nonce: *nonce, gas_price: 1.into(), gas: 21_000.into(), - action: Action::Call(Address::new()), + action: Action::Call(Address::zero()), value: 1.into(), data: Vec::new(), }.sign(&*RICH_SECRET, client.signing_chain_id()); diff --git a/ethcore/src/snapshot/tests/state.rs b/ethcore/src/snapshot/tests/state.rs index 3b0a0dd042a..91042438971 100644 --- a/ethcore/src/snapshot/tests/state.rs +++ b/ethcore/src/snapshot/tests/state.rs @@ -36,11 +36,13 @@ use kvdb_rocksdb::{Database, DatabaseConfig}; use parking_lot::Mutex; use tempdir::TempDir; +const RNG_SEED: [u8; 16] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; + #[test] fn snap_and_restore() { use hash_db::HashDB; let mut producer = StateProducer::new(); - let mut rng = XorShiftRng::from_seed([1, 2, 3, 4]); + let mut rng = XorShiftRng::from_seed(RNG_SEED); let mut old_db = journaldb::new_memory_db(); let db_cfg = DatabaseConfig::with_columns(::db::NUM_COLUMNS); @@ -158,7 +160,7 @@ fn get_code_from_prev_chunk() { #[test] fn checks_flag() { let mut producer = StateProducer::new(); - let mut rng = XorShiftRng::from_seed([5, 6, 7, 8]); + let mut rng = XorShiftRng::from_seed(RNG_SEED); let mut old_db = journaldb::new_memory_db(); let db_cfg = DatabaseConfig::with_columns(::db::NUM_COLUMNS); diff --git a/ethcore/src/snapshot/watcher.rs b/ethcore/src/snapshot/watcher.rs index 5c4712cff9c..9df21c3cd83 100644 --- a/ethcore/src/snapshot/watcher.rs +++ b/ethcore/src/snapshot/watcher.rs @@ -123,7 +123,7 @@ mod tests { use client::{ChainNotify, NewBlocks, ChainRoute}; - use ethereum_types::{H256, U256}; + use ethereum_types::{H256, U256, BigEndianHash}; use std::collections::HashMap; use std::time::Duration; @@ -151,7 +151,7 @@ mod tests { fn harness(numbers: Vec, period: u64, history: u64, expected: Option) { const DURATION_ZERO: Duration = Duration::from_millis(0); - let hashes: Vec<_> = numbers.clone().into_iter().map(|x| H256::from(U256::from(x))).collect(); + let hashes: Vec<_> = numbers.clone().into_iter().map(|x| BigEndianHash::from_uint(&U256::from(x))).collect(); let map = hashes.clone().into_iter().zip(numbers).collect(); let watcher = Watcher { diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index fbc0fe97d1d..e8a7584b3a8 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -996,6 +996,7 @@ mod tests { use tempdir::TempDir; use types::view; use types::views::BlockView; + use std::str::FromStr; #[test] fn test_load_empty() { @@ -1009,12 +1010,12 @@ mod tests { assert_eq!( test_spec.state_root(), - "f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9".into() + H256::from_str("f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9").unwrap() ); let genesis = test_spec.genesis_block(); assert_eq!( view!(BlockView, &genesis).header_view().hash(), - "0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303".into() + H256::from_str("0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303").unwrap() ); } @@ -1030,8 +1031,8 @@ mod tests { spec.engine.account_start_nonce(0), Default::default(), ).unwrap(); - let expected = "0000000000000000000000000000000000000000000000000000000000000001".into(); - let address = "0000000000000000000000000000000000001337".into(); + let expected = H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(); + let address = Address::from_str("0000000000000000000000000000000000001337").unwrap(); assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), expected); assert_eq!(state.balance(&address).unwrap(), 1.into()); diff --git a/ethcore/src/state/account.rs b/ethcore/src/state/account.rs index 93111f25b9d..36260ca2cdc 100644 --- a/ethcore/src/state/account.rs +++ b/ethcore/src/state/account.rs @@ -621,6 +621,7 @@ mod tests { use bytes::Bytes; use super::*; use account_db::*; + use std::str::FromStr; #[test] fn account_compress() { @@ -634,10 +635,10 @@ mod tests { #[test] fn storage_at() { let mut db = new_memory_db(); - let mut db = AccountDBMut::new(&mut db, &Address::new()); + let mut db = AccountDBMut::new(&mut db, &Address::zero()); let rlp = { let mut a = Account::new_contract(69.into(), 0.into(), KECCAK_NULL_RLP); - a.set_storage(0x00u64.into(), 0x1234u64.into()); + a.set_storage(H256::zero(), H256::from_low_u64_be(0x1234)); a.commit_storage(&Default::default(), &mut db).unwrap(); a.init_code(vec![]); a.commit_code(&mut db); @@ -645,15 +646,15 @@ mod tests { }; let a = Account::from_rlp(&rlp).expect("decoding db value failed"); - assert_eq!(a.storage_root().unwrap(), "c57e1afb758b07f8d2c8f13a3b6e44fa5ff94ab266facc5a4fd3f062426e50b2".into()); - assert_eq!(a.storage_at(&db.immutable(), &0x00u64.into()).unwrap(), 0x1234u64.into()); - assert_eq!(a.storage_at(&db.immutable(), &0x01u64.into()).unwrap(), H256::default()); + assert_eq!(a.storage_root().unwrap(), H256::from_str("c57e1afb758b07f8d2c8f13a3b6e44fa5ff94ab266facc5a4fd3f062426e50b2").unwrap()); + assert_eq!(a.storage_at(&db.immutable(), &H256::zero()).unwrap(), H256::from_low_u64_be(0x1234)); + assert_eq!(a.storage_at(&db.immutable(), &H256::from_low_u64_be(0x01)).unwrap(), H256::zero()); } #[test] fn note_code() { let mut db = new_memory_db(); - let mut db = AccountDBMut::new(&mut db, &Address::new()); + let mut db = AccountDBMut::new(&mut db, &Address::zero()); let rlp = { let mut a = Account::new_contract(69.into(), 0.into(), KECCAK_NULL_RLP); @@ -673,53 +674,53 @@ mod tests { fn commit_storage() { let mut a = Account::new_contract(69.into(), 0.into(), KECCAK_NULL_RLP); let mut db = new_memory_db(); - let mut db = AccountDBMut::new(&mut db, &Address::new()); - a.set_storage(0.into(), 0x1234.into()); + let mut db = AccountDBMut::new(&mut db, &Address::zero()); + a.set_storage(H256::from_low_u64_be(0), H256::from_low_u64_be(0x1234)); assert_eq!(a.storage_root(), None); a.commit_storage(&Default::default(), &mut db).unwrap(); - assert_eq!(a.storage_root().unwrap(), "c57e1afb758b07f8d2c8f13a3b6e44fa5ff94ab266facc5a4fd3f062426e50b2".into()); + assert_eq!(a.storage_root().unwrap(), H256::from_str("c57e1afb758b07f8d2c8f13a3b6e44fa5ff94ab266facc5a4fd3f062426e50b2").unwrap()); } #[test] fn commit_remove_commit_storage() { let mut a = Account::new_contract(69.into(), 0.into(), KECCAK_NULL_RLP); let mut db = new_memory_db(); - let mut db = AccountDBMut::new(&mut db, &Address::new()); - a.set_storage(0.into(), 0x1234.into()); + let mut db = AccountDBMut::new(&mut db, &Address::zero()); + a.set_storage(H256::from_low_u64_be(0), H256::from_low_u64_be(0x1234)); a.commit_storage(&Default::default(), &mut db).unwrap(); - a.set_storage(1.into(), 0x1234.into()); + a.set_storage(H256::from_low_u64_be(1), H256::from_low_u64_be(0x1234)); a.commit_storage(&Default::default(), &mut db).unwrap(); - a.set_storage(1.into(), 0.into()); + a.set_storage(H256::from_low_u64_be(1), H256::from_low_u64_be(0)); a.commit_storage(&Default::default(), &mut db).unwrap(); - assert_eq!(a.storage_root().unwrap(), "c57e1afb758b07f8d2c8f13a3b6e44fa5ff94ab266facc5a4fd3f062426e50b2".into()); + assert_eq!(a.storage_root().unwrap(), H256::from_str("c57e1afb758b07f8d2c8f13a3b6e44fa5ff94ab266facc5a4fd3f062426e50b2").unwrap()); } #[test] fn commit_code() { let mut a = Account::new_contract(69.into(), 0.into(), KECCAK_NULL_RLP); let mut db = new_memory_db(); - let mut db = AccountDBMut::new(&mut db, &Address::new()); + let mut db = AccountDBMut::new(&mut db, &Address::zero()); a.init_code(vec![0x55, 0x44, 0xffu8]); assert_eq!(a.code_filth, Filth::Dirty); assert_eq!(a.code_size(), Some(3)); a.commit_code(&mut db); - assert_eq!(a.code_hash(), "af231e631776a517ca23125370d542873eca1fb4d613ed9b5d5335a46ae5b7eb".into()); + assert_eq!(a.code_hash(), H256::from_str("af231e631776a517ca23125370d542873eca1fb4d613ed9b5d5335a46ae5b7eb").unwrap()); } #[test] fn reset_code() { let mut a = Account::new_contract(69.into(), 0.into(), KECCAK_NULL_RLP); let mut db = new_memory_db(); - let mut db = AccountDBMut::new(&mut db, &Address::new()); + let mut db = AccountDBMut::new(&mut db, &Address::zero()); a.init_code(vec![0x55, 0x44, 0xffu8]); assert_eq!(a.code_filth, Filth::Dirty); a.commit_code(&mut db); assert_eq!(a.code_filth, Filth::Clean); - assert_eq!(a.code_hash(), "af231e631776a517ca23125370d542873eca1fb4d613ed9b5d5335a46ae5b7eb".into()); + assert_eq!(a.code_hash(), H256::from_str("af231e631776a517ca23125370d542873eca1fb4d613ed9b5d5335a46ae5b7eb").unwrap()); a.reset_code(vec![0x55]); assert_eq!(a.code_filth, Filth::Dirty); a.commit_code(&mut db); - assert_eq!(a.code_hash(), "37bf2238b11b68cdc8382cece82651b59d3c3988873b6e0f33d79694aa45f1be".into()); + assert_eq!(a.code_hash(), H256::from_str("37bf2238b11b68cdc8382cece82651b59d3c3988873b6e0f33d79694aa45f1be").unwrap()); } #[test] diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index 1060d600e57..98ae1e1f6b7 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -1011,6 +1011,8 @@ impl State { /// It requires FatDB. #[cfg(feature="to-pod-full")] fn account_to_pod_account(&self, account: &Account, address: &Address) -> Result { + use ethereum_types::BigEndianHash; + let mut pod_storage = BTreeMap::new(); let addr_hash = account.address_hash(address); let accountdb = self.factories.accountdb.readonly(self.db.as_hash_db(), addr_hash); @@ -1020,7 +1022,12 @@ impl State { let trie = self.factories.trie.readonly(accountdb, &root)?; for o_kv in trie.iter()? { if let Ok((key, val)) = o_kv { - pod_storage.insert(key[..].into(), rlp::decode::(&val[..]).expect("Decoded from trie which was encoded from the same type; qed").into()); + pod_storage.insert( + H256::from_slice(&key[..]), + BigEndianHash::from_uint( + &rlp::decode::(&val[..]).expect("Decoded from trie which was encoded from the same type; qed") + ), + ); } } @@ -1336,7 +1343,7 @@ mod tests { use hash::{keccak, KECCAK_NULL_RLP}; use super::*; use ethkey::Secret; - use ethereum_types::{H256, U256, Address}; + use ethereum_types::{H256, U256, Address, BigEndianHash}; use test_helpers::{get_temp_state, get_temp_state_db}; use machine::EthereumMachine; use vm::EnvInfo; @@ -1380,7 +1387,7 @@ mod tests { trace_address: Default::default(), subtraces: 0, action: trace::Action::Create(trace::Create { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), value: 100.into(), gas: 77412.into(), init: vec![96, 16, 128, 96, 12, 96, 0, 57, 96, 0, 243, 0, 96, 0, 53, 84, 21, 96, 9, 87, 0, 91, 96, 32, 53, 96, 0, 53, 85], @@ -1437,7 +1444,7 @@ mod tests { let expected_trace = vec![FlatTrace { trace_address: Default::default(), action: trace::Action::Create(trace::Create { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), value: 100.into(), gas: 78792.into(), init: vec![91, 96, 0, 86], @@ -1463,19 +1470,19 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("6000").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("6000").unwrap()).unwrap(); state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -1505,7 +1512,7 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); @@ -1515,8 +1522,8 @@ mod tests { let expected_trace = vec![FlatTrace { trace_address: Default::default(), action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -1546,7 +1553,7 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0x1.into()), + action: Action::Call(Address::from_low_u64_be(0x1)), value: 0.into(), data: vec![], }.sign(&secret(), None); @@ -1556,8 +1563,8 @@ mod tests { let expected_trace = vec![FlatTrace { trace_address: Default::default(), action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: "0000000000000000000000000000000000000001".into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_str("0000000000000000000000000000000000000001").unwrap(), value: 0.into(), gas: 79_000.into(), input: vec![], @@ -1587,19 +1594,19 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 0.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("600060006000600060006001610be0f1").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("600060006000600060006001610be0f1").unwrap()).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 0.into(), gas: 79000.into(), input: vec![], @@ -1629,21 +1636,21 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 0.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("60006000600060006000600b611000f2").unwrap()).unwrap(); - state.init_code(&0xb.into(), FromHex::from_hex("6000").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("60006000600060006000600b611000f2").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xb), FromHex::from_hex("6000").unwrap()).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 0.into(), gas: 79000.into(), input: vec![], @@ -1657,8 +1664,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: 0xa.into(), - to: 0xb.into(), + from: Address::from_low_u64_be(0xa), + to: Address::from_low_u64_be(0xb), value: 0.into(), gas: 4096.into(), input: vec![], @@ -1688,21 +1695,21 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 0.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("6000600060006000600b618000f4").unwrap()).unwrap(); - state.init_code(&0xb.into(), FromHex::from_hex("60056000526001601ff3").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("6000600060006000600b618000f4").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xb), FromHex::from_hex("60056000526001601ff3").unwrap()).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 0.into(), gas: 79000.into(), input: vec![], @@ -1716,8 +1723,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: 0xa.into(), - to: 0xb.into(), + from: Address::from_low_u64_be(0xa), + to: Address::from_low_u64_be(0xb), value: 0.into(), gas: 32768.into(), input: vec![], @@ -1746,19 +1753,19 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("5b600056").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("5b600056").unwrap()).unwrap(); state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -1785,13 +1792,13 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); - state.init_code(&0xb.into(), FromHex::from_hex("6000").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xb), FromHex::from_hex("6000").unwrap()).unwrap(); state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); @@ -1799,8 +1806,8 @@ mod tests { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -1814,8 +1821,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: 0xa.into(), - to: 0xb.into(), + from: Address::from_low_u64_be(0xa), + to: Address::from_low_u64_be(0xb), value: 0.into(), gas: 78934.into(), input: vec![], @@ -1844,20 +1851,20 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("60006000600060006045600b6000f1").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("60006000600060006045600b6000f1").unwrap()).unwrap(); state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -1871,8 +1878,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: 0xa.into(), - to: 0xb.into(), + from: Address::from_low_u64_be(0xa), + to: Address::from_low_u64_be(0xb), value: 69.into(), gas: 2300.into(), input: vec![], @@ -1898,20 +1905,20 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("600060006000600060ff600b6000f1").unwrap()).unwrap(); // not enough funds. + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("600060006000600060ff600b6000f1").unwrap()).unwrap(); // not enough funds. state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -1940,21 +1947,21 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![],//600480600b6000396000f35b600056 }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); - state.init_code(&0xb.into(), FromHex::from_hex("5b600056").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xb), FromHex::from_hex("5b600056").unwrap()).unwrap(); state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -1968,8 +1975,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: 0xa.into(), - to: 0xb.into(), + from: Address::from_low_u64_be(0xa), + to: Address::from_low_u64_be(0xb), value: 0.into(), gas: 78934.into(), input: vec![], @@ -1995,22 +2002,22 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); - state.init_code(&0xb.into(), FromHex::from_hex("60006000600060006000600c602b5a03f1").unwrap()).unwrap(); - state.init_code(&0xc.into(), FromHex::from_hex("6000").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xb), FromHex::from_hex("60006000600060006000600c602b5a03f1").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xc), FromHex::from_hex("6000").unwrap()).unwrap(); state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -2024,8 +2031,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: 0xa.into(), - to: 0xb.into(), + from: Address::from_low_u64_be(0xa), + to: Address::from_low_u64_be(0xb), value: 0.into(), gas: 78934.into(), input: vec![], @@ -2039,8 +2046,8 @@ mod tests { trace_address: vec![0, 0].into_iter().collect(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: 0xb.into(), - to: 0xc.into(), + from: Address::from_low_u64_be(0xb), + to: Address::from_low_u64_be(0xc), value: 0.into(), gas: 78868.into(), input: vec![], @@ -2069,14 +2076,14 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![],//600480600b6000396000f35b600056 }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); - state.init_code(&0xb.into(), FromHex::from_hex("60006000600060006000600c602b5a03f1505b601256").unwrap()).unwrap(); - state.init_code(&0xc.into(), FromHex::from_hex("6000").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("60006000600060006000600b602b5a03f1").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xb), FromHex::from_hex("60006000600060006000600c602b5a03f1505b601256").unwrap()).unwrap(); + state.init_code(&Address::from_low_u64_be(0xc), FromHex::from_hex("6000").unwrap()).unwrap(); state.add_balance(&t.sender(), &(100.into()), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); @@ -2084,8 +2091,8 @@ mod tests { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -2099,8 +2106,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: 0xa.into(), - to: 0xb.into(), + from: Address::from_low_u64_be(0xa), + to: Address::from_low_u64_be(0xb), value: 0.into(), gas: 78934.into(), input: vec![], @@ -2111,8 +2118,8 @@ mod tests { trace_address: vec![0, 0].into_iter().collect(), subtraces: 0, action: trace::Action::Call(trace::Call { - from: 0xb.into(), - to: 0xc.into(), + from: Address::from_low_u64_be(0xb), + to: Address::from_low_u64_be(0xc), value: 0.into(), gas: 78868.into(), call_type: CallType::Call, @@ -2141,21 +2148,21 @@ mod tests { nonce: 0.into(), gas_price: 0.into(), gas: 100_000.into(), - action: Action::Call(0xa.into()), + action: Action::Call(Address::from_low_u64_be(0xa)), value: 100.into(), data: vec![], }.sign(&secret(), None); - state.init_code(&0xa.into(), FromHex::from_hex("73000000000000000000000000000000000000000bff").unwrap()).unwrap(); - state.add_balance(&0xa.into(), &50.into(), CleanupMode::NoEmpty).unwrap(); + state.init_code(&Address::from_low_u64_be(0xa), FromHex::from_hex("73000000000000000000000000000000000000000bff").unwrap()).unwrap(); + state.add_balance(&Address::from_low_u64_be(0xa), &50.into(), CleanupMode::NoEmpty).unwrap(); state.add_balance(&t.sender(), &100.into(), CleanupMode::NoEmpty).unwrap(); let result = state.apply(&info, &machine, &t, true).unwrap(); let expected_trace = vec![FlatTrace { trace_address: Default::default(), subtraces: 1, action: trace::Action::Call(trace::Call { - from: "9cce34f7ab185c7aba1b7c8140d620b4bda941d6".into(), - to: 0xa.into(), + from: Address::from_str("9cce34f7ab185c7aba1b7c8140d620b4bda941d6").unwrap(), + to: Address::from_low_u64_be(0xa), value: 100.into(), gas: 79000.into(), input: vec![], @@ -2169,8 +2176,8 @@ mod tests { trace_address: vec![0].into_iter().collect(), subtraces: 0, action: trace::Action::Suicide(trace::Suicide { - address: 0xa.into(), - refund_address: 0xb.into(), + address: Address::from_low_u64_be(0xa), + refund_address: Address::from_low_u64_be(0xb), balance: 150.into(), }), result: trace::Res::None, @@ -2201,13 +2208,15 @@ mod tests { let a = Address::zero(); let (root, db) = { let mut state = get_temp_state(); - state.set_storage(&a, H256::from(&U256::from(1u64)), H256::from(&U256::from(69u64))).unwrap(); + state.set_storage(&a, BigEndianHash::from_uint(&U256::from(1u64)), BigEndianHash::from_uint(&U256::from(69u64))).unwrap(); state.commit().unwrap(); state.drop() }; let s = State::from_existing(db, root, U256::from(0u8), Default::default()).unwrap(); - assert_eq!(s.storage_at(&a, &H256::from(&U256::from(1u64))).unwrap(), H256::from(&U256::from(69u64))); + let h1 = BigEndianHash::from_uint(&U256::from(1u64)); + let h2 = BigEndianHash::from_uint(&U256::from(69u64)); + assert_eq!(s.storage_at(&a, &h1).unwrap(), h2); } #[test] @@ -2305,7 +2314,7 @@ mod tests { fn alter_balance() { let mut state = get_temp_state(); let a = Address::zero(); - let b = 1u64.into(); + let b = Address::from_low_u64_be(1u64); state.add_balance(&a, &U256::from(69u64), CleanupMode::NoEmpty).unwrap(); assert_eq!(state.balance(&a).unwrap(), U256::from(69u64)); state.commit().unwrap(); @@ -2355,7 +2364,7 @@ mod tests { let a = Address::zero(); state.require(&a, false).unwrap(); state.commit().unwrap(); - assert_eq!(*state.root(), "0ce23f3c809de377b008a4a3ee94a0834aac8bec1f86e28ffe4fdb5a15b0c785".into()); + assert_eq!(*state.root(), H256::from_str("0ce23f3c809de377b008a4a3ee94a0834aac8bec1f86e28ffe4fdb5a15b0c785").unwrap()); } #[test] @@ -2392,162 +2401,162 @@ mod tests { fn checkpoint_revert_to_get_storage_at() { let mut state = get_temp_state(); let a = Address::zero(); - let k = H256::from(U256::from(0)); + let k = BigEndianHash::from_uint(&U256::from(0)); let c0 = state.checkpoint(); let c1 = state.checkpoint(); - state.set_storage(&a, k, H256::from(U256::from(1))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(1))).unwrap(); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(1))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(1))); state.revert_to_checkpoint(); // Revert to c1. - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(0))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0))); } #[test] fn checkpoint_from_empty_get_storage_at() { let mut state = get_temp_state(); let a = Address::zero(); - let k = H256::from(U256::from(0)); - let k2 = H256::from(U256::from(1)); + let k = BigEndianHash::from_uint(&U256::from(0)); + let k2 = BigEndianHash::from_uint(&U256::from(1)); - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(0))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0))); state.clear(); let c0 = state.checkpoint(); state.new_contract(&a, U256::zero(), U256::zero()).unwrap(); let c1 = state.checkpoint(); - state.set_storage(&a, k, H256::from(U256::from(1))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(1))).unwrap(); let c2 = state.checkpoint(); let c3 = state.checkpoint(); - state.set_storage(&a, k2, H256::from(U256::from(3))).unwrap(); - state.set_storage(&a, k, H256::from(U256::from(3))).unwrap(); + state.set_storage(&a, k2, BigEndianHash::from_uint(&U256::from(3))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(3))).unwrap(); let c4 = state.checkpoint(); - state.set_storage(&a, k, H256::from(U256::from(4))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(4))).unwrap(); let c5 = state.checkpoint(); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(H256::from(U256::from(3)))); - assert_eq!(state.checkpoint_storage_at(c5, &a, &k).unwrap(), Some(H256::from(U256::from(4)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(3)))); + assert_eq!(state.checkpoint_storage_at(c5, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(4)))); state.discard_checkpoint(); // Commit/discard c5. - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(H256::from(U256::from(3)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(3)))); state.revert_to_checkpoint(); // Revert to c4. - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); state.discard_checkpoint(); // Commit/discard c3. - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); state.revert_to_checkpoint(); // Revert to c2. - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); state.discard_checkpoint(); // Commit/discard c1. - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); } #[test] fn checkpoint_get_storage_at() { let mut state = get_temp_state(); let a = Address::zero(); - let k = H256::from(U256::from(0)); - let k2 = H256::from(U256::from(1)); + let k = BigEndianHash::from_uint(&U256::from(0)); + let k2 = BigEndianHash::from_uint(&U256::from(1)); - state.set_storage(&a, k, H256::from(U256::from(0xffff))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(0xffff))).unwrap(); state.commit().unwrap(); state.clear(); - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(0xffff))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0xffff))); state.clear(); let cm1 = state.checkpoint(); let c0 = state.checkpoint(); state.new_contract(&a, U256::zero(), U256::zero()).unwrap(); let c1 = state.checkpoint(); - state.set_storage(&a, k, H256::from(U256::from(1))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(1))).unwrap(); let c2 = state.checkpoint(); let c3 = state.checkpoint(); - state.set_storage(&a, k2, H256::from(U256::from(3))).unwrap(); - state.set_storage(&a, k, H256::from(U256::from(3))).unwrap(); + state.set_storage(&a, k2, BigEndianHash::from_uint(&U256::from(3))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(3))).unwrap(); let c4 = state.checkpoint(); - state.set_storage(&a, k, H256::from(U256::from(4))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(4))).unwrap(); let c5 = state.checkpoint(); - assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(H256::from(U256::from(3)))); - assert_eq!(state.checkpoint_storage_at(c5, &a, &k).unwrap(), Some(H256::from(U256::from(4)))); + assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(3)))); + assert_eq!(state.checkpoint_storage_at(c5, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(4)))); state.discard_checkpoint(); // Commit/discard c5. - assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(H256::from(U256::from(3)))); + assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c4, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(3)))); state.revert_to_checkpoint(); // Revert to c4. - assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); - assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(c3, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); state.discard_checkpoint(); // Commit/discard c3. - assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); - assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(H256::from(U256::from(1)))); + assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(c2, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(1)))); state.revert_to_checkpoint(); // Revert to c2. - assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(H256::from(U256::from(0)))); + assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0)))); state.discard_checkpoint(); // Commit/discard c1. - assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); - assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(H256::from(U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(cm1, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); + assert_eq!(state.checkpoint_storage_at(c0, &a, &k).unwrap(), Some(BigEndianHash::from_uint(&U256::from(0xffff)))); } #[test] fn kill_account_with_checkpoints() { let mut state = get_temp_state(); let a = Address::zero(); - let k = H256::from(U256::from(0)); + let k = BigEndianHash::from_uint(&U256::from(0)); state.checkpoint(); - state.set_storage(&a, k, H256::from(U256::from(1))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(1))).unwrap(); state.checkpoint(); state.kill_account(&a); - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(0))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0))); state.revert_to_checkpoint(); - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(1))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(1))); } #[test] fn create_contract_fail() { let mut state = get_temp_state(); let orig_root = state.root().clone(); - let a: Address = 1000.into(); + let a = Address::from_low_u64_be(1000); state.checkpoint(); // c1 state.new_contract(&a, U256::zero(), U256::zero()).unwrap(); @@ -2565,25 +2574,25 @@ mod tests { #[test] fn create_contract_fail_previous_storage() { let mut state = get_temp_state(); - let a: Address = 1000.into(); - let k = H256::from(U256::from(0)); + let a = Address::from_low_u64_be(1000); + let k = BigEndianHash::from_uint(&U256::from(0)); - state.set_storage(&a, k, H256::from(U256::from(0xffff))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(0xffff))).unwrap(); state.commit().unwrap(); state.clear(); let orig_root = state.root().clone(); - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(0xffff))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0xffff))); state.clear(); state.checkpoint(); // c1 state.new_contract(&a, U256::zero(), U256::zero()).unwrap(); state.checkpoint(); // c2 - state.set_storage(&a, k, H256::from(U256::from(2))).unwrap(); + state.set_storage(&a, k, BigEndianHash::from_uint(&U256::from(2))).unwrap(); state.revert_to_checkpoint(); // revert to c2 - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(0))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0))); state.revert_to_checkpoint(); // revert to c1 - assert_eq!(state.storage_at(&a, &k).unwrap(), H256::from(U256::from(0xffff))); + assert_eq!(state.storage_at(&a, &k).unwrap(), BigEndianHash::from_uint(&U256::from(0xffff))); state.commit().unwrap(); assert_eq!(orig_root, state.root().clone()); @@ -2593,32 +2602,31 @@ mod tests { fn create_empty() { let mut state = get_temp_state(); state.commit().unwrap(); - assert_eq!(*state.root(), "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421".into()); + assert_eq!(*state.root(), H256::from_str("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap()); } #[test] fn should_not_panic_on_state_diff_with_storage() { let mut state = get_temp_state(); - - let a: Address = 0xa.into(); + let a = Address::from_low_u64_be(0xa); state.init_code(&a, b"abcdefg".to_vec()).unwrap();; state.add_balance(&a, &256.into(), CleanupMode::NoEmpty).unwrap(); - state.set_storage(&a, 0xb.into(), 0xc.into()).unwrap(); + state.set_storage(&a, H256::from_low_u64_be(0xb), H256::from_low_u64_be(0xc).into()).unwrap(); let mut new_state = state.clone(); - new_state.set_storage(&a, 0xb.into(), 0xd.into()).unwrap(); + new_state.set_storage(&a, H256::from_low_u64_be(0xb), H256::from_low_u64_be(0xd).into()).unwrap(); new_state.diff_from(state).unwrap(); } #[test] fn should_kill_garbage() { - let a = 10.into(); - let b = 20.into(); - let c = 30.into(); - let d = 40.into(); - let e = 50.into(); - let x = 0.into(); + let a = Address::from_low_u64_be(10); + let b = Address::from_low_u64_be(20); + let c = Address::from_low_u64_be(30); + let d = Address::from_low_u64_be(40); + let e = Address::from_low_u64_be(50); + let x = Address::from_low_u64_be(0); let db = get_temp_state_db(); let (root, db) = { let mut state = State::new(db, U256::from(0), Default::default()); @@ -2656,7 +2664,7 @@ mod tests { fn should_trace_diff_suicided_accounts() { use pod_account; - let a = 10.into(); + let a = Address::from_low_u64_be(10); let db = get_temp_state_db(); let (root, db) = { let mut state = State::new(db, U256::from(0), Default::default()); @@ -2686,19 +2694,19 @@ mod tests { fn should_trace_diff_unmodified_storage() { use pod_account; - let a = 10.into(); + let a = Address::from_low_u64_be(10); let db = get_temp_state_db(); let (root, db) = { let mut state = State::new(db, U256::from(0), Default::default()); - state.set_storage(&a, H256::from(&U256::from(1u64)), H256::from(&U256::from(20u64))).unwrap(); + state.set_storage(&a, BigEndianHash::from_uint(&U256::from(1u64)), BigEndianHash::from_uint(&U256::from(20u64))).unwrap(); state.commit().unwrap(); state.drop() }; let mut state = State::from_existing(db, root, U256::from(0u8), Default::default()).unwrap(); let original = state.clone(); - state.set_storage(&a, H256::from(&U256::from(1u64)), H256::from(&U256::from(100u64))).unwrap(); + state.set_storage(&a, BigEndianHash::from_uint(&U256::from(1u64)), BigEndianHash::from_uint(&U256::from(100u64))).unwrap(); let diff = state.diff_from(original).unwrap(); let diff_map = diff.get(); @@ -2709,13 +2717,13 @@ mod tests { balance: U256::zero(), nonce: U256::zero(), code: Some(Default::default()), - storage: vec![(H256::from(&U256::from(1u64)), H256::from(&U256::from(20u64)))] + storage: vec![(BigEndianHash::from_uint(&U256::from(1u64)), BigEndianHash::from_uint(&U256::from(20u64)))] .into_iter().collect(), }), Some(&PodAccount { balance: U256::zero(), nonce: U256::zero(), code: Some(Default::default()), - storage: vec![(H256::from(&U256::from(1u64)), H256::from(&U256::from(100u64)))] + storage: vec![(BigEndianHash::from_uint(&U256::from(1u64)), BigEndianHash::from_uint(&U256::from(100u64)))] .into_iter().collect(), })).as_ref()); } @@ -2738,29 +2746,29 @@ mod tests { pod_state.get().get(ak).unwrap().storage.get(&k).unwrap().clone() }; - let storage_address = H256::from(&U256::from(1u64)); + let storage_address = BigEndianHash::from_uint(&U256::from(1u64)); let (root, db) = { let mut state = State::new(db, U256::from(0), factories.clone()); - state.set_storage(&a, storage_address.clone(), H256::from(&U256::from(20u64))).unwrap(); + state.set_storage(&a, storage_address.clone(), BigEndianHash::from_uint(&U256::from(20u64))).unwrap(); let dump = state.to_pod_full().unwrap(); - assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), H256::from(&U256::from(20u64))); + assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), BigEndianHash::from_uint(&U256::from(20u64))); state.commit().unwrap(); let dump = state.to_pod_full().unwrap(); - assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), H256::from(&U256::from(20u64))); + assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), BigEndianHash::from_uint(&U256::from(20u64))); state.drop() }; let mut state = State::from_existing(db, root, U256::from(0u8), factories).unwrap(); let dump = state.to_pod_full().unwrap(); - assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), H256::from(&U256::from(20u64))); - state.set_storage(&a, storage_address.clone(), H256::from(&U256::from(21u64))).unwrap(); + assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), BigEndianHash::from_uint(&U256::from(20u64))); + state.set_storage(&a, storage_address.clone(), BigEndianHash::from_uint(&U256::from(21u64))).unwrap(); let dump = state.to_pod_full().unwrap(); - assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), H256::from(&U256::from(21u64))); + assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), BigEndianHash::from_uint(&U256::from(21u64))); state.commit().unwrap(); - state.set_storage(&a, storage_address.clone(), H256::from(&U256::from(0u64))).unwrap(); + state.set_storage(&a, storage_address.clone(), BigEndianHash::from_uint(&U256::from(0u64))).unwrap(); let dump = state.to_pod_full().unwrap(); - assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), H256::from(&U256::from(0u64))); + assert_eq!(get_pod_state_val(&dump, &a, storage_address.clone()), BigEndianHash::from_uint(&U256::from(0u64))); } diff --git a/ethcore/src/state/substate.rs b/ethcore/src/state/substate.rs index 86f6e37f8d5..cb6981437e7 100644 --- a/ethcore/src/state/substate.rs +++ b/ethcore/src/state/substate.rs @@ -68,7 +68,7 @@ impl Substate { #[cfg(test)] mod tests { - use super::Substate; + use super::{Substate, Address}; use types::log_entry::LogEntry; #[test] @@ -80,19 +80,19 @@ mod tests { #[test] fn accrue() { let mut sub_state = Substate::new(); - sub_state.contracts_created.push(1u64.into()); + sub_state.contracts_created.push(Address::from_low_u64_be(1)); sub_state.logs.push(LogEntry { - address: 1u64.into(), + address: Address::from_low_u64_be(1), topics: vec![], data: vec![] }); sub_state.sstore_clears_refund = (15000 * 5).into(); - sub_state.suicides.insert(10u64.into()); + sub_state.suicides.insert(Address::from_low_u64_be(10)); let mut sub_state_2 = Substate::new(); - sub_state_2.contracts_created.push(2u64.into()); + sub_state_2.contracts_created.push(Address::from_low_u64_be(2u64)); sub_state_2.logs.push(LogEntry { - address: 1u64.into(), + address: Address::from_low_u64_be(1), topics: vec![], data: vec![] }); diff --git a/ethcore/src/tests/evm.rs b/ethcore/src/tests/evm.rs index ec0b1dd8e6a..de1c14b2737 100644 --- a/ethcore/src/tests/evm.rs +++ b/ethcore/src/tests/evm.rs @@ -43,7 +43,7 @@ fn test_blockhash_eip210(factory: Factory) { // populate state with 256 last hashes let mut state = get_temp_state_with_factory(factory); - let contract_address: Address = 0xf0.into(); + let contract_address = Address::from_low_u64_be(0xf0); state.init_code(&contract_address, (*blockhash_contract_code).clone()).unwrap(); for i in 1 .. 257 { env_info.number = i.into(); @@ -57,7 +57,7 @@ fn test_blockhash_eip210(factory: Factory) { value: ActionValue::Transfer(0.into()), code: Some(blockhash_contract_code.clone()), code_hash: Some(blockhash_contract_code_hash), - data: Some(H256::from(i - 1).to_vec()), + data: Some(H256::from_low_u64_be(i - 1).as_bytes().to_vec()), call_type: CallType::Call, params_type: ParamsType::Separate, }; @@ -71,10 +71,10 @@ fn test_blockhash_eip210(factory: Factory) { env_info.number = 256; let params = ActionParams { - code_address: Address::new(), - address: Address::new(), - sender: Address::new(), - origin: Address::new(), + code_address: Address::zero(), + address: Address::zero(), + sender: Address::zero(), + origin: Address::zero(), gas: 100000.into(), gas_price: 0.into(), value: ActionValue::Transfer(0.into()), @@ -89,10 +89,10 @@ fn test_blockhash_eip210(factory: Factory) { let mut substate = Substate::new(); let res = ex.call(params, &mut substate, &mut NoopTracer, &mut NoopVMTracer); let output = match res { - Ok(res) => H256::from(&res.return_data[..32]), + Ok(res) => H256::from_slice(&res.return_data[..32]), Err(e) => { panic!("Encountered error on getting last hash: {}", e); }, }; - assert_eq!(output, 255.into()); + assert_eq!(output, H256::from_low_u64_be(255)); } diff --git a/ethcore/src/tests/trace.rs b/ethcore/src/tests/trace.rs index c14f13cf59e..882fed4436a 100644 --- a/ethcore/src/tests/trace.rs +++ b/ethcore/src/tests/trace.rs @@ -26,6 +26,7 @@ use client::*; use test_helpers::get_temp_state_db; use client::{BlockChainClient, Client, ClientConfig}; use std::sync::Arc; +use std::str::FromStr; use miner::Miner; use types::transaction::{Action, Transaction}; use trace::{RewardType, LocalizedTrace}; @@ -71,7 +72,7 @@ fn can_trace_block_and_uncle_reward() { let mut last_header = genesis_header.clone(); last_hashes.push(last_header.hash()); - let kp = KeyPair::from_secret_slice(&keccak("")).unwrap(); + let kp = KeyPair::from_secret_slice(keccak("").as_bytes()).unwrap(); let author = kp.address(); // Add root block first @@ -162,7 +163,7 @@ fn can_trace_block_and_uncle_reward() { } let mut uncle = Header::new(); - let uncle_author: Address = "ef2d6d194084c2de36e0dabfce45d046b37d1106".into(); + let uncle_author = Address::from_str("ef2d6d194084c2de36e0dabfce45d046b37d1106").unwrap(); uncle.set_author(uncle_author); uncle.set_parent_hash(root_header.hash()); uncle.set_gas_limit(genesis_gas); diff --git a/ethcore/src/trace/db.rs b/ethcore/src/trace/db.rs index d3758481275..11be83911f5 100644 --- a/ethcore/src/trace/db.rs +++ b/ethcore/src/trace/db.rs @@ -422,8 +422,8 @@ mod tests { trace_address: Default::default(), subtraces: 0, action: Action::Call(Call { - from: 1.into(), - to: 2.into(), + from: Address::from_low_u64_be(1), + to: Address::from_low_u64_be(2), value: 3.into(), gas: 4.into(), input: vec![], @@ -444,8 +444,8 @@ mod tests { trace_address: Default::default(), subtraces: 0, action: Action::Call(Call { - from: 1.into(), - to: 2.into(), + from: Address::from_low_u64_be(1), + to: Address::from_low_u64_be(2), value: 3.into(), gas: 4.into(), input: vec![], @@ -463,8 +463,8 @@ mod tests { fn create_simple_localized_trace(block_number: BlockNumber, block_hash: H256, tx_hash: H256) -> LocalizedTrace { LocalizedTrace { action: Action::Call(Call { - from: Address::from(1), - to: Address::from(2), + from: Address::from_low_u64_be(1), + to: Address::from_low_u64_be(2), value: U256::from(3), gas: U256::from(4), input: vec![], @@ -485,10 +485,10 @@ mod tests { let db = new_db(); let mut config = Config::default(); config.enabled = true; - let block_0 = H256::from(0xa1); - let block_1 = H256::from(0xa2); - let tx_0 = H256::from(0xff); - let tx_1 = H256::from(0xaf); + let block_0 = H256::from_low_u64_be(0xa1); + let block_1 = H256::from_low_u64_be(0xa2); + let tx_0 = H256::from_low_u64_be(0xff); + let tx_1 = H256::from_low_u64_be(0xaf); let mut extras = Extras::default(); extras.block_hashes.insert(0, block_0.clone()); @@ -512,10 +512,10 @@ mod tests { let db = new_db(); let mut config = Config::default(); config.enabled = true; - let block_1 = H256::from(0xa1); - let block_2 = H256::from(0xa2); - let tx_1 = H256::from(0xff); - let tx_2 = H256::from(0xaf); + let block_1 = H256::from_low_u64_be(0xa1); + let block_2 = H256::from_low_u64_be(0xa2); + let tx_1 = H256::from_low_u64_be(0xff); + let tx_2 = H256::from_low_u64_be(0xaf); let mut extras = Extras::default(); extras.block_hashes.insert(0, H256::default()); @@ -535,7 +535,7 @@ mod tests { let filter = Filter { range: (1..1), - from_address: AddressesFilter::from(vec![Address::from(1)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), to_address: AddressesFilter::from(vec![]), }; @@ -551,7 +551,7 @@ mod tests { let filter = Filter { range: (1..2), - from_address: AddressesFilter::from(vec![Address::from(1)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), to_address: AddressesFilter::from(vec![]), }; @@ -591,8 +591,8 @@ mod tests { let db = new_db(); let mut config = Config::default(); let mut extras = Extras::default(); - let block_0 = H256::from(0xa1); - let tx_0 = H256::from(0xff); + let block_0 = H256::from_low_u64_be(0xa1); + let tx_0 = H256::from_low_u64_be(0xff); extras.block_hashes.insert(0, H256::default()); extras.transaction_hashes.insert(0, vec![]); @@ -624,7 +624,7 @@ mod tests { let db = new_db(); let mut config = Config::default(); let mut extras = Extras::default(); - let block_0 = H256::from(0xa1); + let block_0 = H256::from_low_u64_be(0xa1); extras.block_hashes.insert(0, block_0.clone()); extras.transaction_hashes.insert(0, vec![]); diff --git a/ethcore/src/trace/types/filter.rs b/ethcore/src/trace/types/filter.rs index e107ebcdffb..f4c8598d98f 100644 --- a/ethcore/src/trace/types/filter.rs +++ b/ethcore/src/trace/types/filter.rs @@ -147,31 +147,31 @@ mod tests { fn single_trace_filter_bloom_possibility() { let filter = Filter { range: (0..0), - from_address: AddressesFilter::from(vec![Address::from(1)]), - to_address: AddressesFilter::from(vec![Address::from(2)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), + to_address: AddressesFilter::from(vec![Address::from_low_u64_be(2)]), }; let blooms = filter.bloom_possibilities(); assert_eq!(blooms.len(), 1); - assert!(blooms[0].contains_input(BloomInput::Raw(&Address::from(1)))); - assert!(blooms[0].contains_input(BloomInput::Raw(&Address::from(2)))); - assert!(!blooms[0].contains_input(BloomInput::Raw(&Address::from(3)))); + assert!(blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(1).as_bytes()))); + assert!(blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(2).as_bytes()))); + assert!(!blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(3).as_bytes()))); } #[test] fn only_from_trace_filter_bloom_possibility() { let filter = Filter { range: (0..0), - from_address: AddressesFilter::from(vec![Address::from(1)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), to_address: AddressesFilter::from(vec![]), }; let blooms = filter.bloom_possibilities(); assert_eq!(blooms.len(), 1); - assert!(blooms[0].contains_input(BloomInput::Raw(&Address::from(1)))); - assert!(!blooms[0].contains_input(BloomInput::Raw(&Address::from(2)))); + assert!(blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(1).as_bytes()))); + assert!(!blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(2).as_bytes()))); } #[test] @@ -179,59 +179,59 @@ mod tests { let filter = Filter { range: (0..0), from_address: AddressesFilter::from(vec![]), - to_address: AddressesFilter::from(vec![Address::from(1)]), + to_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), }; let blooms = filter.bloom_possibilities(); assert_eq!(blooms.len(), 1); - assert!(blooms[0].contains_input(BloomInput::Raw(&Address::from(1)))); - assert!(!blooms[0].contains_input(BloomInput::Raw(&Address::from(2)))); + assert!(blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(1).as_bytes()))); + assert!(!blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(2).as_bytes()))); } #[test] fn multiple_trace_filter_bloom_possibility() { let filter = Filter { range: (0..0), - from_address: AddressesFilter::from(vec![Address::from(1), Address::from(3)]), - to_address: AddressesFilter::from(vec![Address::from(2), Address::from(4)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1), Address::from_low_u64_be(3)]), + to_address: AddressesFilter::from(vec![Address::from_low_u64_be(2), Address::from_low_u64_be(4)]), }; let blooms = filter.bloom_possibilities(); assert_eq!(blooms.len(), 4); - assert!(blooms[0].contains_input(BloomInput::Raw(&Address::from(1)))); - assert!(blooms[0].contains_input(BloomInput::Raw(&Address::from(2)))); - assert!(!blooms[0].contains_input(BloomInput::Raw(&Address::from(3)))); - assert!(!blooms[0].contains_input(BloomInput::Raw(&Address::from(4)))); - - assert!(blooms[1].contains_input(BloomInput::Raw(&Address::from(1)))); - assert!(blooms[1].contains_input(BloomInput::Raw(&Address::from(4)))); - assert!(!blooms[1].contains_input(BloomInput::Raw(&Address::from(2)))); - assert!(!blooms[1].contains_input(BloomInput::Raw(&Address::from(3)))); - - assert!(blooms[2].contains_input(BloomInput::Raw(&Address::from(2)))); - assert!(blooms[2].contains_input(BloomInput::Raw(&Address::from(3)))); - assert!(!blooms[2].contains_input(BloomInput::Raw(&Address::from(1)))); - assert!(!blooms[2].contains_input(BloomInput::Raw(&Address::from(4)))); - - assert!(blooms[3].contains_input(BloomInput::Raw(&Address::from(3)))); - assert!(blooms[3].contains_input(BloomInput::Raw(&Address::from(4)))); - assert!(!blooms[3].contains_input(BloomInput::Raw(&Address::from(1)))); - assert!(!blooms[3].contains_input(BloomInput::Raw(&Address::from(2)))); + assert!(blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(1).as_bytes()))); + assert!(blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(2).as_bytes()))); + assert!(!blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(3).as_bytes()))); + assert!(!blooms[0].contains_input(BloomInput::Raw(Address::from_low_u64_be(4).as_bytes()))); + + assert!(blooms[1].contains_input(BloomInput::Raw(Address::from_low_u64_be(1).as_bytes()))); + assert!(blooms[1].contains_input(BloomInput::Raw(Address::from_low_u64_be(4).as_bytes()))); + assert!(!blooms[1].contains_input(BloomInput::Raw(Address::from_low_u64_be(2).as_bytes()))); + assert!(!blooms[1].contains_input(BloomInput::Raw(Address::from_low_u64_be(3).as_bytes()))); + + assert!(blooms[2].contains_input(BloomInput::Raw(Address::from_low_u64_be(2).as_bytes()))); + assert!(blooms[2].contains_input(BloomInput::Raw(Address::from_low_u64_be(3).as_bytes()))); + assert!(!blooms[2].contains_input(BloomInput::Raw(Address::from_low_u64_be(1).as_bytes()))); + assert!(!blooms[2].contains_input(BloomInput::Raw(Address::from_low_u64_be(4).as_bytes()))); + + assert!(blooms[3].contains_input(BloomInput::Raw(Address::from_low_u64_be(3).as_bytes()))); + assert!(blooms[3].contains_input(BloomInput::Raw(Address::from_low_u64_be(4).as_bytes()))); + assert!(!blooms[3].contains_input(BloomInput::Raw(Address::from_low_u64_be(1).as_bytes()))); + assert!(!blooms[3].contains_input(BloomInput::Raw(Address::from_low_u64_be(2).as_bytes()))); } #[test] fn filter_matches() { let f0 = Filter { range: (0..0), - from_address: AddressesFilter::from(vec![Address::from(1)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), to_address: AddressesFilter::from(vec![]), }; let f1 = Filter { range: (0..0), - from_address: AddressesFilter::from(vec![Address::from(3), Address::from(1)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(3), Address::from_low_u64_be(1)]), to_address: AddressesFilter::from(vec![]), }; @@ -244,31 +244,31 @@ mod tests { let f3 = Filter { range: (0..0), from_address: AddressesFilter::from(vec![]), - to_address: AddressesFilter::from(vec![Address::from(2)]), + to_address: AddressesFilter::from(vec![Address::from_low_u64_be(2)]), }; let f4 = Filter { range: (0..0), from_address: AddressesFilter::from(vec![]), - to_address: AddressesFilter::from(vec![Address::from(2), Address::from(3)]), + to_address: AddressesFilter::from(vec![Address::from_low_u64_be(2), Address::from_low_u64_be(3)]), }; let f5 = Filter { range: (0..0), - from_address: AddressesFilter::from(vec![Address::from(1)]), - to_address: AddressesFilter::from(vec![Address::from(2), Address::from(3)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), + to_address: AddressesFilter::from(vec![Address::from_low_u64_be(2), Address::from_low_u64_be(3)]), }; let f6 = Filter { range: (0..0), - from_address: AddressesFilter::from(vec![Address::from(1)]), - to_address: AddressesFilter::from(vec![Address::from(4)]), + from_address: AddressesFilter::from(vec![Address::from_low_u64_be(1)]), + to_address: AddressesFilter::from(vec![Address::from_low_u64_be(4)]), }; let trace = FlatTrace { action: Action::Call(Call { - from: 1.into(), - to: 2.into(), + from: Address::from_low_u64_be(1), + to: Address::from_low_u64_be(2), value: 3.into(), gas: 4.into(), input: vec![0x5], @@ -289,7 +289,7 @@ mod tests { let trace = FlatTrace { action: Action::Create(Create { - from: 1.into(), + from: Address::from_low_u64_be(1), value: 3.into(), gas: 4.into(), init: vec![0x5], @@ -297,7 +297,7 @@ mod tests { result: Res::Create(CreateResult { gas_used: 10.into(), code: vec![], - address: 2.into(), + address: Address::from_low_u64_be(2), }), trace_address: vec![0].into_iter().collect(), subtraces: 0, @@ -313,8 +313,8 @@ mod tests { let trace = FlatTrace { action: Action::Suicide(Suicide { - address: 1.into(), - refund_address: 2.into(), + address: Address::from_low_u64_be(1), + refund_address: Address::from_low_u64_be(2), balance: 3.into(), }), result: Res::None, @@ -332,7 +332,7 @@ mod tests { let trace = FlatTrace { action: Action::Reward(Reward { - author: 2.into(), + author: Address::from_low_u64_be(2), value: 100.into(), reward_type: RewardType::Block, }), @@ -354,7 +354,7 @@ mod tests { fn filter_match_block_reward_fix_8070() { let f0 = Filter { range: (0..0), - from_address: vec![1.into()].into(), + from_address: vec![Address::from_low_u64_be(1)].into(), to_address: vec![].into(), }; @@ -367,12 +367,12 @@ mod tests { let f2 = Filter { range: (0..0), from_address: vec![].into(), - to_address: vec![2.into()].into(), + to_address: vec![Address::from_low_u64_be(2)].into(), }; let trace = FlatTrace { action: Action::Reward(Reward { - author: 2.into(), + author: Address::from_low_u64_be(2), value: 10.into(), reward_type: RewardType::Block, }), @@ -391,7 +391,7 @@ mod tests { let f0 = Filter { range: (0..0), - from_address: vec![1.into()].into(), + from_address: vec![Address::from_low_u64_be(1)].into(), to_address: vec![].into(), }; @@ -404,12 +404,12 @@ mod tests { let f2 = Filter { range: (0..0), from_address: vec![].into(), - to_address: vec![2.into()].into(), + to_address: vec![Address::from_low_u64_be(2)].into(), }; let trace = FlatTrace { action: Action::Create(Create { - from: 1.into(), + from: Address::from_low_u64_be(1), gas: 4.into(), init: vec![0x5], value: 3.into(), diff --git a/ethcore/src/tx_filter.rs b/ethcore/src/tx_filter.rs index 69ed7acf304..815f29faff1 100644 --- a/ethcore/src/tx_filter.rs +++ b/ethcore/src/tx_filter.rs @@ -143,6 +143,7 @@ impl TransactionFilter { #[cfg(test)] mod test { use std::sync::Arc; + use std::str::FromStr; use spec::Spec; use client::{BlockChainClient, Client, ClientConfig, BlockId}; use miner::Miner; @@ -180,22 +181,22 @@ mod test { let filter = TransactionFilter::from_params(spec.params()).unwrap(); let mut basic_tx = Transaction::default(); - basic_tx.action = Action::Call(Address::from("d41c057fd1c78805aac12b0a94a405c0461a6fbb")); + basic_tx.action = Action::Call(Address::from_str("d41c057fd1c78805aac12b0a94a405c0461a6fbb").unwrap()); let create_tx = Transaction::default(); let mut call_tx = Transaction::default(); - call_tx.action = Action::Call(Address::from("0000000000000000000000000000000000000005")); + call_tx.action = Action::Call(Address::from_str("0000000000000000000000000000000000000005").unwrap()); let mut basic_tx_with_ether_and_to_key7 = Transaction::default(); - basic_tx_with_ether_and_to_key7.action = Action::Call(Address::from("d41c057fd1c78805aac12b0a94a405c0461a6fbb")); + basic_tx_with_ether_and_to_key7.action = Action::Call(Address::from_str("d41c057fd1c78805aac12b0a94a405c0461a6fbb").unwrap()); basic_tx_with_ether_and_to_key7.value = U256::from(123123); let mut call_tx_with_ether = Transaction::default(); - call_tx_with_ether.action = Action::Call(Address::from("0000000000000000000000000000000000000005")); + call_tx_with_ether.action = Action::Call(Address::from_str("0000000000000000000000000000000000000005").unwrap()); call_tx_with_ether.value = U256::from(123123); let mut basic_tx_to_key6 = Transaction::default(); - basic_tx_to_key6.action = Action::Call(Address::from("e57bfe9f44b819898f47bf37e5af72a0783e1141")); + basic_tx_to_key6.action = Action::Call(Address::from_str("e57bfe9f44b819898f47bf37e5af72a0783e1141").unwrap()); let mut basic_tx_with_ether_and_to_key6 = Transaction::default(); - basic_tx_with_ether_and_to_key6.action = Action::Call(Address::from("e57bfe9f44b819898f47bf37e5af72a0783e1141")); + basic_tx_with_ether_and_to_key6.action = Action::Call(Address::from_str("e57bfe9f44b819898f47bf37e5af72a0783e1141").unwrap()); basic_tx_with_ether_and_to_key6.value = U256::from(123123); let genesis = client.block_hash(BlockId::Latest).unwrap(); @@ -256,10 +257,10 @@ mod test { let filter = TransactionFilter::from_params(spec.params()).unwrap(); let mut basic_tx = Transaction::default(); - basic_tx.action = Action::Call(Address::from("000000000000000000000000000000000000032")); + basic_tx.action = Action::Call(Address::from_str("000000000000000000000000000000000000032").unwrap()); let create_tx = Transaction::default(); let mut call_tx = Transaction::default(); - call_tx.action = Action::Call(Address::from("0000000000000000000000000000000000000005")); + call_tx.action = Action::Call(Address::from_str("0000000000000000000000000000000000000005").unwrap()); let genesis = client.block_hash(BlockId::Latest).unwrap(); let block_number = 1; diff --git a/ethcore/src/verification/verification.rs b/ethcore/src/verification/verification.rs index 4dbe64b3f05..eff7ae406cc 100644 --- a/ethcore/src/verification/verification.rs +++ b/ethcore/src/verification/verification.rs @@ -385,7 +385,7 @@ mod tests { use std::collections::{BTreeMap, HashMap}; use std::time::{SystemTime, UNIX_EPOCH}; - use ethereum_types::{H256, BloomRef, U256}; + use ethereum_types::{H256, BloomRef, U256, Address}; use blockchain::{BlockDetails, TransactionAddress, BlockReceipts}; use types::encoded; use hash::keccak; @@ -615,7 +615,7 @@ mod tests { }.sign(keypair.secret(), None); let tr3 = Transaction { - action: Action::Call(0x0.into()), + action: Action::Call(Address::from_low_u64_be(0x0)), value: U256::from(0), data: Bytes::new(), gas: U256::from(30_000), diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index c9d0991a3b4..72df73d5c59 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -42,3 +42,4 @@ ethcore-io = { path = "../../util/io", features = ["mio"] } ethcore-private-tx = { path = "../private-tx" } kvdb-memorydb = "0.1" rustc-hex = "1.0" +rand_xorshift = "0.1.1" diff --git a/ethcore/sync/src/chain/mod.rs b/ethcore/sync/src/chain/mod.rs index 8456fb74f48..c3bca17d954 100644 --- a/ethcore/sync/src/chain/mod.rs +++ b/ethcore/sync/src/chain/mod.rs @@ -364,8 +364,8 @@ pub mod random { } #[cfg(test)] pub mod random { - use rand::{self, SeedableRng}; - pub fn new() -> rand::XorShiftRng { rand::XorShiftRng::from_seed([0, 1, 2, 3]) } + use rand::SeedableRng; + pub fn new() -> rand_xorshift::XorShiftRng { rand_xorshift::XorShiftRng::from_seed([0, 1, 2, 3]) } } pub type RlpResponseResult = Result, PacketDecodeError>; diff --git a/ethcore/sync/src/lib.rs b/ethcore/sync/src/lib.rs index 712a47801ff..aecf8fbb82c 100644 --- a/ethcore/sync/src/lib.rs +++ b/ethcore/sync/src/lib.rs @@ -45,6 +45,7 @@ extern crate ethcore_light as light; #[cfg(test)] extern crate ethcore_private_tx; #[cfg(test)] extern crate kvdb_memorydb; #[cfg(test)] extern crate rustc_hex; +#[cfg(test)] extern crate rand_xorshift; #[macro_use] extern crate enum_primitive; From 7f566ba3cc26fab3c308b9002ea412bc322da4b1 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 27 May 2019 12:15:36 +0200 Subject: [PATCH 54/90] [evmbin] fix compilation in tests --- evmbin/src/display/json.rs | 4 ++-- evmbin/src/display/std_json.rs | 4 ++-- evmbin/src/info.rs | 5 +++-- evmbin/src/main.rs | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/evmbin/src/display/json.rs b/evmbin/src/display/json.rs index eec5131c7b0..449938eab56 100644 --- a/evmbin/src/display/json.rs +++ b/evmbin/src/display/json.rs @@ -19,7 +19,7 @@ use std::collections::HashMap; use std::mem; -use ethereum_types::{U256, H256}; +use ethereum_types::{U256, H256, BigEndianHash}; use bytes::ToPretty; use ethcore::trace; @@ -168,7 +168,7 @@ impl trace::VMTracer for Informant { } if let Some((pos, val)) = store_diff { - informant.storage.insert(pos.into(), val.into()); + informant.storage.insert(BigEndianHash::from_uint(&pos), BigEndianHash::from_uint(&val)); } if !informant.subtraces.is_empty() { diff --git a/evmbin/src/display/std_json.rs b/evmbin/src/display/std_json.rs index a0071b174fa..74d9e0040a2 100644 --- a/evmbin/src/display/std_json.rs +++ b/evmbin/src/display/std_json.rs @@ -19,7 +19,7 @@ use std::collections::HashMap; use std::io; -use ethereum_types::{H256, U256}; +use ethereum_types::{H256, U256, BigEndianHash}; use bytes::ToPretty; use ethcore::{trace, pod_state}; @@ -197,7 +197,7 @@ impl trace::VMTracer for Informant { let subdepth = self.subdepth; Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant| { if let Some((pos, val)) = store_written { - informant.storage.insert(pos.into(), val.into()); + informant.storage.insert(BigEndianHash::from_uint(&pos), BigEndianHash::from_uint(&val)); } }); } diff --git a/evmbin/src/info.rs b/evmbin/src/info.rs index 74ea3175a68..10616e23437 100644 --- a/evmbin/src/info.rs +++ b/evmbin/src/info.rs @@ -96,7 +96,7 @@ pub fn run_action( Ok(r) => (Ok(r.return_data.to_vec()), Some(r.gas_left)), Err(err) => (Err(err), None), }; - (result.0, 0.into(), None, result.1, informant.drain()) + (result.0, H256::from_low_u64_be(0), None, result.1, informant.drain()) }) } @@ -212,6 +212,7 @@ pub mod tests { use rustc_hex::FromHex; use super::*; use tempdir::TempDir; + use ethereum_types::Address; pub fn run_test( informant: I, @@ -247,7 +248,7 @@ pub mod tests { let (inf, res) = informant(); let mut params = ActionParams::default(); - params.code_address = 0x20.into(); + params.code_address = Address::from_low_u64_be(0x20); params.gas = 0xffff.into(); let spec = ::ethcore::ethereum::load(None, include_bytes!("../res/testchain.json")); diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index d698848670d..d54b75c6cea 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -359,7 +359,7 @@ fn die(msg: T) -> ! { #[cfg(test)] mod tests { use docopt::Docopt; - use super::{Args, USAGE}; + use super::{Args, USAGE, Address}; fn run>(args: &[T]) -> Args { Docopt::new(USAGE).and_then(|d| d.argv(args.into_iter()).deserialize()).unwrap() @@ -388,8 +388,8 @@ mod tests { assert_eq!(args.flag_std_out_only, true); assert_eq!(args.gas(), Ok(1.into())); assert_eq!(args.gas_price(), Ok(2.into())); - assert_eq!(args.from(), Ok(3.into())); - assert_eq!(args.to(), Ok(4.into())); + assert_eq!(args.from(), Ok(Address::from_low_u64_be(3))); + assert_eq!(args.to(), Ok(Address::from_low_u64_be(4))); assert_eq!(args.code(), Ok(Some(vec![05]))); assert_eq!(args.data(), Ok(Some(vec![06]))); assert_eq!(args.flag_chain, Some("./testfile".to_owned())); From 446aea9c747e383e9405c1558d0d3093c158d300 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 27 May 2019 12:15:49 +0200 Subject: [PATCH 55/90] [updater] fix compilation in tests --- updater/src/updater.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/updater/src/updater.rs b/updater/src/updater.rs index 6badfa436aa..27daac4edb8 100644 --- a/updater/src/updater.rs +++ b/updater/src/updater.rs @@ -827,7 +827,7 @@ pub mod tests { let this = VersionInfo { track: ReleaseTrack::Beta, version: Version::parse("1.0.0").unwrap(), - hash: 0.into(), + hash: H160::zero(), }; let updater = Arc::new(Updater { @@ -867,14 +867,14 @@ pub mod tests { let latest_version = VersionInfo { track: ReleaseTrack::Beta, version: Version::parse(version).unwrap(), - hash: 1.into(), + hash: H160::from_low_u64_be(1), }; let latest_release = ReleaseInfo { version: latest_version.clone(), is_critical: false, fork: 0, - binary: Some(0.into()), + binary: Some(H256::zero()), }; let latest = OperationsInfo { From 1a4afdf79c2287a8c95b261070cae35bc551d19c Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 27 May 2019 12:15:58 +0200 Subject: [PATCH 56/90] [ethash] fix compilation in tests --- ethash/src/lib.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ethash/src/lib.rs b/ethash/src/lib.rs index a42b59bd8c9..71a5d60ee97 100644 --- a/ethash/src/lib.rs +++ b/ethash/src/lib.rs @@ -204,10 +204,10 @@ fn test_lru() { #[test] fn test_difficulty_to_boundary() { - use ethereum_types::H256; + use ethereum_types::{H256, BigEndianHash}; use std::str::FromStr; - assert_eq!(difficulty_to_boundary(&U256::from(1)), H256::from(U256::max_value())); + assert_eq!(difficulty_to_boundary(&U256::from(1)), BigEndianHash::from_uint(&U256::max_value())); assert_eq!(difficulty_to_boundary(&U256::from(2)), H256::from_str("8000000000000000000000000000000000000000000000000000000000000000").unwrap()); assert_eq!(difficulty_to_boundary(&U256::from(4)), H256::from_str("4000000000000000000000000000000000000000000000000000000000000000").unwrap()); assert_eq!(difficulty_to_boundary(&U256::from(32)), H256::from_str("0800000000000000000000000000000000000000000000000000000000000000").unwrap()); @@ -221,9 +221,18 @@ fn test_difficulty_to_boundary_regression() { // https://github.com/paritytech/parity-ethereum/issues/8397 for difficulty in 1..9 { assert_eq!(U256::from(difficulty), boundary_to_difficulty(&difficulty_to_boundary(&difficulty.into()))); - assert_eq!(H256::from(difficulty), difficulty_to_boundary(&boundary_to_difficulty(&difficulty.into()))); - assert_eq!(U256::from(difficulty), boundary_to_difficulty(&boundary_to_difficulty(&difficulty.into()).into())); - assert_eq!(H256::from(difficulty), difficulty_to_boundary(&difficulty_to_boundary(&difficulty.into()).into())); + assert_eq!( + H256::from_low_u64_be(difficulty), + difficulty_to_boundary(&boundary_to_difficulty(&H256::from_low_u64_be(difficulty))), + ); + assert_eq!( + U256::from(difficulty), + boundary_to_difficulty(&BigEndianHash::from_uint(&boundary_to_difficulty(&H256::from_low_u64_be(difficulty)))), + ); + assert_eq!( + H256::from_low_u64_be(difficulty), + difficulty_to_boundary(&difficulty_to_boundary(&difficulty.into()).into_uint()), + ); } } @@ -236,5 +245,5 @@ fn test_difficulty_to_boundary_panics_on_zero() { #[test] #[should_panic] fn test_boundary_to_difficulty_panics_on_zero() { - boundary_to_difficulty(ðereum_types::H256::from(0)); + boundary_to_difficulty(ðereum_types::H256::zero()); } From 8918fc9628c841d7be3b7928279c7907d62f7451 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 27 May 2019 16:10:25 +0200 Subject: [PATCH 57/90] [ethcore-secretstore] fix compilation in tests --- secret-store/src/key_server.rs | 14 +- .../key_version_negotiation_session.rs | 11 +- .../client_sessions/decryption_session.rs | 39 +++-- .../signing_session_schnorr.rs | 2 +- .../connection_trigger_with_migration.rs | 161 +++++++++--------- .../src/key_server_cluster/io/message.rs | 8 +- .../jobs/consensus_session.rs | 148 ++++++++-------- .../key_server_cluster/jobs/decryption_job.rs | 2 +- .../key_server_cluster/jobs/job_session.rs | 100 +++++------ .../jobs/servers_set_change_access_job.rs | 2 +- secret-store/src/key_server_cluster/math.rs | 20 +-- secret-store/src/key_server_set.rs | 82 ++++----- secret-store/src/key_storage.rs | 53 +++--- secret-store/src/listener/http_listener.rs | 18 +- secret-store/src/listener/service_contract.rs | 22 ++- .../src/listener/service_contract_listener.rs | 7 +- secret-store/src/serialization.rs | 44 +++-- 17 files changed, 387 insertions(+), 346 deletions(-) diff --git a/secret-store/src/key_server.rs b/secret-store/src/key_server.rs index 3f03e7e259d..77b32d623ba 100644 --- a/secret-store/src/key_server.rs +++ b/secret-store/src/key_server.rs @@ -103,7 +103,7 @@ impl DocumentKeyServer for KeyServerImpl { self.store_document_key(key_id, author, encrypted_document_key.common_point, encrypted_document_key.encrypted_point)?; // encrypt document key with requestor public key - let document_key = crypto::ecies::encrypt(&public, &DEFAULT_MAC, &document_key) + let document_key = crypto::ecies::encrypt(&public, &DEFAULT_MAC, document_key.as_bytes()) .map_err(|err| Error::Internal(format!("Error encrypting document key: {}", err)))?; Ok(document_key) } @@ -120,7 +120,7 @@ impl DocumentKeyServer for KeyServerImpl { .decrypted_secret; // encrypt document key with requestor public key - let document_key = crypto::ecies::encrypt(&public, &DEFAULT_MAC, &document_key) + let document_key = crypto::ecies::encrypt(&public, &DEFAULT_MAC, document_key.as_bytes()) .map_err(|err| Error::Internal(format!("Error encrypting document key: {}", err)))?; Ok(document_key) } @@ -146,8 +146,8 @@ impl MessageSigner for KeyServerImpl { // compose two message signature components into single one let mut combined_signature = [0; 64]; - combined_signature[..32].clone_from_slice(&**message_signature.0); - combined_signature[32..].clone_from_slice(&**message_signature.1); + combined_signature[..32].clone_from_slice(message_signature.0.as_bytes()); + combined_signature[32..].clone_from_slice(message_signature.1.as_bytes()); // encrypt combined signature with requestor public key let message_signature = crypto::ecies::encrypt(&public, &DEFAULT_MAC, &combined_signature) @@ -422,7 +422,7 @@ pub mod tests { let server_public = key_servers[0].generate_key(&server_key_id, &signature.clone().into(), *threshold).unwrap(); // sign message - let message_hash = H256::from(42); + let message_hash = H256::from_low_u64_be(42); let combined_signature = key_servers[0].sign_message_schnorr(&server_key_id, &signature.into(), message_hash.clone()).unwrap(); let combined_signature = crypto::ecies::decrypt(&requestor_secret, &DEFAULT_MAC, &combined_signature).unwrap(); let signature_c = Secret::from_slice(&combined_signature[..32]).unwrap(); @@ -473,7 +473,7 @@ pub mod tests { key_storages[0].remove(&server_key_id).unwrap(); // sign message - let message_hash = H256::from(42); + let message_hash = H256::from_low_u64_be(42); let combined_signature = key_servers[0].sign_message_schnorr(&server_key_id, &signature.into(), message_hash.clone()).unwrap(); let combined_signature = crypto::ecies::decrypt(&requestor_secret, &DEFAULT_MAC, &combined_signature).unwrap(); let signature_c = Secret::from_slice(&combined_signature[..32]).unwrap(); @@ -503,7 +503,7 @@ pub mod tests { let message_hash = H256::random(); let signature = key_servers[0].sign_message_ecdsa(&server_key_id, &signature.into(), message_hash.clone()).unwrap(); let signature = crypto::ecies::decrypt(&requestor_secret, &DEFAULT_MAC, &signature).unwrap(); - let signature: H520 = signature[0..65].into(); + let signature = H520::from_slice(&signature[0..65]); // check signature assert!(verify_public(&server_public, &signature.into(), &message_hash).unwrap()); diff --git a/secret-store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs b/secret-store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs index 58801948664..34d7bde715d 100644 --- a/secret-store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs +++ b/secret-store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs @@ -590,6 +590,7 @@ impl SessionResultComputer for LargestSupportResultComputer { mod tests { use std::sync::Arc; use std::collections::{VecDeque, BTreeMap, BTreeSet}; + use ethereum_types::{H512, Address}; use ethkey::public_to_address; use key_server_cluster::{NodeId, SessionId, Error, KeyStorage, DummyKeyStorage, DocumentKeyShare, DocumentKeyShareVersion}; @@ -600,8 +601,10 @@ mod tests { use key_server_cluster::admin_sessions::ShareChangeSessionMeta; use key_server_cluster::decryption_session::create_default_decryption_session; use key_server_cluster::message::{Message, KeyVersionNegotiationMessage, RequestKeyVersions, KeyVersions}; - use super::{SessionImpl, SessionTransport, SessionParams, FastestResultComputer, LargestSupportResultComputer, - SessionResultComputer, SessionState, ContinueAction, FailedContinueAction}; + use super::{ + SessionImpl, SessionTransport, SessionParams, FastestResultComputer, LargestSupportResultComputer, + SessionResultComputer, SessionState, ContinueAction, FailedContinueAction, + }; struct DummyTransport { cluster: Arc, @@ -880,7 +883,7 @@ mod tests { #[test] fn fatal_error_is_broadcasted_if_started_with_origin() { let mut ml = MessageLoop::empty(3); - ml.session(0).set_continue_action(ContinueAction::Decrypt(create_default_decryption_session(), Some(1.into()), true, true)); + ml.session(0).set_continue_action(ContinueAction::Decrypt(create_default_decryption_session(), Some(Address::from_low_u64_be(1)), true, true)); ml.session(0).initialize(ml.nodes.keys().cloned().collect()).unwrap(); ml.run(); @@ -889,6 +892,6 @@ mod tests { // slave nodes have non-empty failed continue action assert!(ml.nodes.values().skip(1).all(|n| n.session.take_failed_continue_action() - == Some(FailedContinueAction::Decrypt(Some(1.into()), public_to_address(&2.into()))))); + == Some(FailedContinueAction::Decrypt(Some(Address::from_low_u64_be(1)), public_to_address(&H512::from_low_u64_be(2)))))); } } diff --git a/secret-store/src/key_server_cluster/client_sessions/decryption_session.rs b/secret-store/src/key_server_cluster/client_sessions/decryption_session.rs index ccb34e9828a..b47c81b98ce 100644 --- a/secret-store/src/key_server_cluster/client_sessions/decryption_session.rs +++ b/secret-store/src/key_server_cluster/client_sessions/decryption_session.rs @@ -816,6 +816,7 @@ impl JobTransport for DecryptionJobTransport { pub fn create_default_decryption_session() -> Arc { use acl_storage::DummyAclStorage; use key_server_cluster::cluster::tests::DummyCluster; + use ethereum_types::H512; Arc::new(SessionImpl::new(SessionParams { meta: SessionMeta { @@ -831,7 +832,7 @@ pub fn create_default_decryption_session() -> Arc { acl_storage: Arc::new(DummyAclStorage::default()), cluster: Arc::new(DummyCluster::new(Default::default())), nonce: 0, - }, Some(Requester::Public(2.into()))).unwrap()) + }, Some(Requester::Public(H512::from_low_u64_be(2)))).unwrap()) } #[cfg(test)] @@ -848,6 +849,8 @@ mod tests { use key_server_cluster::message::{self, Message, DecryptionMessage}; use key_server_cluster::math; use key_server_cluster::jobs::consensus_session::ConsensusSessionState; + use ethereum_types::{H512, Address}; + use std::str::FromStr; const SECRET_PLAIN: &'static str = "d2b57ae7619e070af0af6bc8c703c0cd27814c54d5d6a999cacac0da34ede279ca0d9216e85991029e54e2f0c92ee0bd30237725fa765cbdbfc4529489864c5f"; @@ -863,19 +866,19 @@ mod tests { "c06546b5669877ba579ca437a5602e89425c53808c708d44ccd6afcaa4610fad".parse().unwrap(), ]; let id_numbers: Vec<(NodeId, Secret)> = vec![ - ("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into(), + (H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse().unwrap()), - ("1395568277679f7f583ab7c0992da35f26cde57149ee70e524e49bdae62db3e18eb96122501e7cbb798b784395d7bb5a499edead0706638ad056d886e56cf8fb".into(), + (H512::from_str("1395568277679f7f583ab7c0992da35f26cde57149ee70e524e49bdae62db3e18eb96122501e7cbb798b784395d7bb5a499edead0706638ad056d886e56cf8fb").unwrap(), "00125d85a05e5e63e214cb60fe63f132eec8a103aa29266b7e6e6c5b7597230b".parse().unwrap()), - ("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc".into(), + (H512::from_str("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc").unwrap(), "f43ac0fba42a5b6ed95707d2244659e89ba877b1c9b82c0d0a9dcf834e80fc62".parse().unwrap()), - ("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c".into(), + (H512::from_str("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c").unwrap(), "5a324938dfb2516800487d25ab7289ba8ec38811f77c3df602e4e65e3c9acd9f".parse().unwrap()), - ("321977760d1d8e15b047a309e4c7fe6f355c10bb5a06c68472b676926427f69f229024fa2692c10da167d14cdc77eb95d0fce68af0a0f704f0d3db36baa83bb2".into(), + (H512::from_str("321977760d1d8e15b047a309e4c7fe6f355c10bb5a06c68472b676926427f69f229024fa2692c10da167d14cdc77eb95d0fce68af0a0f704f0d3db36baa83bb2").unwrap(), "12cf422d50002d04e52bd4906fd7f5f235f051ca36abfe37e061f8da248008d8".parse().unwrap()), ]; - let common_point: Public = "6962be696e1bcbba8e64cc7fddf140f854835354b5804f3bb95ae5a2799130371b589a131bd39699ac7174ccb35fc4342dab05331202209582fc8f3a40916ab0".into(); - let encrypted_point: Public = "b07031982bde9890e12eff154765f03c56c3ab646ad47431db5dd2d742a9297679c4c65b998557f8008469afd0c43d40b6c5f6c6a1c7354875da4115237ed87a".into(); + let common_point: Public = H512::from_str("6962be696e1bcbba8e64cc7fddf140f854835354b5804f3bb95ae5a2799130371b589a131bd39699ac7174ccb35fc4342dab05331202209582fc8f3a40916ab0").unwrap(); + let encrypted_point: Public = H512::from_str("b07031982bde9890e12eff154765f03c56c3ab646ad47431db5dd2d742a9297679c4c65b998557f8008469afd0c43d40b6c5f6c6a1c7354875da4115237ed87a").unwrap(); let encrypted_datas: Vec<_> = (0..5).map(|i| DocumentKeyShare { author: Default::default(), threshold: 3, @@ -1272,7 +1275,7 @@ mod tests { assert!(sessions.iter().skip(1).all(|s| s.decrypted_secret().is_none())); assert_eq!(sessions[0].decrypted_secret().unwrap().unwrap(), EncryptedDocumentKeyShadow { - decrypted_secret: SECRET_PLAIN.into(), + decrypted_secret: H512::from_str(SECRET_PLAIN).unwrap(), common_point: None, decrypt_shadows: None, }); @@ -1295,7 +1298,7 @@ mod tests { let decrypted_secret = sessions[0].decrypted_secret().unwrap().unwrap(); // check that decrypted_secret != SECRET_PLAIN - assert!(decrypted_secret.decrypted_secret != SECRET_PLAIN.into()); + assert!(decrypted_secret.decrypted_secret != H512::from_str(SECRET_PLAIN).unwrap()); // check that common point && shadow coefficients are returned assert!(decrypted_secret.common_point.is_some()); assert!(decrypted_secret.decrypt_shadows.is_some()); @@ -1306,7 +1309,7 @@ mod tests { .map(|c| Secret::from_slice(&decrypt(key_pair.secret(), &DEFAULT_MAC, &c).unwrap()).unwrap()) .collect(); let decrypted_secret = math::decrypt_with_shadow_coefficients(decrypted_secret.decrypted_secret, decrypted_secret.common_point.unwrap(), decrypt_shadows).unwrap(); - assert_eq!(decrypted_secret, SECRET_PLAIN.into()); + assert_eq!(decrypted_secret, H512::from_str(SECRET_PLAIN).unwrap()); } #[test] @@ -1347,7 +1350,7 @@ mod tests { // 2) 1 session has decrypted key value assert!(sessions.iter().skip(1).all(|s| s.decrypted_secret().is_none())); assert_eq!(sessions[0].decrypted_secret().unwrap().unwrap(), EncryptedDocumentKeyShadow { - decrypted_secret: SECRET_PLAIN.into(), + decrypted_secret: H512::from_str(SECRET_PLAIN).unwrap(), common_point: None, decrypt_shadows: None, }); @@ -1385,7 +1388,7 @@ mod tests { assert_eq!(sessions.iter().filter(|s| s.state() == ConsensusSessionState::Finished).count(), 4); // 2) 1 session has decrypted key value assert_eq!(sessions[1].decrypted_secret().unwrap().unwrap(), EncryptedDocumentKeyShadow { - decrypted_secret: SECRET_PLAIN.into(), + decrypted_secret: H512::from_str(SECRET_PLAIN).unwrap(), common_point: None, decrypt_shadows: None, }); @@ -1407,7 +1410,7 @@ mod tests { do_messages_exchange(&clusters, &sessions).unwrap(); assert_eq!(sessions[0].decrypted_secret().unwrap().unwrap(), EncryptedDocumentKeyShadow { - decrypted_secret: SECRET_PLAIN.into(), + decrypted_secret: H512::from_str(SECRET_PLAIN).unwrap(), common_point: None, decrypt_shadows: None, }); @@ -1423,7 +1426,7 @@ mod tests { let result = sessions[0].decrypted_secret(); assert!(result.clone().unwrap().is_ok()); assert_eq!(result.clone().unwrap().unwrap(), EncryptedDocumentKeyShadow { - decrypted_secret: SECRET_PLAIN.into(), + decrypted_secret: H512::from_str(SECRET_PLAIN).unwrap(), common_point: None, decrypt_shadows: None, }); @@ -1452,16 +1455,16 @@ mod tests { .map(|c| Secret::from_slice(&decrypt(key_pair.secret(), &DEFAULT_MAC, &c).unwrap()).unwrap()) .collect(); let decrypted_secret = math::decrypt_with_shadow_coefficients(result.decrypted_secret, result.common_point.unwrap(), decrypt_shadows).unwrap(); - assert_eq!(decrypted_secret, SECRET_PLAIN.into()); + assert_eq!(decrypted_secret, H512::from_str(SECRET_PLAIN).unwrap()); } #[test] fn decryption_session_origin_is_known_to_all_initialized_nodes() { let (_, clusters, _, sessions) = prepare_decryption_sessions(); - sessions[0].initialize(Some(1.into()), Default::default(), true, true).unwrap(); + sessions[0].initialize(Some(Address::from_low_u64_be(1)), Default::default(), true, true).unwrap(); do_messages_exchange(&clusters, &sessions).unwrap(); // all session must have origin set - assert_eq!(5, sessions.iter().filter(|s| s.origin() == Some(1.into())).count()); + assert_eq!(5, sessions.iter().filter(|s| s.origin() == Some(Address::from_low_u64_be(1))).count()); } } diff --git a/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs b/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs index 0b0619f967a..9a5fcdca3ed 100644 --- a/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs +++ b/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs @@ -933,7 +933,7 @@ mod tests { #[test] fn schnorr_fails_to_initialize_when_already_initialized() { let (ml, _, _) = MessageLoop::new(1, 0).unwrap().init().unwrap(); - assert_eq!(ml.session_at(0).initialize(ml.key_version(), 777.into()), + assert_eq!(ml.session_at(0).initialize(ml.key_version(), H256::from_low_u64_be(777)), Err(Error::InvalidStateForRequest)); } diff --git a/secret-store/src/key_server_cluster/connection_trigger_with_migration.rs b/secret-store/src/key_server_cluster/connection_trigger_with_migration.rs index 559bab18c13..ba11ea60c85 100644 --- a/secret-store/src/key_server_cluster/connection_trigger_with_migration.rs +++ b/secret-store/src/key_server_cluster/connection_trigger_with_migration.rs @@ -142,7 +142,7 @@ impl ConnectionTriggerWithMigration { session_action: None, } } - + /// Actually do mainteinance. fn do_maintain(&mut self) -> Option { loop { @@ -452,58 +452,59 @@ mod tests { use key_server_cluster::connection_trigger::ConnectionsAction; use super::{MigrationState, SessionState, SessionAction, migration_state, maintain_session, maintain_connections, select_master_node}; + use ethereum_types::{H256, H512}; #[test] fn migration_state_is_idle_when_required_but_this_node_is_not_on_the_list() { - assert_eq!(migration_state(&1.into(), &KeyServerSetSnapshot { - current_set: vec![(2.into(), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), - new_set: vec![(3.into(), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), + assert_eq!(migration_state(&H512::from_low_u64_be(1), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(2), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(3), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), migration: None, }), MigrationState::Idle); } #[test] fn migration_state_is_idle_when_sets_are_equal() { - assert_eq!(migration_state(&1.into(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), - new_set: vec![(1.into(), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), + assert_eq!(migration_state(&H512::from_low_u64_be(1), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), migration: None, }), MigrationState::Idle); } #[test] fn migration_state_is_idle_when_only_address_changes() { - assert_eq!(migration_state(&1.into(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), - new_set: vec![(1.into(), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), + assert_eq!(migration_state(&H512::from_low_u64_be(1), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), migration: None, }), MigrationState::Idle); } #[test] fn migration_state_is_required_when_node_is_added() { - assert_eq!(migration_state(&1.into(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), - new_set: vec![(1.into(), "127.0.0.1:8080".parse().unwrap()), - (2.into(), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), + assert_eq!(migration_state(&H512::from_low_u64_be(1), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8080".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), migration: None, }), MigrationState::Required); } #[test] fn migration_state_is_required_when_node_is_removed() { - assert_eq!(migration_state(&1.into(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8080".parse().unwrap()), - (2.into(), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), - new_set: vec![(1.into(), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), + assert_eq!(migration_state(&H512::from_low_u64_be(1), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8080".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8081".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), migration: None, }), MigrationState::Required); } #[test] fn migration_state_is_started_when_migration_is_some() { - assert_eq!(migration_state(&1.into(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), + assert_eq!(migration_state(&H512::from_low_u64_be(1), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8080".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { id: Default::default(), @@ -517,35 +518,35 @@ mod tests { #[test] fn existing_master_is_selected_when_migration_has_started() { assert_eq!(select_master_node(&KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8180".parse().unwrap())].into_iter().collect(), - new_set: vec![(2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8180".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), migration: Some(KeyServerSetMigration { - master: 3.into(), + master: H512::from_low_u64_be(3), ..Default::default() }), - }), &3.into()); + }), &H512::from_low_u64_be(3)); } #[test] fn persistent_master_is_selected_when_migration_has_not_started_yet() { assert_eq!(select_master_node(&KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8180".parse().unwrap()), - (2.into(), "127.0.0.1:8180".parse().unwrap())].into_iter().collect(), - new_set: vec![(2.into(), "127.0.0.1:8181".parse().unwrap()), - (4.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8180".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8180".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(4), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), migration: None, - }), &2.into()); + }), &H512::from_low_u64_be(2)); } #[test] fn new_master_is_selected_in_worst_case() { assert_eq!(select_master_node(&KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8180".parse().unwrap()), - (2.into(), "127.0.0.1:8180".parse().unwrap())].into_iter().collect(), - new_set: vec![(3.into(), "127.0.0.1:8181".parse().unwrap()), - (4.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8180".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8180".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(3), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(4), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), migration: None, - }), &3.into()); + }), &H512::from_low_u64_be(3)); } #[test] @@ -574,29 +575,29 @@ mod tests { #[test] fn maintain_sessions_does_nothing_if_no_session_and_no_migration() { - assert_eq!(maintain_session(&1.into(), &Default::default(), &Default::default(), + assert_eq!(maintain_session(&H512::from_low_u64_be(1), &Default::default(), &Default::default(), MigrationState::Idle, SessionState::Idle), None); } #[test] fn maintain_session_does_nothing_when_migration_required_on_slave_node_and_no_session() { - assert_eq!(maintain_session(&2.into(), &vec![2.into()].into_iter().collect(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), - new_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(2), &vec![H512::from_low_u64_be(2)].into_iter().collect(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), migration: None, }, MigrationState::Required, SessionState::Idle), None); } #[test] fn maintain_session_does_nothing_when_migration_started_on_slave_node_and_no_session() { - assert_eq!(maintain_session(&2.into(), &vec![2.into()].into_iter().collect(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(2), &vec![H512::from_low_u64_be(2)].into_iter().collect(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { - master: 1.into(), - set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + master: H512::from_low_u64_be(1), + set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), ..Default::default() }), }, MigrationState::Started, SessionState::Idle), None); @@ -604,13 +605,13 @@ mod tests { #[test] fn maintain_session_does_nothing_when_migration_started_on_master_node_and_no_session_and_not_connected_to_migration_nodes() { - assert_eq!(maintain_session(&1.into(), &Default::default(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(1), &Default::default(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { - master: 1.into(), - set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + master: H512::from_low_u64_be(1), + set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), ..Default::default() }), }, MigrationState::Started, SessionState::Idle), None); @@ -618,13 +619,13 @@ mod tests { #[test] fn maintain_session_starts_session_when_migration_started_on_master_node_and_no_session() { - assert_eq!(maintain_session(&1.into(), &vec![2.into()].into_iter().collect(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(1), &vec![H512::from_low_u64_be(2)].into_iter().collect(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { - master: 1.into(), - set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + master: H512::from_low_u64_be(1), + set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), ..Default::default() }), }, MigrationState::Started, SessionState::Idle), Some(SessionAction::Start)); @@ -632,13 +633,13 @@ mod tests { #[test] fn maintain_session_does_nothing_when_both_migration_and_session_are_started() { - assert_eq!(maintain_session(&1.into(), &vec![2.into()].into_iter().collect(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(1), &vec![H512::from_low_u64_be(2)].into_iter().collect(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { - master: 1.into(), - set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + master: H512::from_low_u64_be(1), + set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), ..Default::default() }), }, MigrationState::Started, SessionState::Active(Default::default())), None); @@ -646,13 +647,13 @@ mod tests { #[test] fn maintain_session_confirms_migration_when_active_and_session_has_finished_on_new_node() { - assert_eq!(maintain_session(&1.into(), &vec![2.into()].into_iter().collect(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(1), &vec![H512::from_low_u64_be(2)].into_iter().collect(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { - master: 1.into(), - set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + master: H512::from_low_u64_be(1), + set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), ..Default::default() }), }, MigrationState::Started, SessionState::Finished(Default::default())), Some(SessionAction::ConfirmAndDrop(Default::default()))); @@ -660,13 +661,13 @@ mod tests { #[test] fn maintain_session_drops_session_when_active_and_session_has_finished_on_removed_node() { - assert_eq!(maintain_session(&1.into(), &vec![2.into()].into_iter().collect(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(1), &vec![H512::from_low_u64_be(2)].into_iter().collect(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { - master: 2.into(), - set: vec![(2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + master: H512::from_low_u64_be(2), + set: vec![(H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), ..Default::default() }), }, MigrationState::Started, SessionState::Finished(Default::default())), Some(SessionAction::Drop)); @@ -674,13 +675,13 @@ mod tests { #[test] fn maintain_session_drops_session_when_active_and_session_has_failed() { - assert_eq!(maintain_session(&1.into(), &vec![2.into()].into_iter().collect(), &KeyServerSetSnapshot { - current_set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + assert_eq!(maintain_session(&H512::from_low_u64_be(1), &vec![H512::from_low_u64_be(2)].into_iter().collect(), &KeyServerSetSnapshot { + current_set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), new_set: Default::default(), migration: Some(KeyServerSetMigration { - master: 1.into(), - set: vec![(1.into(), "127.0.0.1:8181".parse().unwrap()), - (2.into(), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), + master: H512::from_low_u64_be(1), + set: vec![(H512::from_low_u64_be(1), "127.0.0.1:8181".parse().unwrap()), + (H512::from_low_u64_be(2), "127.0.0.1:8181".parse().unwrap())].into_iter().collect(), ..Default::default() }), }, MigrationState::Started, SessionState::Failed(Default::default())), Some(SessionAction::Drop)); @@ -726,32 +727,32 @@ mod tests { fn maintain_session_detects_abnormal_when_active_migration_and_active_session_with_different_id() { assert_eq!(maintain_session(&Default::default(), &Default::default(), &KeyServerSetSnapshot { migration: Some(KeyServerSetMigration { - id: 0.into(), + id: H256::zero(), ..Default::default() }), ..Default::default() - }, MigrationState::Started, SessionState::Active(Some(1.into()))), Some(SessionAction::DropAndRetry)); + }, MigrationState::Started, SessionState::Active(Some(H256::from_low_u64_be(1)))), Some(SessionAction::DropAndRetry)); } #[test] fn maintain_session_detects_abnormal_when_active_migration_and_finished_session_with_different_id() { assert_eq!(maintain_session(&Default::default(), &Default::default(), &KeyServerSetSnapshot { migration: Some(KeyServerSetMigration { - id: 0.into(), + id: H256::zero(), ..Default::default() }), ..Default::default() - }, MigrationState::Started, SessionState::Finished(Some(1.into()))), Some(SessionAction::DropAndRetry)); + }, MigrationState::Started, SessionState::Finished(Some(H256::from_low_u64_be(1)))), Some(SessionAction::DropAndRetry)); } #[test] fn maintain_session_detects_abnormal_when_active_migration_and_failed_session_with_different_id() { assert_eq!(maintain_session(&Default::default(), &Default::default(), &KeyServerSetSnapshot { migration: Some(KeyServerSetMigration { - id: 0.into(), + id: H256::zero(), ..Default::default() }), ..Default::default() - }, MigrationState::Started, SessionState::Failed(Some(1.into()))), Some(SessionAction::DropAndRetry)); + }, MigrationState::Started, SessionState::Failed(Some(H256::from_low_u64_be(1)))), Some(SessionAction::DropAndRetry)); } } diff --git a/secret-store/src/key_server_cluster/io/message.rs b/secret-store/src/key_server_cluster/io/message.rs index 0ce2b7c01ff..5707bd809f2 100644 --- a/secret-store/src/key_server_cluster/io/message.rs +++ b/secret-store/src/key_server_cluster/io/message.rs @@ -22,7 +22,7 @@ use serde_json; use ethkey::crypto::ecies; use ethkey::{Secret, KeyPair}; use ethkey::math::curve_order; -use ethereum_types::{H256, U256}; +use ethereum_types::{H256, U256, BigEndianHash}; use key_server_cluster::Error; use key_server_cluster::message::{Message, ClusterMessage, GenerationMessage, EncryptionMessage, DecryptionMessage, SchnorrSigningMessage, EcdsaSigningMessage, ServersSetChangeMessage, ShareAddMessage, KeyVersionNegotiationMessage}; @@ -257,9 +257,9 @@ pub fn fix_shared_key(shared_secret: &Secret) -> Result { // secret key created in agree function is invalid, as it is not calculated mod EC.field.n // => let's do it manually let shared_secret: H256 = (**shared_secret).into(); - let shared_secret: U256 = shared_secret.into(); - let shared_secret: H256 = (shared_secret % curve_order()).into(); - let shared_key_pair = KeyPair::from_secret_slice(&*shared_secret)?; + let shared_secret: U256 = shared_secret.into_uint(); + let shared_secret: H256 = BigEndianHash::from_uint(&(shared_secret % curve_order())); + let shared_key_pair = KeyPair::from_secret_slice(shared_secret.as_bytes())?; Ok(shared_key_pair) } diff --git a/secret-store/src/key_server_cluster/jobs/consensus_session.rs b/secret-store/src/key_server_cluster/jobs/consensus_session.rs index 7daf05d3b41..7f293387084 100644 --- a/secret-store/src/key_server_cluster/jobs/consensus_session.rs +++ b/secret-store/src/key_server_cluster/jobs/consensus_session.rs @@ -354,7 +354,7 @@ impl Result<(), Error> { let consensus_result = match message { - + &ConsensusMessage::InitializeConsensusSession(ref message) => self.consensus_job.on_partial_request(sender, message.requester.clone().into()).map(|_| ()), &ConsensusMessage::ConfirmConsensusInitialization(ref message) => @@ -397,9 +397,9 @@ mod tests { #[test] fn consensus_session_consensus_is_not_reached_when_initializes_with_non_zero_threshold() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); @@ -408,9 +408,9 @@ mod tests { #[test] fn consensus_session_consensus_is_reached_when_initializes_with_zero_threshold() { let mut session = make_master_consensus_session(0, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); @@ -423,9 +423,9 @@ mod tests { acl_storage.prohibit(public_to_address(requester.public()), SessionId::default()); let mut session = make_master_consensus_session(0, Some(requester), Some(acl_storage)); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); @@ -438,16 +438,16 @@ mod tests { acl_storage.prohibit(public_to_address(requester.public()), SessionId::default()); let mut session = make_master_consensus_session(1, Some(requester), Some(acl_storage)); - assert_eq!(session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap_err(), Error::ConsensusUnreachable); + assert_eq!(session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap_err(), Error::ConsensusUnreachable); assert_eq!(session.state(), ConsensusSessionState::Failed); } #[test] fn consensus_session_consensus_is_failed_by_slave_node() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); - assert_eq!(session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + assert_eq!(session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: false, })).unwrap_err(), Error::ConsensusUnreachable); assert_eq!(session.state(), ConsensusSessionState::Failed); @@ -462,15 +462,15 @@ mod tests { #[test] fn consensus_session_job_dissemination_selects_master_node_if_agreed() { let mut session = make_master_consensus_session(0, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::Finished); - assert!(session.computation_job().responses().contains_key(&NodeId::from(1))); + assert!(session.computation_job().responses().contains_key(&NodeId::from_low_u64_be(1))); } #[test] @@ -480,39 +480,39 @@ mod tests { acl_storage.prohibit(public_to_address(requester.public()), SessionId::default()); let mut session = make_master_consensus_session(0, Some(requester), Some(acl_storage)); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - assert!(!session.computation_job().responses().contains_key(&NodeId::from(1))); + assert!(!session.computation_job().responses().contains_key(&NodeId::from_low_u64_be(1))); } #[test] fn consensus_session_computation_request_is_rejected_when_received_by_master_node() { let mut session = make_master_consensus_session(0, None, None); - assert_eq!(session.on_job_request(&NodeId::from(2), 2, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap_err(), Error::InvalidMessage); + assert_eq!(session.on_job_request(&NodeId::from_low_u64_be(2), 2, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap_err(), Error::InvalidMessage); } #[test] fn consensus_session_computation_request_is_rejected_when_received_before_consensus_is_established() { let mut session = make_slave_consensus_session(0, None); - assert_eq!(session.on_job_request(&NodeId::from(1), 2, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap_err(), Error::InvalidStateForRequest); + assert_eq!(session.on_job_request(&NodeId::from_low_u64_be(1), 2, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap_err(), Error::InvalidStateForRequest); } #[test] fn consensus_session_computation_request_is_ignored_when_wrong() { let mut session = make_slave_consensus_session(0, None); assert_eq!(session.state(), ConsensusSessionState::WaitingForInitialization); - session.on_consensus_message(&NodeId::from(1), &ConsensusMessage::InitializeConsensusSession(InitializeConsensusSession { + session.on_consensus_message(&NodeId::from_low_u64_be(1), &ConsensusMessage::InitializeConsensusSession(InitializeConsensusSession { requester: Requester::Signature(sign(Random.generate().unwrap().secret(), &SessionId::default()).unwrap()).into(), version: Default::default(), })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); - assert_eq!(session.on_job_request(&NodeId::from(1), 20, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap_err(), Error::InvalidMessage); + assert_eq!(session.on_job_request(&NodeId::from_low_u64_be(1), 20, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap_err(), Error::InvalidMessage); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); } @@ -520,159 +520,159 @@ mod tests { fn consensus_session_computation_request_is_processed_when_correct() { let mut session = make_slave_consensus_session(0, None); assert_eq!(session.state(), ConsensusSessionState::WaitingForInitialization); - session.on_consensus_message(&NodeId::from(1), &ConsensusMessage::InitializeConsensusSession(InitializeConsensusSession { + session.on_consensus_message(&NodeId::from_low_u64_be(1), &ConsensusMessage::InitializeConsensusSession(InitializeConsensusSession { requester: Requester::Signature(sign(Random.generate().unwrap().secret(), &SessionId::default()).unwrap()).into(), version: Default::default(), })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); - session.on_job_request(&NodeId::from(1), 2, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap(); + session.on_job_request(&NodeId::from_low_u64_be(1), 2, SquaredSumJobExecutor, DummyJobTransport::default()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); } #[test] fn consensus_session_computation_response_is_ignored_when_consensus_is_not_reached() { let mut session = make_master_consensus_session(1, None, None); - assert_eq!(session.on_job_response(&NodeId::from(2), 4).unwrap_err(), Error::InvalidStateForRequest); + assert_eq!(session.on_job_response(&NodeId::from_low_u64_be(2), 4).unwrap_err(), Error::InvalidStateForRequest); } #[test] fn consessus_session_completion_is_ignored_when_received_from_non_master_node() { let mut session = make_slave_consensus_session(0, None); - assert_eq!(session.on_session_completed(&NodeId::from(3)).unwrap_err(), Error::InvalidMessage); + assert_eq!(session.on_session_completed(&NodeId::from_low_u64_be(3)).unwrap_err(), Error::InvalidMessage); } #[test] fn consessus_session_completion_is_ignored_when_consensus_is_not_established() { let mut session = make_slave_consensus_session(0, None); - assert_eq!(session.on_session_completed(&NodeId::from(1)).unwrap_err(), Error::InvalidStateForRequest); + assert_eq!(session.on_session_completed(&NodeId::from_low_u64_be(1)).unwrap_err(), Error::InvalidStateForRequest); } #[test] fn consessus_session_completion_is_accepted() { let mut session = make_slave_consensus_session(0, None); - session.on_consensus_message(&NodeId::from(1), &ConsensusMessage::InitializeConsensusSession(InitializeConsensusSession { + session.on_consensus_message(&NodeId::from_low_u64_be(1), &ConsensusMessage::InitializeConsensusSession(InitializeConsensusSession { requester: Requester::Signature(sign(Random.generate().unwrap().secret(), &SessionId::default()).unwrap()).into(), version: Default::default(), })).unwrap(); - session.on_session_completed(&NodeId::from(1)).unwrap(); + session.on_session_completed(&NodeId::from_low_u64_be(1)).unwrap(); assert_eq!(session.state(), ConsensusSessionState::Finished); } #[test] fn consensus_session_fails_if_node_error_received_by_uninitialized_master() { let mut session = make_master_consensus_session(0, None, None); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); assert_eq!(session.state(), ConsensusSessionState::Failed); } #[test] fn consensus_session_fails_if_node_error_received_by_uninitialized_slave_from_master() { let mut session = make_slave_consensus_session(0, None); - assert_eq!(session.on_node_error(&NodeId::from(1), Error::AccessDenied), Err(Error::ConsensusUnreachable)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(1), Error::AccessDenied), Err(Error::ConsensusUnreachable)); assert_eq!(session.state(), ConsensusSessionState::Failed); } #[test] fn consensus_sessions_fails_with_temp_error_if_node_error_received_by_uninitialized_slave_from_master() { let mut session = make_slave_consensus_session(0, None); - assert_eq!(session.on_node_error(&NodeId::from(1), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(1), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); } #[test] fn consensus_session_continues_if_node_error_received_by_master_during_establish_and_enough_nodes_left() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3)].into_iter().collect()).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied), Ok(false)); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3)].into_iter().collect()).unwrap(); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied), Ok(false)); } #[test] fn consensus_session_fails_if_node_error_received_by_master_during_establish_and_not_enough_nodes_left() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); assert_eq!(session.state(), ConsensusSessionState::Failed); } #[test] fn consensus_session_continues_if_node2_error_received_by_master_after_consensus_established_and_enough_nodes_left() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied), Ok(false)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied), Ok(false)); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); } #[test] fn consensus_session_continues_if_node3_error_received_by_master_after_consensus_established_and_enough_nodes_left() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(3), Error::AccessDenied), Ok(false)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied), Ok(false)); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); } #[test] fn consensus_session_fails_if_node_error_received_by_master_after_consensus_established_and_not_enough_nodes_left() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); assert_eq!(session.state(), ConsensusSessionState::Failed); } #[test] fn consensus_session_continues_if_node_error_received_from_slave_not_participating_in_computation() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3), NodeId::from(4)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3), NodeId::from_low_u64_be(4)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); - session.on_consensus_message(&NodeId::from(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(3), Error::AccessDenied), Ok(false)); - assert_eq!(session.on_node_error(&NodeId::from(4), Error::AccessDenied), Ok(false)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied), Ok(false)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(4), Error::AccessDenied), Ok(false)); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); } #[test] fn consensus_session_restarts_if_node_error_received_from_slave_participating_in_computation_and_enough_nodes_left() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3), NodeId::from(4)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3), NodeId::from_low_u64_be(4)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - session.on_consensus_message(&NodeId::from(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied), Ok(true)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied), Ok(true)); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - assert_eq!(session.on_node_error(&NodeId::from(3), Error::AccessDenied), Ok(false)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied), Ok(false)); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); } #[test] fn consensus_session_fails_if_node_error_received_from_slave_participating_in_computation_and_not_enough_nodes_left() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied), Err(Error::ConsensusUnreachable)); assert_eq!(session.state(), ConsensusSessionState::Failed); } @@ -685,15 +685,15 @@ mod tests { #[test] fn consensus_session_continues_if_session_timeouts_and_enough_nodes_left_for_computation() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3), NodeId::from(4)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3), NodeId::from_low_u64_be(4)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - session.on_consensus_message(&NodeId::from(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.on_session_timeout(), Ok(true)); @@ -709,8 +709,8 @@ mod tests { #[test] fn consensus_session_continues_if_session_timeouts_and_not_enough_nodes_left_for_computation() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); @@ -723,11 +723,11 @@ mod tests { #[test] fn same_consensus_group_returned_after_second_selection() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3)].into_iter().collect()).unwrap(); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3)].into_iter().collect()).unwrap(); + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); - session.on_consensus_message(&NodeId::from(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); @@ -739,15 +739,15 @@ mod tests { #[test] fn consensus_session_complete_2_of_4() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3), NodeId::from(3)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3), NodeId::from_low_u64_be(3)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - session.on_job_response(&NodeId::from(2), 16).unwrap(); + session.on_job_response(&NodeId::from_low_u64_be(2), 16).unwrap(); assert_eq!(session.state(), ConsensusSessionState::Finished); assert_eq!(session.result(), Ok(20)); } @@ -755,9 +755,9 @@ mod tests { #[test] fn consensus_session_complete_2_of_4_after_restart() { let mut session = make_master_consensus_session(1, None, None); - session.initialize(vec![NodeId::from(1), NodeId::from(2), NodeId::from(3), NodeId::from(4)].into_iter().collect()).unwrap(); + session.initialize(vec![NodeId::from_low_u64_be(1), NodeId::from_low_u64_be(2), NodeId::from_low_u64_be(3), NodeId::from_low_u64_be(4)].into_iter().collect()).unwrap(); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); - session.on_consensus_message(&NodeId::from(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(2), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); @@ -765,20 +765,20 @@ mod tests { session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - session.on_consensus_message(&NodeId::from(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(3), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); - assert_eq!(session.on_node_error(&NodeId::from(2), Error::AccessDenied).unwrap(), true); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied).unwrap(), true); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - assert_eq!(session.on_node_error(&NodeId::from(3), Error::AccessDenied).unwrap(), false); + assert_eq!(session.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied).unwrap(), false); assert_eq!(session.state(), ConsensusSessionState::EstablishingConsensus); - session.on_consensus_message(&NodeId::from(4), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { + session.on_consensus_message(&NodeId::from_low_u64_be(4), &ConsensusMessage::ConfirmConsensusInitialization(ConfirmConsensusInitialization { is_confirmed: true, })).unwrap(); assert_eq!(session.state(), ConsensusSessionState::ConsensusEstablished); @@ -786,7 +786,7 @@ mod tests { session.disseminate_jobs(SquaredSumJobExecutor, DummyJobTransport::default(), false).unwrap(); assert_eq!(session.state(), ConsensusSessionState::WaitingForPartialResults); - session.on_job_response(&NodeId::from(4), 16).unwrap(); + session.on_job_response(&NodeId::from_low_u64_be(4), 16).unwrap(); assert_eq!(session.state(), ConsensusSessionState::Finished); assert_eq!(session.result(), Ok(20)); } diff --git a/secret-store/src/key_server_cluster/jobs/decryption_job.rs b/secret-store/src/key_server_cluster/jobs/decryption_job.rs index ca3df29b2da..e57255f8514 100644 --- a/secret-store/src/key_server_cluster/jobs/decryption_job.rs +++ b/secret-store/src/key_server_cluster/jobs/decryption_job.rs @@ -150,7 +150,7 @@ impl JobExecutor for DecryptionJob { shadow_point: shadow_point, decrypt_shadow: match decrypt_shadow.clone() { None => None, - Some(decrypt_shadow) => Some(encrypt(&self.requester, &DEFAULT_MAC, &**decrypt_shadow)?), + Some(decrypt_shadow) => Some(encrypt(&self.requester, &DEFAULT_MAC, decrypt_shadow.as_bytes())?), }, })) } diff --git a/secret-store/src/key_server_cluster/jobs/job_session.rs b/secret-store/src/key_server_cluster/jobs/job_session.rs index d76f8addafb..0af8ea2d008 100644 --- a/secret-store/src/key_server_cluster/jobs/job_session.rs +++ b/secret-store/src/key_server_cluster/jobs/job_session.rs @@ -434,12 +434,12 @@ pub mod tests { } pub fn make_master_session_meta(threshold: usize) -> SessionMeta { - SessionMeta { id: SessionId::default(), master_node_id: NodeId::from(1), self_node_id: NodeId::from(1), threshold: threshold, + SessionMeta { id: SessionId::default(), master_node_id: NodeId::from_low_u64_be(1), self_node_id: NodeId::from_low_u64_be(1), threshold: threshold, configured_nodes_count: 5, connected_nodes_count: 5 } } pub fn make_slave_session_meta(threshold: usize) -> SessionMeta { - SessionMeta { id: SessionId::default(), master_node_id: NodeId::from(1), self_node_id: NodeId::from(2), threshold: threshold, + SessionMeta { id: SessionId::default(), master_node_id: NodeId::from_low_u64_be(1), self_node_id: NodeId::from_low_u64_be(2), threshold: threshold, configured_nodes_count: 5, connected_nodes_count: 5 } } @@ -447,27 +447,27 @@ pub mod tests { fn job_initialize_fails_if_not_enough_nodes_for_threshold_total() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); job.meta.configured_nodes_count = 1; - assert_eq!(job.initialize(vec![Public::from(1)].into_iter().collect(), None, false).unwrap_err(), Error::ConsensusUnreachable); + assert_eq!(job.initialize(vec![Public::from_low_u64_be(1)].into_iter().collect(), None, false).unwrap_err(), Error::ConsensusUnreachable); } #[test] fn job_initialize_fails_if_not_enough_nodes_for_threshold_connected() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); job.meta.connected_nodes_count = 3; - assert_eq!(job.initialize(vec![Public::from(1)].into_iter().collect(), None, false).unwrap_err(), Error::ConsensusTemporaryUnreachable); + assert_eq!(job.initialize(vec![Public::from_low_u64_be(1)].into_iter().collect(), None, false).unwrap_err(), Error::ConsensusTemporaryUnreachable); } #[test] fn job_initialize_fails_if_not_inactive() { let mut job = JobSession::new(make_master_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1)].into_iter().collect(), None, false).unwrap(); - assert_eq!(job.initialize(vec![Public::from(1)].into_iter().collect(), None, false).unwrap_err(), Error::InvalidStateForRequest); + job.initialize(vec![Public::from_low_u64_be(1)].into_iter().collect(), None, false).unwrap(); + assert_eq!(job.initialize(vec![Public::from_low_u64_be(1)].into_iter().collect(), None, false).unwrap_err(), Error::InvalidStateForRequest); } #[test] fn job_initialization_leads_to_finish_if_single_node_is_required() { let mut job = JobSession::new(make_master_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Finished); assert!(job.is_result_ready()); assert_eq!(job.result(), Ok(4)); @@ -476,77 +476,77 @@ pub mod tests { #[test] fn job_initialization_does_not_leads_to_finish_if_single_other_node_is_required() { let mut job = JobSession::new(make_master_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(2)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); } #[test] fn job_request_fails_if_comes_from_non_master_node() { let mut job = JobSession::new(make_slave_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - assert_eq!(job.on_partial_request(&NodeId::from(3), 2).unwrap_err(), Error::InvalidMessage); + assert_eq!(job.on_partial_request(&NodeId::from_low_u64_be(3), 2).unwrap_err(), Error::InvalidMessage); } #[test] fn job_request_fails_if_comes_to_master_node() { let mut job = JobSession::new(make_master_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - assert_eq!(job.on_partial_request(&NodeId::from(1), 2).unwrap_err(), Error::InvalidMessage); + assert_eq!(job.on_partial_request(&NodeId::from_low_u64_be(1), 2).unwrap_err(), Error::InvalidMessage); } #[test] fn job_request_fails_if_comes_to_failed_state() { let mut job = JobSession::new(make_slave_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); job.on_session_timeout().unwrap_err(); - assert_eq!(job.on_partial_request(&NodeId::from(1), 2).unwrap_err(), Error::InvalidStateForRequest); + assert_eq!(job.on_partial_request(&NodeId::from_low_u64_be(1), 2).unwrap_err(), Error::InvalidStateForRequest); } #[test] fn job_request_succeeds_if_comes_to_finished_state() { let mut job = JobSession::new(make_slave_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - job.on_partial_request(&NodeId::from(1), 2).unwrap(); - assert_eq!(job.transport().response(), (NodeId::from(1), 4)); + job.on_partial_request(&NodeId::from_low_u64_be(1), 2).unwrap(); + assert_eq!(job.transport().response(), (NodeId::from_low_u64_be(1), 4)); assert_eq!(job.state(), JobSessionState::Finished); - job.on_partial_request(&NodeId::from(1), 3).unwrap(); - assert_eq!(job.transport().response(), (NodeId::from(1), 9)); + job.on_partial_request(&NodeId::from_low_u64_be(1), 3).unwrap(); + assert_eq!(job.transport().response(), (NodeId::from_low_u64_be(1), 9)); assert_eq!(job.state(), JobSessionState::Finished); } #[test] fn job_response_fails_if_comes_to_slave_node() { let mut job = JobSession::new(make_slave_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - assert_eq!(job.on_partial_response(&NodeId::from(1), 2).unwrap_err(), Error::InvalidMessage); + assert_eq!(job.on_partial_response(&NodeId::from_low_u64_be(1), 2).unwrap_err(), Error::InvalidMessage); } #[test] fn job_response_fails_if_comes_to_failed_state() { let mut job = JobSession::new(make_master_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(2)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); job.on_session_timeout().unwrap_err(); - assert_eq!(job.on_partial_response(&NodeId::from(2), 2).unwrap_err(), Error::InvalidStateForRequest); + assert_eq!(job.on_partial_response(&NodeId::from_low_u64_be(2), 2).unwrap_err(), Error::InvalidStateForRequest); } #[test] fn job_response_fails_if_comes_from_unknown_node() { let mut job = JobSession::new(make_master_session_meta(0), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(2)].into_iter().collect(), None, false).unwrap(); - assert_eq!(job.on_partial_response(&NodeId::from(3), 2).unwrap_err(), Error::InvalidNodeForRequest); + job.initialize(vec![Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); + assert_eq!(job.on_partial_response(&NodeId::from_low_u64_be(3), 2).unwrap_err(), Error::InvalidNodeForRequest); } #[test] fn job_response_leads_to_failure_if_too_few_nodes_left() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); - assert_eq!(job.on_partial_response(&NodeId::from(2), 3).unwrap_err(), Error::ConsensusUnreachable); + assert_eq!(job.on_partial_response(&NodeId::from_low_u64_be(2), 3).unwrap_err(), Error::ConsensusUnreachable); assert_eq!(job.state(), JobSessionState::Failed); } #[test] fn job_response_succeeds() { let mut job = JobSession::new(make_master_session_meta(2), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2), Public::from(3)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2), Public::from_low_u64_be(3)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); assert!(!job.is_result_ready()); - job.on_partial_response(&NodeId::from(2), 2).unwrap(); + job.on_partial_response(&NodeId::from_low_u64_be(2), 2).unwrap(); assert_eq!(job.state(), JobSessionState::Active); assert!(!job.is_result_ready()); } @@ -554,9 +554,9 @@ pub mod tests { #[test] fn job_response_leads_to_finish() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); - job.on_partial_response(&NodeId::from(2), 2).unwrap(); + job.on_partial_response(&NodeId::from_low_u64_be(2), 2).unwrap(); assert_eq!(job.state(), JobSessionState::Finished); } @@ -564,7 +564,7 @@ pub mod tests { fn job_node_error_ignored_when_slave_disconnects_from_slave() { let mut job = JobSession::new(make_slave_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); assert_eq!(job.state(), JobSessionState::Inactive); - job.on_node_error(&NodeId::from(3), Error::AccessDenied).unwrap(); + job.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied).unwrap(); assert_eq!(job.state(), JobSessionState::Inactive); } @@ -572,59 +572,59 @@ pub mod tests { fn job_node_error_leads_to_fail_when_slave_disconnects_from_master() { let mut job = JobSession::new(make_slave_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); assert_eq!(job.state(), JobSessionState::Inactive); - assert_eq!(job.on_node_error(&NodeId::from(1), Error::AccessDenied).unwrap_err(), Error::ConsensusUnreachable); + assert_eq!(job.on_node_error(&NodeId::from_low_u64_be(1), Error::AccessDenied).unwrap_err(), Error::ConsensusUnreachable); assert_eq!(job.state(), JobSessionState::Failed); } #[test] fn job_node_error_ignored_when_disconnects_from_rejected() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2), Public::from(3)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2), Public::from_low_u64_be(3)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); - job.on_partial_response(&NodeId::from(2), 3).unwrap(); - job.on_node_error(&NodeId::from(2), Error::AccessDenied).unwrap(); + job.on_partial_response(&NodeId::from_low_u64_be(2), 3).unwrap(); + job.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied).unwrap(); assert_eq!(job.state(), JobSessionState::Active); } #[test] fn job_node_error_ignored_when_disconnects_from_unknown() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); - job.on_node_error(&NodeId::from(3), Error::AccessDenied).unwrap(); + job.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied).unwrap(); assert_eq!(job.state(), JobSessionState::Active); } #[test] fn job_node_error_ignored_when_disconnects_from_requested_and_enough_nodes_left() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2), Public::from(3)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2), Public::from_low_u64_be(3)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); - job.on_node_error(&NodeId::from(3), Error::AccessDenied).unwrap(); + job.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied).unwrap(); assert_eq!(job.state(), JobSessionState::Active); } #[test] fn job_node_error_leads_to_fail_when_disconnects_from_requested_and_not_enough_nodes_left() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); - assert_eq!(job.on_node_error(&NodeId::from(2), Error::AccessDenied).unwrap_err(), Error::ConsensusUnreachable); + assert_eq!(job.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied).unwrap_err(), Error::ConsensusUnreachable); assert_eq!(job.state(), JobSessionState::Failed); } #[test] fn job_broadcasts_self_response() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2)].into_iter().collect(), None, true).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2)].into_iter().collect(), None, true).unwrap(); assert_eq!(job.state(), JobSessionState::Active); - assert_eq!(job.transport().response(), (NodeId::from(2), 4)); + assert_eq!(job.transport().response(), (NodeId::from_low_u64_be(2), 4)); } #[test] fn job_does_not_broadcasts_self_response() { let mut job = JobSession::new(make_master_session_meta(1), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2)].into_iter().collect(), None, false).unwrap(); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2)].into_iter().collect(), None, false).unwrap(); assert_eq!(job.state(), JobSessionState::Active); assert!(job.transport().is_empty_response()); } @@ -632,30 +632,30 @@ pub mod tests { #[test] fn job_fails_with_temp_error_if_more_than_half_nodes_respond_with_temp_error() { let mut job = JobSession::new(make_master_session_meta(2), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2), Public::from(3), Public::from(4)].into_iter().collect(), None, false).unwrap(); - job.on_node_error(&NodeId::from(2), Error::NodeDisconnected).unwrap(); - assert_eq!(job.on_node_error(&NodeId::from(3), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2), Public::from_low_u64_be(3), Public::from_low_u64_be(4)].into_iter().collect(), None, false).unwrap(); + job.on_node_error(&NodeId::from_low_u64_be(2), Error::NodeDisconnected).unwrap(); + assert_eq!(job.on_node_error(&NodeId::from_low_u64_be(3), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); } #[test] fn job_fails_with_temp_error_if_more_than_half_rejects_are_temp() { let mut job = JobSession::new(make_master_session_meta(2), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2), Public::from(3), Public::from(4)].into_iter().collect(), None, false).unwrap(); - job.on_node_error(&NodeId::from(2), Error::NodeDisconnected).unwrap(); - assert_eq!(job.on_node_error(&NodeId::from(3), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2), Public::from_low_u64_be(3), Public::from_low_u64_be(4)].into_iter().collect(), None, false).unwrap(); + job.on_node_error(&NodeId::from_low_u64_be(2), Error::NodeDisconnected).unwrap(); + assert_eq!(job.on_node_error(&NodeId::from_low_u64_be(3), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); } #[test] fn job_fails_if_more_than_half_rejects_are_non_temp() { let mut job = JobSession::new(make_master_session_meta(2), SquaredSumJobExecutor, DummyJobTransport::default()); - job.initialize(vec![Public::from(1), Public::from(2), Public::from(3), Public::from(4)].into_iter().collect(), None, false).unwrap(); - job.on_node_error(&NodeId::from(2), Error::AccessDenied).unwrap(); - assert_eq!(job.on_node_error(&NodeId::from(3), Error::AccessDenied).unwrap_err(), Error::ConsensusUnreachable); + job.initialize(vec![Public::from_low_u64_be(1), Public::from_low_u64_be(2), Public::from_low_u64_be(3), Public::from_low_u64_be(4)].into_iter().collect(), None, false).unwrap(); + job.on_node_error(&NodeId::from_low_u64_be(2), Error::AccessDenied).unwrap(); + assert_eq!(job.on_node_error(&NodeId::from_low_u64_be(3), Error::AccessDenied).unwrap_err(), Error::ConsensusUnreachable); } #[test] fn job_fails_with_temp_error_when_temp_error_is_reported_by_master_node() { let mut job = JobSession::new(make_slave_session_meta(2), SquaredSumJobExecutor, DummyJobTransport::default()); - assert_eq!(job.on_node_error(&NodeId::from(1), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); + assert_eq!(job.on_node_error(&NodeId::from_low_u64_be(1), Error::NodeDisconnected).unwrap_err(), Error::ConsensusTemporaryUnreachable); } } diff --git a/secret-store/src/key_server_cluster/jobs/servers_set_change_access_job.rs b/secret-store/src/key_server_cluster/jobs/servers_set_change_access_job.rs index ace5021a058..a37e0749972 100644 --- a/secret-store/src/key_server_cluster/jobs/servers_set_change_access_job.rs +++ b/secret-store/src/key_server_cluster/jobs/servers_set_change_access_job.rs @@ -139,7 +139,7 @@ impl JobExecutor for ServersSetChangeAccessJob { pub fn ordered_nodes_hash(nodes: &BTreeSet) -> SessionId { let mut nodes_keccak = Keccak::new_keccak256(); for node in nodes { - nodes_keccak.update(&*node); + nodes_keccak.update(node.as_bytes()); } let mut nodes_keccak_value = [0u8; 32]; diff --git a/secret-store/src/key_server_cluster/math.rs b/secret-store/src/key_server_cluster/math.rs index 60d48b7f3c1..99340e492ff 100644 --- a/secret-store/src/key_server_cluster/math.rs +++ b/secret-store/src/key_server_cluster/math.rs @@ -15,7 +15,7 @@ // along with Parity Ethereum. If not, see . use ethkey::{Public, Secret, Signature, Random, Generator, math}; -use ethereum_types::{H256, U256}; +use ethereum_types::{H256, U256, BigEndianHash}; use hash::keccak; use key_server_cluster::Error; @@ -35,8 +35,8 @@ pub fn zero_scalar() -> Secret { /// Convert hash to EC scalar (modulo curve order). pub fn to_scalar(hash: H256) -> Result { - let scalar: U256 = hash.into(); - let scalar: H256 = (scalar % math::curve_order()).into(); + let scalar: U256 = hash.into_uint(); + let scalar: H256 = BigEndianHash::from_uint(&(scalar % math::curve_order())); let scalar = Secret::from(scalar.0); scalar.check_validity()?; Ok(scalar) @@ -54,12 +54,12 @@ pub fn generate_random_point() -> Result { /// Get X coordinate of point. fn public_x(public: &Public) -> H256 { - public[0..32].into() + H256::from_slice(&public.as_bytes()[0..32]) } /// Get Y coordinate of point. fn public_y(public: &Public) -> H256 { - public[32..64].into() + H256::from_slice(&public.as_bytes()[32..64]) } /// Compute publics sum. @@ -478,7 +478,7 @@ pub fn serialize_ecdsa_signature(nonce_public: &Public, signature_r: Secret, mut // compute recovery param let mut signature_v = { let nonce_public_x = public_x(nonce_public); - let nonce_public_y: U256 = public_y(nonce_public).into(); + let nonce_public_y: U256 = public_y(nonce_public).into_uint(); let nonce_public_y_is_odd = !(nonce_public_y % 2).is_zero(); let bit0 = if nonce_public_y_is_odd { 1u8 } else { 0u8 }; let bit1 = if nonce_public_x != *signature_r { 2u8 } else { 0u8 }; @@ -488,17 +488,17 @@ pub fn serialize_ecdsa_signature(nonce_public: &Public, signature_r: Secret, mut // fix high S let curve_order = math::curve_order(); let curve_order_half = curve_order / 2; - let s_numeric: U256 = (*signature_s).into(); + let s_numeric: U256 = (*signature_s).into_uint(); if s_numeric > curve_order_half { - let signature_s_hash: H256 = (curve_order - s_numeric).into(); + let signature_s_hash: H256 = BigEndianHash::from_uint(&(curve_order - s_numeric)); signature_s = signature_s_hash.into(); signature_v ^= 1; } // serialize as [r][s]v let mut signature = [0u8; 65]; - signature[..32].copy_from_slice(&**signature_r); - signature[32..64].copy_from_slice(&**signature_s); + signature[..32].copy_from_slice(signature_r.as_bytes()); + signature[32..64].copy_from_slice(signature_s.as_bytes()); signature[64] = signature_v; signature.into() diff --git a/secret-store/src/key_server_set.rs b/secret-store/src/key_server_set.rs index 5b25641aeec..3002a3c12be 100644 --- a/secret-store/src/key_server_set.rs +++ b/secret-store/src/key_server_set.rs @@ -583,7 +583,7 @@ fn block_confirmations(client: &BlockChainClient, block: H256) -> Option { pub mod tests { use std::collections::BTreeMap; use std::net::SocketAddr; - use ethereum_types::H256; + use ethereum_types::{H256, H512}; use ethkey::Public; use super::{update_future_set, update_number_of_confirmations, FutureNewSet, KeyServerSet, KeyServerSetSnapshot, MIGRATION_CONFIRMATIONS_REQUIRED}; @@ -675,18 +675,18 @@ pub mod tests { let mut future_new_set = None; let mut new_snapshot = KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(2.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), ..Default::default() }; update_future_set(&mut future_new_set, &mut new_snapshot, Default::default()); assert_eq!(future_new_set, Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), block: Default::default(), })); assert_eq!(new_snapshot, KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(1.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), ..Default::default() }); } @@ -696,22 +696,22 @@ pub mod tests { let address = "127.0.0.1:12000".parse().unwrap(); let mut future_new_set = Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), block: Default::default(), }); let mut new_snapshot = KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(3.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(3), address)].into_iter().collect(), ..Default::default() }; - update_future_set(&mut future_new_set, &mut new_snapshot, 1.into()); + update_future_set(&mut future_new_set, &mut new_snapshot, H256::from_low_u64_be(1)); assert_eq!(future_new_set, Some(FutureNewSet { - new_set: vec![(3.into(), address)].into_iter().collect(), - block: 1.into(), + new_set: vec![(H512::from_low_u64_be(3), address)].into_iter().collect(), + block: H256::from_low_u64_be(1), })); assert_eq!(new_snapshot, KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(1.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), ..Default::default() }); } @@ -721,22 +721,22 @@ pub mod tests { let address = "127.0.0.1:12000".parse().unwrap(); let mut future_new_set = Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), block: Default::default(), }); let mut new_snapshot = KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(2.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), ..Default::default() }; - update_future_set(&mut future_new_set, &mut new_snapshot, 1.into()); + update_future_set(&mut future_new_set, &mut new_snapshot, H256::from_low_u64_be(1)); assert_eq!(future_new_set, Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), block: Default::default(), })); assert_eq!(new_snapshot, KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(1.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), ..Default::default() }); } @@ -747,13 +747,13 @@ pub mod tests { let mut future_new_set = None; let mut snapshot = KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(1.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), ..Default::default() }; let snapshot_copy = snapshot.clone(); update_number_of_confirmations( - &|| 1.into(), + &|| H256::from_low_u64_be(1), &|_| Some(MIGRATION_CONFIRMATIONS_REQUIRED), &mut future_new_set, &mut snapshot); assert_eq!(future_new_set, None); @@ -765,22 +765,22 @@ pub mod tests { let address = "127.0.0.1:12000".parse().unwrap(); let mut future_new_set = Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), block: Default::default(), }); let mut snapshot = KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(1.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), ..Default::default() }; update_number_of_confirmations( - &|| 1.into(), + &|| H256::from_low_u64_be(1), &|_| Some(MIGRATION_CONFIRMATIONS_REQUIRED), &mut future_new_set, &mut snapshot); assert_eq!(future_new_set, None); assert_eq!(snapshot, KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(2.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), ..Default::default() }); } @@ -790,18 +790,18 @@ pub mod tests { let address = "127.0.0.1:12000".parse().unwrap(); let mut future_new_set = Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), block: Default::default(), }); let mut snapshot = KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(1.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), ..Default::default() }; let future_new_set_copy = future_new_set.clone(); let snapshot_copy = snapshot.clone(); update_number_of_confirmations( - &|| 1.into(), + &|| H256::from_low_u64_be(1), &|_| Some(MIGRATION_CONFIRMATIONS_REQUIRED - 1), &mut future_new_set, &mut snapshot); assert_eq!(future_new_set, future_new_set_copy); @@ -813,22 +813,22 @@ pub mod tests { let address = "127.0.0.1:12000".parse().unwrap(); let mut future_new_set = Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), - block: 1.into(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), + block: H256::from_low_u64_be(1), }); let mut snapshot = KeyServerSetSnapshot { - current_set: vec![(1.into(), address)].into_iter().collect(), - new_set: vec![(1.into(), address)].into_iter().collect(), + current_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), + new_set: vec![(H512::from_low_u64_be(1), address)].into_iter().collect(), ..Default::default() }; let snapshot_copy = snapshot.clone(); update_number_of_confirmations( - &|| 2.into(), + &|| H256::from_low_u64_be(2), &|_| None, &mut future_new_set, &mut snapshot); assert_eq!(future_new_set, Some(FutureNewSet { - new_set: vec![(2.into(), address)].into_iter().collect(), - block: 2.into(), + new_set: vec![(H512::from_low_u64_be(2), address)].into_iter().collect(), + block: H256::from_low_u64_be(2), })); assert_eq!(snapshot, snapshot_copy); } diff --git a/secret-store/src/key_storage.rs b/secret-store/src/key_storage.rs index 36edae43ed5..b5f2b1f4fe8 100644 --- a/secret-store/src/key_storage.rs +++ b/secret-store/src/key_storage.rs @@ -199,7 +199,7 @@ fn upgrade_db(db: Arc) -> Result, Error> { common_point: Some(v0_key.common_point), encrypted_point: Some(v0_key.encrypted_point), versions: vec![CurrentSerializableDocumentKeyVersion { - hash: DocumentKeyShareVersion::data_hash(v0_key.id_numbers.iter().map(|(k, v)| (&***k, &****v))).into(), + hash: DocumentKeyShareVersion::data_hash(v0_key.id_numbers.iter().map(|(k, v)| (k.as_bytes(), v.as_bytes()))).into(), id_numbers: v0_key.id_numbers, secret_share: v0_key.secret_share, }], @@ -222,7 +222,7 @@ fn upgrade_db(db: Arc) -> Result, Error> { common_point: v1_key.common_point, encrypted_point: v1_key.encrypted_point, versions: vec![CurrentSerializableDocumentKeyVersion { - hash: DocumentKeyShareVersion::data_hash(v1_key.id_numbers.iter().map(|(k, v)| (&***k, &****v))).into(), + hash: DocumentKeyShareVersion::data_hash(v1_key.id_numbers.iter().map(|(k, v)| (k.as_bytes(), v.as_bytes()))).into(), id_numbers: v1_key.id_numbers, secret_share: v1_key.secret_share, }], @@ -262,7 +262,7 @@ impl KeyStorage for PersistentKeyStorage { let key: CurrentSerializableDocumentKeyShare = key.into(); let key = serde_json::to_vec(&key).map_err(|e| Error::Database(e.to_string()))?; let mut batch = self.db.transaction(); - batch.put(None, &document, &key); + batch.put(None, document.as_bytes(), &key); self.db.write(batch).map_err(Into::into) } @@ -271,7 +271,7 @@ impl KeyStorage for PersistentKeyStorage { } fn get(&self, document: &ServerKeyId) -> Result, Error> { - self.db.get(None, document) + self.db.get(None, document.as_bytes()) .map_err(|e| Error::Database(e.to_string())) .and_then(|key| match key { None => Ok(None), @@ -284,21 +284,21 @@ impl KeyStorage for PersistentKeyStorage { fn remove(&self, document: &ServerKeyId) -> Result<(), Error> { let mut batch = self.db.transaction(); - batch.delete(None, &document); + batch.delete(None, document.as_bytes()); self.db.write(batch).map_err(Into::into) } fn clear(&self) -> Result<(), Error> { let mut batch = self.db.transaction(); for (key, _) in self.iter() { - batch.delete(None, &key); + batch.delete(None, key.as_bytes()); } self.db.write(batch) .map_err(|e| Error::Database(e.to_string())) } fn contains(&self, document: &ServerKeyId) -> bool { - self.db.get(None, document) + self.db.get(None, document.as_bytes()) .map(|k| k.is_some()) .unwrap_or(false) } @@ -317,7 +317,7 @@ impl<'a> Iterator for PersistentKeyStorageIterator<'a> { self.iter.as_mut().next() .and_then(|(db_key, db_val)| serde_json::from_slice::(&db_val) .ok() - .map(|key| ((*db_key).into(), key.into()))) + .map(|key| (ServerKeyId::from_slice(&*db_key), key.into()))) } } @@ -342,7 +342,7 @@ impl DocumentKeyShareVersion { /// Create new version pub fn new(id_numbers: BTreeMap, secret_share: Secret) -> Self { DocumentKeyShareVersion { - hash: Self::data_hash(id_numbers.iter().map(|(k, v)| (&**k, &***v))), + hash: Self::data_hash(id_numbers.iter().map(|(k, v)| (k.as_bytes(), v.as_bytes()))), id_numbers: id_numbers, secret_share: secret_share, } @@ -412,10 +412,11 @@ pub mod tests { use std::collections::HashMap; use std::sync::Arc; + use std::str::FromStr; use parking_lot::RwLock; use serde_json; use self::tempdir::TempDir; - use ethereum_types::{Address, H256}; + use ethereum_types::{Address, H256, H512}; use ethkey::{Random, Generator, Public, Secret, public_to_address}; use kvdb_rocksdb::Database; use types::{Error, ServerKeyId}; @@ -466,7 +467,7 @@ pub mod tests { #[test] fn persistent_key_storage() { let tempdir = TempDir::new("").unwrap(); - let key1 = ServerKeyId::from(1); + let key1 = ServerKeyId::from_low_u64_be(1); let value1 = DocumentKeyShare { author: Default::default(), threshold: 100, @@ -481,7 +482,7 @@ pub mod tests { secret_share: Random.generate().unwrap().secret().clone(), }], }; - let key2 = ServerKeyId::from(2); + let key2 = ServerKeyId::from_low_u64_be(2); let value2 = DocumentKeyShare { author: Default::default(), threshold: 200, @@ -496,7 +497,7 @@ pub mod tests { secret_share: Random.generate().unwrap().secret().clone(), }], }; - let key3 = ServerKeyId::from(3); + let key3 = ServerKeyId::from_low_u64_be(3); let db = Database::open_default(&tempdir.path().display().to_string()).unwrap(); @@ -526,12 +527,12 @@ pub mod tests { let key = serde_json::to_vec(&SerializableDocumentKeyShareV0 { threshold: 777, id_numbers: vec![( - "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into(), + H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap().into(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse::().unwrap().into(), )].into_iter().collect(), secret_share: "00125d85a05e5e63e214cb60fe63f132eec8a103aa29266b7e6e6c5b7597230b".parse::().unwrap().into(), - common_point: "99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc".into(), - encrypted_point: "7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c".into(), + common_point: H512::from_str("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc").unwrap().into(), + encrypted_point: H512::from_str("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c").unwrap().into(), }).unwrap(); let mut batch = db.transaction(); batch.put(None, &[7], &key); @@ -565,15 +566,15 @@ pub mod tests { // prepare v1 database { let key = serde_json::to_vec(&SerializableDocumentKeyShareV1 { - author: "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into(), + author: H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap().into(), threshold: 777, id_numbers: vec![( - "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into(), + H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap().into(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse::().unwrap().into(), )].into_iter().collect(), secret_share: "00125d85a05e5e63e214cb60fe63f132eec8a103aa29266b7e6e6c5b7597230b".parse::().unwrap().into(), - common_point: Some("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc".into()), - encrypted_point: Some("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c".into()), + common_point: Some(H512::from_str("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc").unwrap().into()), + encrypted_point: Some(H512::from_str("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c").unwrap().into()), }).unwrap(); let mut batch = db.transaction(); batch.put(None, DB_META_KEY_VERSION, &[1]); @@ -590,7 +591,7 @@ pub mod tests { assert_eq!(777, key.threshold); assert_eq!(Some("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc".parse::().unwrap()), key.common_point.clone().map(Into::into)); assert_eq!(Some("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c".parse::().unwrap()), key.encrypted_point.clone().map(Into::into)); - assert_eq!(key.author.0, public_to_address(&"b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into())); + assert_eq!(key.author.0, public_to_address(&H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap())); assert_eq!(key.versions.len(), 1); assert_eq!(vec![( @@ -609,15 +610,15 @@ pub mod tests { // prepare v2 database { let key = serde_json::to_vec(&SerializableDocumentKeyShareV2 { - author: "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into(), + author: H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap().into(), threshold: 777, - common_point: Some("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc".into()), - encrypted_point: Some("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c".into()), - public: "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into(), + common_point: Some(H512::from_str("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc").unwrap().into()), + encrypted_point: Some(H512::from_str("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c").unwrap().into()), + public: H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap().into(), versions: vec![SerializableDocumentKeyShareVersionV2 { hash: "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse::().unwrap().into(), id_numbers: vec![( - "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".into(), + H512::from_str("b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8").unwrap().into(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse::().unwrap().into(), )].into_iter().collect(), secret_share: "00125d85a05e5e63e214cb60fe63f132eec8a103aa29266b7e6e6c5b7597230b".parse::().unwrap().into(), diff --git a/secret-store/src/listener/http_listener.rs b/secret-store/src/listener/http_listener.rs index d2c3e3d66cf..e3b0bf595df 100644 --- a/secret-store/src/listener/http_listener.rs +++ b/secret-store/src/listener/http_listener.rs @@ -428,12 +428,14 @@ fn parse_admin_request(method: &HttpMethod, path: Vec, body: &[u8]) -> R #[cfg(test)] mod tests { use std::sync::Arc; + use std::str::FromStr; use hyper::Method as HttpMethod; use ethkey::Public; use traits::KeyServer; use key_server::tests::DummyKeyServer; use types::NodeAddress; use parity_runtime::Runtime; + use ethereum_types::H256; use super::{parse_request, Request, KeyServerHttpListener}; #[test] @@ -450,39 +452,39 @@ mod tests { fn parse_request_successful() { // POST /shadow/{server_key_id}/{signature}/{threshold} => generate server key assert_eq!(parse_request(&HttpMethod::POST, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/2", Default::default()), - Request::GenerateServerKey("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::GenerateServerKey(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), 2)); // POST /shadow/{server_key_id}/{signature}/{common_point}/{encrypted_key} => store encrypted document key assert_eq!(parse_request(&HttpMethod::POST, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8/1395568277679f7f583ab7c0992da35f26cde57149ee70e524e49bdae62db3e18eb96122501e7cbb798b784395d7bb5a499edead0706638ad056d886e56cf8fb", Default::default()), - Request::StoreDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::StoreDocumentKey(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".parse().unwrap(), "1395568277679f7f583ab7c0992da35f26cde57149ee70e524e49bdae62db3e18eb96122501e7cbb798b784395d7bb5a499edead0706638ad056d886e56cf8fb".parse().unwrap())); // POST /{server_key_id}/{signature}/{threshold} => generate server && document key assert_eq!(parse_request(&HttpMethod::POST, "/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/2", Default::default()), - Request::GenerateDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::GenerateDocumentKey(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), 2)); // GET /{server_key_id}/{signature} => get document key assert_eq!(parse_request(&HttpMethod::GET, "/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), - Request::GetDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::GetDocumentKey(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap())); assert_eq!(parse_request(&HttpMethod::GET, "/%30000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), - Request::GetDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::GetDocumentKey(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap())); // GET /shadow/{server_key_id}/{signature} => get document key shadow assert_eq!(parse_request(&HttpMethod::GET, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), - Request::GetDocumentKeyShadow("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::GetDocumentKeyShadow(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap())); // GET /schnorr/{server_key_id}/{signature}/{message_hash} => schnorr-sign message with server key assert_eq!(parse_request(&HttpMethod::GET, "/schnorr/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c", Default::default()), - Request::SchnorrSignMessage("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::SchnorrSignMessage(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse().unwrap())); // GET /ecdsa/{server_key_id}/{signature}/{message_hash} => ecdsa-sign message with server key assert_eq!(parse_request(&HttpMethod::GET, "/ecdsa/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c", Default::default()), - Request::EcdsaSignMessage("0000000000000000000000000000000000000000000000000000000000000001".into(), + Request::EcdsaSignMessage(H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse().unwrap())); // POST /admin/servers_set_change/{old_set_signature}/{new_set_signature} + body diff --git a/secret-store/src/listener/service_contract.rs b/secret-store/src/listener/service_contract.rs index 795e75d2c6d..4fad7cf7e28 100644 --- a/secret-store/src/listener/service_contract.rs +++ b/secret-store/src/listener/service_contract.rs @@ -24,7 +24,7 @@ use ethcore::client::{Client, BlockChainClient, BlockId}; use ethkey::{Public, public_to_address}; use hash::keccak; use bytes::Bytes; -use ethereum_types::{H256, U256, Address}; +use ethereum_types::{H256, U256, Address, H512}; use listener::ApiMask; use listener::service_contract_listener::ServiceTask; use trusted_client::TrustedClient; @@ -466,7 +466,7 @@ impl ServerKeyGenerationService { /// Prepare publish key transaction data. pub fn prepare_pubish_tx_data(server_key_id: &ServerKeyId, server_key_public: &Public) -> Bytes { - service::functions::server_key_generated::encode_input(*server_key_id, server_key_public.to_vec()) + service::functions::server_key_generated::encode_input(*server_key_id, server_key_public.as_bytes().to_vec()) } /// Prepare error transaction data. @@ -526,7 +526,7 @@ impl ServerKeyRetrievalService { /// Prepare publish key transaction data. pub fn prepare_pubish_tx_data(server_key_id: &ServerKeyId, server_key_public: Public, threshold: U256) -> Bytes { - service::functions::server_key_retrieved::encode_input(*server_key_id, server_key_public.to_vec(), threshold) + service::functions::server_key_retrieved::encode_input(*server_key_id, server_key_public.as_bytes().to_vec(), threshold) } /// Prepare error transaction data. @@ -566,7 +566,13 @@ impl DocumentKeyStoreService { /// Parse request log entry. pub fn parse_log(origin: &Address, raw_log: RawLog) -> Result { match service::events::document_key_store_requested::parse_log(raw_log) { - Ok(l) => Ok(ServiceTask::StoreDocumentKey(origin.clone(), l.server_key_id, l.author, (*l.common_point).into(), (*l.encrypted_point).into())), + Ok(l) => Ok(ServiceTask::StoreDocumentKey( + origin.clone(), + l.server_key_id, + l.author, + H512::from_slice(&*l.common_point), + H512::from_slice(&*l.encrypted_point), + )), Err(e) => Err(format!("{}", e)), } } @@ -633,7 +639,7 @@ impl DocumentKeyShadowRetrievalService { /// Parse personal request log entry. pub fn parse_personal_request_log(origin: &Address, raw_log: RawLog) -> Result { match service::events::document_key_personal_retrieval_requested::parse_log(raw_log) { - Ok(l) => Ok(ServiceTask::RetrieveShadowDocumentKeyPersonal(origin.clone(), l.server_key_id, (*l.requester_public).into())), + Ok(l) => Ok(ServiceTask::RetrieveShadowDocumentKeyPersonal(origin.clone(), l.server_key_id, H512::from_slice(&*l.requester_public))), Err(e) => Err(e.to_string()) } } @@ -650,7 +656,7 @@ impl DocumentKeyShadowRetrievalService { /// Prepare publish common key transaction data. pub fn prepare_pubish_common_tx_data(server_key_id: &ServerKeyId, requester: &Address, common_point: Public, threshold: U256) -> Bytes { - service::functions::document_key_common_retrieved::encode_input(*server_key_id, *requester, common_point.to_vec(), threshold) + service::functions::document_key_common_retrieved::encode_input(*server_key_id, *requester, common_point.as_bytes().to_vec(), threshold) } /// Prepare publish personal key transaction data. @@ -662,7 +668,7 @@ impl DocumentKeyShadowRetrievalService { participants_mask = participants_mask | (U256::one() << participant_index); } Ok(service::functions::document_key_personal_retrieved::encode_input( - *server_key_id, *requester, participants_mask, decrypted_secret.to_vec(), shadow + *server_key_id, *requester, participants_mask, decrypted_secret.as_bytes().to_vec(), shadow )) } @@ -718,7 +724,7 @@ impl DocumentKeyShadowRetrievalService { if index > u8::max_value().into() { Err(format!("key server index is too big: {}", index)) } else { - let index: u32 = index.into(); + let index: u32 = index.low_u32(); Ok(index as u8) } } diff --git a/secret-store/src/listener/service_contract_listener.rs b/secret-store/src/listener/service_contract_listener.rs index 61dcda1766a..db4253e25a9 100644 --- a/secret-store/src/listener/service_contract_listener.rs +++ b/secret-store/src/listener/service_contract_listener.rs @@ -22,7 +22,7 @@ use parking_lot::Mutex; use ethcore::client::{ChainNotify, NewBlocks}; use ethkey::{Public, public_to_address}; use bytes::Bytes; -use ethereum_types::{H256, U256, Address}; +use ethereum_types::{H256, U256, Address, BigEndianHash as _}; use key_server_set::KeyServerSet; use key_server_cluster::{NodeId, ClusterClient, ClusterSessionsListener, ClusterSession}; use key_server_cluster::math; @@ -574,7 +574,7 @@ fn is_processed_by_this_key_server(key_server_set: &KeyServerSet, node: &NodeId, None => return false, }; - let server_key_id_value: U256 = server_key_id.into(); + let server_key_id_value: U256 = server_key_id.into_uint(); let range_interval = U256::max_value() / total_servers_count; let range_begin = (range_interval + 1) * this_server_index as u32; let range_end = range_begin.saturating_add(range_interval); @@ -597,6 +597,7 @@ mod tests { use key_server_set::tests::MapKeyServerSet; use {NodeKeyPair, PlainNodeKeyPair, ServerKeyId}; use super::{ServiceTask, ServiceContractListener, ServiceContractListenerParams, is_processed_by_this_key_server}; + use ethereum_types::Address; fn create_non_empty_key_storage(has_doc_key: bool) -> Arc { let key_storage = Arc::new(DummyKeyStorage::default()); @@ -983,7 +984,7 @@ mod tests { let key_storage = create_non_empty_key_storage(false); let listener = make_service_contract_listener(Some(contract.clone()), None, Some(key_storage), None, None); ServiceContractListener::process_service_task(&listener.data, ServiceTask::StoreDocumentKey( - Default::default(), Default::default(), 1.into(), Default::default(), Default::default())).unwrap_err(); + Default::default(), Default::default(), Address::from_low_u64_be(1), Default::default(), Default::default())).unwrap_err(); assert_eq!(*contract.document_keys_store_failures.lock(), vec![Default::default()]); } diff --git a/secret-store/src/serialization.rs b/secret-store/src/serialization.rs index 64cc5f1ce3b..0654fda08ed 100644 --- a/secret-store/src/serialization.rs +++ b/secret-store/src/serialization.rs @@ -16,7 +16,7 @@ use std::fmt; use std::ops::Deref; -use rustc_hex::{ToHex, FromHex}; +use rustc_hex::{self, FromHex}; use serde::{Serialize, Deserialize, Serializer, Deserializer}; use serde::de::{Visitor, Error as SerdeError}; use ethkey::{Public, Secret, Signature}; @@ -24,6 +24,33 @@ use ethereum_types::{H160, H256}; use bytes::Bytes; use types::Requester; +trait ToHex { + fn to_hex(&self) -> String; +} + +impl ToHex for Bytes { + fn to_hex(&self) -> String { + format!("0x{}", rustc_hex::ToHex::to_hex(&self[..])) + } +} + +impl ToHex for Signature { + fn to_hex(&self) -> String { + // TODO: verify + format!("0x{}", self) + } +} + +macro_rules! impl_to_hex { + ($name: ident) => ( + impl ToHex for $name { + fn to_hex(&self) -> String { + format!("{:#x}", self) + } + } + ); +} + macro_rules! impl_bytes_deserialize { ($name: ident, $value: expr, true) => { $value[2..].from_hex().map($name).map_err(SerdeError::custom) @@ -60,9 +87,7 @@ macro_rules! impl_bytes { impl Serialize for $name { fn serialize(&self, serializer: S) -> Result where S: Serializer { - let mut serialized = "0x".to_owned(); - serialized.push_str(self.0.to_hex().as_ref()); - serializer.serialize_str(serialized.as_ref()) + serializer.serialize_str(self.0.to_hex().as_ref()) } } @@ -101,17 +126,16 @@ pub type SerializableMessageHash = SerializableH256; /// Serializable address; pub type SerializableAddress = SerializableH160; -/// Serializable Bytes. +impl_to_hex!(H256); +impl_to_hex!(H160); +impl_to_hex!(Public); +impl_to_hex!(Secret); + impl_bytes!(SerializableBytes, Bytes, true, (Default)); -/// Serializable H256. impl_bytes!(SerializableH256, H256, false, (Default, PartialOrd, Ord)); -/// Serializable H160. impl_bytes!(SerializableH160, H160, false, (Default)); -/// Serializable H512 (aka Public). impl_bytes!(SerializablePublic, Public, false, (Default, PartialOrd, Ord)); -/// Serializable Secret. impl_bytes!(SerializableSecret, Secret, false, ()); -/// Serializable Signature. impl_bytes!(SerializableSignature, Signature, false, ()); /// Serializable shadow decryption result. From 7f40a1a8d33e28e1980d341726a6d7149dfb37d5 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 27 May 2019 16:20:44 +0200 Subject: [PATCH 58/90] [ethcore-sync] fix compilation in tests --- ethcore/light/src/net/tests/mod.rs | 10 +++++----- ethcore/src/state/mod.rs | 4 ++-- ethcore/sync/src/chain/mod.rs | 5 +++-- ethcore/sync/src/chain/supplier.rs | 15 ++++++++------- ethcore/sync/src/snapshot.rs | 6 +++--- ethcore/sync/src/tests/consensus.rs | 4 ++-- ethcore/sync/src/tests/private.rs | 4 ++-- ethcore/sync/src/tests/snapshot.rs | 4 ++-- ethcore/sync/src/transactions_stats.rs | 12 ++++++------ 9 files changed, 33 insertions(+), 31 deletions(-) diff --git a/ethcore/light/src/net/tests/mod.rs b/ethcore/light/src/net/tests/mod.rs index 95fb21adc14..3a38b1dbac8 100644 --- a/ethcore/light/src/net/tests/mod.rs +++ b/ethcore/light/src/net/tests/mod.rs @@ -472,8 +472,8 @@ fn get_state_proofs() { } let req_id = 112; - let key1: H256 = BigEndianHash::from_uint(U256::from(11223344)); - let key2: H256 = BigEndianHash::from_uint(U256::from(99988887)); + let key1: H256 = BigEndianHash::from_uint(&U256::from(11223344)); + let key2: H256 = BigEndianHash::from_uint(&U256::from(99988887)); let mut builder = Builder::default(); builder.push(Request::Account(IncompleteAccountRequest { @@ -529,8 +529,8 @@ fn get_contract_code() { } let req_id = 112; - let key1: H256 = BigEndianHash::from_uint(U256::from(11223344)); - let key2: H256 = BigEndianHash::from_uint(U256::from(99988887)); + let key1: H256 = BigEndianHash::from_uint(&U256::from(11223344)); + let key2: H256 = BigEndianHash::from_uint(&U256::from(99988887)); let request = Request::Code(IncompleteCodeRequest { block_hash: key1.into(), @@ -755,7 +755,7 @@ fn get_transaction_index() { } let req_id = 112; - let key1: H256 = BigEndianHash::from_uint(U256::from(11223344)); + let key1: H256 = BigEndianHash::from_uint(&U256::from(11223344)); let request = Request::TransactionIndex(IncompleteTransactionIndexRequest { hash: key1.into(), diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index 98ae1e1f6b7..d0d57287dce 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -2733,7 +2733,7 @@ mod tests { fn should_get_full_pod_storage_values() { use trie::{TrieFactory, TrieSpec}; - let a = 10.into(); + let a = Address::from_low_u64_be(10); let db = get_temp_state_db(); let factories = Factories { @@ -2746,7 +2746,7 @@ mod tests { pod_state.get().get(ak).unwrap().storage.get(&k).unwrap().clone() }; - let storage_address = BigEndianHash::from_uint(&U256::from(1u64)); + let storage_address: H256 = BigEndianHash::from_uint(&U256::from(1u64)); let (root, db) = { let mut state = State::new(db, U256::from(0), factories.clone()); diff --git a/ethcore/sync/src/chain/mod.rs b/ethcore/sync/src/chain/mod.rs index c3bca17d954..20d5b2cd580 100644 --- a/ethcore/sync/src/chain/mod.rs +++ b/ethcore/sync/src/chain/mod.rs @@ -365,7 +365,8 @@ pub mod random { #[cfg(test)] pub mod random { use rand::SeedableRng; - pub fn new() -> rand_xorshift::XorShiftRng { rand_xorshift::XorShiftRng::from_seed([0, 1, 2, 3]) } + const RNG_SEED: [u8; 16] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; + pub fn new() -> rand_xorshift::XorShiftRng { rand_xorshift::XorShiftRng::from_seed(RNG_SEED) } } pub type RlpResponseResult = Result, PacketDecodeError>; @@ -1398,7 +1399,7 @@ pub mod tests { let mut rlp = RlpStream::new_list(5); for _ in 0..5 { let mut hash_d_rlp = RlpStream::new_list(2); - let hash: H256 = H256::from(0u64); + let hash: H256 = H256::zero(); let diff: U256 = U256::from(1u64); hash_d_rlp.append(&hash); hash_d_rlp.append(&diff); diff --git a/ethcore/sync/src/chain/supplier.rs b/ethcore/sync/src/chain/supplier.rs index 1774fda85f8..ee20f128941 100644 --- a/ethcore/sync/src/chain/supplier.rs +++ b/ethcore/sync/src/chain/supplier.rs @@ -377,6 +377,7 @@ mod test { use super::{*, super::tests::*}; use blocks::SyncHeader; use ethcore::client::{BlockChainClient, EachBlockWith, TestBlockChainClient}; + use std::str::FromStr; #[test] fn return_block_headers() { @@ -488,9 +489,9 @@ mod test { let mut io = TestIo::new(&mut client, &ss, &queue, None); let mut node_list = RlpStream::new_list(3); - node_list.append(&H256::from("0000000000000000000000000000000000000000000000005555555555555555")); - node_list.append(&H256::from("ffffffffffffffffffffffffffffffffffffffffffffaaaaaaaaaaaaaaaaaaaa")); - node_list.append(&H256::from("aff0000000000000000000000000000000000000000000000000000000000000")); + node_list.append(&H256::from_str("0000000000000000000000000000000000000000000000005555555555555555").unwrap()); + node_list.append(&H256::from_str("ffffffffffffffffffffffffffffffffffffffffffffaaaaaaaaaaaaaaaaaaaa").unwrap()); + node_list.append(&H256::from_str("aff0000000000000000000000000000000000000000000000000000000000000").unwrap()); let node_request = node_list.out(); // it returns rlp ONLY for hashes started with "f" @@ -532,10 +533,10 @@ mod test { let mut io = TestIo::new(&mut client, &ss, &queue, None); let mut receipt_list = RlpStream::new_list(4); - receipt_list.append(&H256::from("0000000000000000000000000000000000000000000000005555555555555555")); - receipt_list.append(&H256::from("ff00000000000000000000000000000000000000000000000000000000000000")); - receipt_list.append(&H256::from("fff0000000000000000000000000000000000000000000000000000000000000")); - receipt_list.append(&H256::from("aff0000000000000000000000000000000000000000000000000000000000000")); + receipt_list.append(&H256::from_str("0000000000000000000000000000000000000000000000005555555555555555").unwrap()); + receipt_list.append(&H256::from_str("ff00000000000000000000000000000000000000000000000000000000000000").unwrap()); + receipt_list.append(&H256::from_str("fff0000000000000000000000000000000000000000000000000000000000000").unwrap()); + receipt_list.append(&H256::from_str("aff0000000000000000000000000000000000000000000000000000000000000").unwrap()); let receipts_request = receipt_list.out(); // it returns rlp ONLY for hashes started with "f" diff --git a/ethcore/sync/src/snapshot.rs b/ethcore/sync/src/snapshot.rs index 55b6f762024..e7c2c3dcef2 100644 --- a/ethcore/sync/src/snapshot.rs +++ b/ethcore/sync/src/snapshot.rs @@ -188,8 +188,8 @@ mod test { } fn test_manifest() -> (ManifestData, H256, Vec, Vec) { - let state_chunks: Vec = (0..20).map(|_| H256::random().to_vec()).collect(); - let block_chunks: Vec = (0..20).map(|_| H256::random().to_vec()).collect(); + let state_chunks: Vec = (0..20).map(|_| H256::random().as_bytes().to_vec()).collect(); + let block_chunks: Vec = (0..20).map(|_| H256::random().as_bytes().to_vec()).collect(); let manifest = ManifestData { version: 2, state_hashes: state_chunks.iter().map(|data| keccak(data)).collect(), @@ -219,7 +219,7 @@ mod test { let (manifest, mhash, state_chunks, block_chunks) = test_manifest(); snapshot.reset_to(&manifest, &mhash); assert_eq!(snapshot.done_chunks(), 0); - assert!(snapshot.validate_chunk(&H256::random().to_vec()).is_err()); + assert!(snapshot.validate_chunk(&H256::random().as_bytes().to_vec()).is_err()); let requested: Vec = (0..40).map(|_| snapshot.needed_chunk().unwrap()).collect(); assert!(snapshot.needed_chunk().is_none()); diff --git a/ethcore/sync/src/tests/consensus.rs b/ethcore/sync/src/tests/consensus.rs index df093663383..1dc6904ba8f 100644 --- a/ethcore/sync/src/tests/consensus.rs +++ b/ethcore/sync/src/tests/consensus.rs @@ -41,8 +41,8 @@ fn new_tx(secret: &Secret, nonce: U256, chain_id: u64) -> PendingTransaction { #[test] fn authority_round() { - let s0 = KeyPair::from_secret_slice(&keccak("1")).unwrap(); - let s1 = KeyPair::from_secret_slice(&keccak("0")).unwrap(); + let s0 = KeyPair::from_secret_slice(keccak("1").as_bytes()).unwrap(); + let s1 = KeyPair::from_secret_slice(keccak("0").as_bytes()).unwrap(); let chain_id = Spec::new_test_round().chain_id(); let mut net = TestNet::with_spec(2, SyncConfig::default(), Spec::new_test_round); diff --git a/ethcore/sync/src/tests/private.rs b/ethcore/sync/src/tests/private.rs index b56f0ecc218..dd421cef8aa 100644 --- a/ethcore/sync/src/tests/private.rs +++ b/ethcore/sync/src/tests/private.rs @@ -41,8 +41,8 @@ fn seal_spec() -> Spec { #[test] fn send_private_transaction() { // Setup two clients - let s0 = KeyPair::from_secret_slice(&keccak("1")).unwrap(); - let s1 = KeyPair::from_secret_slice(&keccak("0")).unwrap(); + let s0 = KeyPair::from_secret_slice(keccak("1").as_bytes()).unwrap(); + let s1 = KeyPair::from_secret_slice(keccak("0").as_bytes()).unwrap(); let signer = Arc::new(ethcore_private_tx::KeyPairSigner(vec![s0.clone(), s1.clone()])); diff --git a/ethcore/sync/src/tests/snapshot.rs b/ethcore/sync/src/tests/snapshot.rs index d6d769231c1..60459defb5a 100644 --- a/ethcore/sync/src/tests/snapshot.rs +++ b/ethcore/sync/src/tests/snapshot.rs @@ -49,8 +49,8 @@ impl TestSnapshotService { pub fn new_with_snapshot(num_chunks: usize, block_hash: H256, block_number: BlockNumber) -> TestSnapshotService { let num_state_chunks = num_chunks / 2; let num_block_chunks = num_chunks - num_state_chunks; - let state_chunks: Vec = (0..num_state_chunks).map(|_| H256::random().to_vec()).collect(); - let block_chunks: Vec = (0..num_block_chunks).map(|_| H256::random().to_vec()).collect(); + let state_chunks: Vec = (0..num_state_chunks).map(|_| H256::random().as_bytes().to_vec()).collect(); + let block_chunks: Vec = (0..num_block_chunks).map(|_| H256::random().as_bytes().to_vec()).collect(); let manifest = ManifestData { version: 2, state_hashes: state_chunks.iter().map(|data| keccak(data)).collect(), diff --git a/ethcore/sync/src/transactions_stats.rs b/ethcore/sync/src/transactions_stats.rs index 91094fa5fd2..5f4ab0ab3a2 100644 --- a/ethcore/sync/src/transactions_stats.rs +++ b/ethcore/sync/src/transactions_stats.rs @@ -91,15 +91,15 @@ impl TransactionsStats { mod tests { use std::collections::{HashMap, HashSet}; - use super::{Stats, TransactionsStats}; + use super::{Stats, TransactionsStats, NodeId, H256}; #[test] fn should_keep_track_of_propagations() { // given let mut stats = TransactionsStats::default(); - let hash = 5.into(); - let enodeid1 = 2.into(); - let enodeid2 = 5.into(); + let hash = H256::from_low_u64_be(5); + let enodeid1 = NodeId::from_low_u64_be(2); + let enodeid2 = NodeId::from_low_u64_be(5); // when stats.propagated(&hash, Some(enodeid1), 5); @@ -121,8 +121,8 @@ mod tests { fn should_remove_hash_from_tracking() { // given let mut stats = TransactionsStats::default(); - let hash = 5.into(); - let enodeid1 = 5.into(); + let hash = H256::from_low_u64_be(5); + let enodeid1 = NodeId::from_low_u64_be(5); stats.propagated(&hash, Some(enodeid1), 10); // when From 3b03980f16fd90e0c6203c04769ca92669211d35 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 27 May 2019 17:25:31 +0200 Subject: [PATCH 59/90] [parity-rpc] fix compilation in tests --- .../helpers/external_signer/signing_queue.rs | 11 ++--- rpc/src/v1/helpers/subscribers.rs | 3 +- rpc/src/v1/tests/eth.rs | 2 +- rpc/src/v1/tests/helpers/sync_provider.rs | 14 +++--- rpc/src/v1/tests/helpers/update_service.rs | 7 +-- rpc/src/v1/tests/mocked/eth.rs | 36 ++++++++------ rpc/src/v1/tests/mocked/eth_pubsub.rs | 7 +-- rpc/src/v1/tests/mocked/parity.rs | 20 ++++---- rpc/src/v1/tests/mocked/parity_accounts.rs | 5 +- rpc/src/v1/tests/mocked/parity_set.rs | 5 +- rpc/src/v1/tests/mocked/personal.rs | 2 +- rpc/src/v1/tests/mocked/signer.rs | 12 ++--- rpc/src/v1/tests/mocked/signing.rs | 8 +-- rpc/src/v1/tests/mocked/traces.rs | 9 ++-- rpc/src/v1/types/call_request.rs | 6 +-- rpc/src/v1/types/confirmations.rs | 14 +++--- rpc/src/v1/types/eth_types.rs | 14 +++--- rpc/src/v1/types/filter.rs | 4 +- rpc/src/v1/types/provenance.rs | 7 +-- rpc/src/v1/types/receipt.rs | 9 ++-- rpc/src/v1/types/secretstore.rs | 10 ++-- rpc/src/v1/types/sync.rs | 4 +- rpc/src/v1/types/trace.rs | 49 ++++++++++--------- rpc/src/v1/types/trace_filter.rs | 4 +- rpc/src/v1/types/transaction.rs | 4 +- rpc/src/v1/types/transaction_request.rs | 6 +-- 26 files changed, 143 insertions(+), 129 deletions(-) diff --git a/rpc/src/v1/helpers/external_signer/signing_queue.rs b/rpc/src/v1/helpers/external_signer/signing_queue.rs index 00a459a869a..6f3435076f7 100644 --- a/rpc/src/v1/helpers/external_signer/signing_queue.rs +++ b/rpc/src/v1/helpers/external_signer/signing_queue.rs @@ -213,7 +213,7 @@ impl SigningQueue for ConfirmationsQueue { #[cfg(test)] mod test { use std::sync::Arc; - use ethereum_types::{U256, Address}; + use ethereum_types::{U256, Address, H256}; use parking_lot::Mutex; use jsonrpc_core::futures::Future; use v1::helpers::external_signer::{SigningQueue, ConfirmationsQueue, QueueEvent}; @@ -222,9 +222,9 @@ mod test { fn request() -> ConfirmationPayload { ConfirmationPayload::SendTransaction(FilledTransactionRequest { - from: Address::from(1), + from: Address::from_low_u64_be(1), used_default_from: false, - to: Some(Address::from(2)), + to: Some(Address::from_low_u64_be(2)), gas_price: 0.into(), gas: 10_000.into(), value: 10_000_000.into(), @@ -243,11 +243,11 @@ mod test { // when let (id, future) = queue.add_request(request, Default::default()).unwrap(); let sender = queue.take(&id).unwrap(); - queue.request_confirmed(sender, Ok(ConfirmationResponse::SendTransaction(1.into()))); + queue.request_confirmed(sender, Ok(ConfirmationResponse::SendTransaction(H256::from_low_u64_be(1)))); // then let confirmation = future.wait().unwrap(); - assert_eq!(confirmation, Ok(ConfirmationResponse::SendTransaction(1.into()))); + assert_eq!(confirmation, Ok(ConfirmationResponse::SendTransaction(H256::from_low_u64_be(1)))); } #[test] @@ -289,4 +289,3 @@ mod test { assert_eq!(el.payload, request); } } - diff --git a/rpc/src/v1/helpers/subscribers.rs b/rpc/src/v1/helpers/subscribers.rs index e9bd9de0239..864b9670dd1 100644 --- a/rpc/src/v1/helpers/subscribers.rs +++ b/rpc/src/v1/helpers/subscribers.rs @@ -61,7 +61,8 @@ impl Subscribers { #[cfg(test)] pub fn new_test() -> Self { Subscribers { - rand: ::rand::SeedableRng::from_seed([0usize].as_ref()), + // TODO: how important is determinism here? + rand: EntropyRng::new(), subscriptions: HashMap::new(), } } diff --git a/rpc/src/v1/tests/eth.rs b/rpc/src/v1/tests/eth.rs index 9c2273746fb..ea9f5b7222f 100644 --- a/rpc/src/v1/tests/eth.rs +++ b/rpc/src/v1/tests/eth.rs @@ -495,7 +495,7 @@ fn verify_transaction_counts(name: String, chain: BlockChain) { #[test] fn starting_nonce_test() { let tester = EthTester::from_spec(Spec::load(&env::temp_dir(), POSITIVE_NONCE_SPEC).expect("invalid chain spec")); - let address = Address::from(10); + let address = Address::from_low_u64_be(10); let sample = tester.handler.handle_request_sync(&(r#" { diff --git a/rpc/src/v1/tests/helpers/sync_provider.rs b/rpc/src/v1/tests/helpers/sync_provider.rs index d044fd5648b..4c2ec6b88a2 100644 --- a/rpc/src/v1/tests/helpers/sync_provider.rs +++ b/rpc/src/v1/tests/helpers/sync_provider.rs @@ -17,7 +17,7 @@ //! Test implementation of SyncProvider. use std::collections::BTreeMap; -use ethereum_types::H256; +use ethereum_types::{H256, H512}; use parking_lot::RwLock; use network::client_version::ClientVersion; use futures::sync::mpsc; @@ -88,7 +88,7 @@ impl SyncProvider for TestSyncProvider { eth_info: Some(EthProtocolInfo { version: 62, difficulty: Some(40.into()), - head: 50.into(), + head: H256::from_low_u64_be(50), }), pip_info: None, }, @@ -101,7 +101,7 @@ impl SyncProvider for TestSyncProvider { eth_info: Some(EthProtocolInfo { version: 64, difficulty: None, - head: 60.into() + head: H256::from_low_u64_be(60), }), pip_info: None, } @@ -114,16 +114,16 @@ impl SyncProvider for TestSyncProvider { fn transactions_stats(&self) -> BTreeMap { map![ - 1.into() => TransactionStats { + H256::from_low_u64_be(1) => TransactionStats { first_seen: 10, propagated_to: map![ - 128.into() => 16 + H512::from_low_u64_be(128) => 16 ], }, - 5.into() => TransactionStats { + H256::from_low_u64_be(5) => TransactionStats { first_seen: 16, propagated_to: map![ - 16.into() => 1 + H512::from_low_u64_be(16) => 1 ], } ] diff --git a/rpc/src/v1/tests/helpers/update_service.rs b/rpc/src/v1/tests/helpers/update_service.rs index ccf3315c47f..91db02faeda 100644 --- a/rpc/src/v1/tests/helpers/update_service.rs +++ b/rpc/src/v1/tests/helpers/update_service.rs @@ -19,6 +19,7 @@ use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use semver::Version; use updater::{Service as UpdateService, CapState, ReleaseInfo, VersionInfo, OperationsInfo, ReleaseTrack}; +use ethereum_types::{H160, H256}; /// Test implementation of fetcher. Will always return the same file. #[derive(Default)] @@ -73,7 +74,7 @@ impl UpdateService for TestUpdater { VersionInfo { track: ReleaseTrack::Beta, version: Version{major: 1, minor: 5, patch: 0, build: vec![], pre: vec![]}, - hash: 150.into(), + hash: H160::from_low_u64_be(150), } } @@ -85,11 +86,11 @@ impl UpdateService for TestUpdater { version: VersionInfo { track: ReleaseTrack::Beta, version: Version{major: 1, minor: 5, patch: 1, build: vec![], pre: vec![]}, - hash: 151.into(), + hash: H160::from_low_u64_be(151), }, is_critical: true, fork: 15100, - binary: Some(1510.into()), + binary: Some(H256::from_low_u64_be(1510)), }, minor: None, }) diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index e19277dbc50..9c34c1fc2d7 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -22,7 +22,7 @@ use std::time::{Instant, Duration, SystemTime, UNIX_EPOCH}; use accounts::AccountProvider; use ethcore::client::{BlockChainClient, BlockId, EachBlockWith, Executed, TestBlockChainClient, TransactionId}; use ethcore::miner::{self, MinerService}; -use ethereum_types::{H160, H256, U256, Address}; +use ethereum_types::{H160, H256, U256, Address, Bloom}; use miner::external::ExternalMiner; use parity_runtime::Runtime; use parking_lot::Mutex; @@ -186,9 +186,9 @@ fn rpc_eth_chain_id() { #[test] fn rpc_eth_hashrate() { let tester = EthTester::default(); - tester.hashrates.lock().insert(H256::from(0), (Instant::now() + Duration::from_secs(2), U256::from(0xfffa))); - tester.hashrates.lock().insert(H256::from(0), (Instant::now() + Duration::from_secs(2), U256::from(0xfffb))); - tester.hashrates.lock().insert(H256::from(1), (Instant::now() + Duration::from_secs(2), U256::from(0x1))); + tester.hashrates.lock().insert(H256::from_low_u64_be(0), (Instant::now() + Duration::from_secs(2), U256::from(0xfffa))); + tester.hashrates.lock().insert(H256::from_low_u64_be(0), (Instant::now() + Duration::from_secs(2), U256::from(0xfffb))); + tester.hashrates.lock().insert(H256::from_low_u64_be(1), (Instant::now() + Duration::from_secs(2), U256::from(0x1))); let request = r#"{"jsonrpc": "2.0", "method": "eth_hashrate", "params": [], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","result":"0xfffc","id":1}"#; @@ -240,8 +240,14 @@ fn rpc_eth_logs() { #[test] fn rpc_eth_logs_error() { + fn h256_from_digit_be(d: u8) -> H256 { + let mut bytes = [0u8; 32]; + bytes[0] = d; + H256(bytes) + } + let tester = EthTester::default(); - tester.client.set_error_on_logs(Some(BlockId::Hash(H256::from([5u8].as_ref())))); + tester.client.set_error_on_logs(Some(BlockId::Hash(h256_from_digit_be(5)))); let request = r#"{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"limit":1,"blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","error":{"code":-32000,"message":"One of the blocks specified in filter (fromBlock, toBlock or blockHash) cannot be found","data":"0x0500000000000000000000000000000000000000000000000000000000000000"},"id":1}"#; assert_eq!(tester.io.handle_request_sync(request), Some(response.to_owned())); @@ -349,7 +355,7 @@ fn rpc_eth_submit_hashrate() { let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; assert_eq!(tester.io.handle_request_sync(request), Some(response.to_owned())); - assert_eq!(tester.hashrates.lock().get(&H256::from("0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c")).cloned().unwrap().1, + assert_eq!(tester.hashrates.lock().get(&H256::from_str("0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c").unwrap()).cloned().unwrap().1, U256::from(0x500_000)); } @@ -404,8 +410,8 @@ fn rpc_eth_gas_price() { fn rpc_eth_accounts() { let tester = EthTester::default(); let address = tester.accounts_provider.new_account(&"".into()).unwrap(); - tester.accounts_provider.set_address_name(1.into(), "1".into()); - tester.accounts_provider.set_address_name(10.into(), "10".into()); + tester.accounts_provider.set_address_name(Address::from_low_u64_be(1), "1".into()); + tester.accounts_provider.set_address_name(Address::from_low_u64_be(10), "10".into()); // with current policy it should return the account let request = r#"{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}"#; @@ -427,7 +433,7 @@ fn rpc_eth_block_number() { #[test] fn rpc_eth_balance() { let tester = EthTester::default(); - tester.client.set_balance(Address::from(1), U256::from(5)); + tester.client.set_balance(Address::from_low_u64_be(1), U256::from(5)); let request = r#"{ "jsonrpc": "2.0", @@ -443,7 +449,7 @@ fn rpc_eth_balance() { #[test] fn rpc_eth_balance_pending() { let tester = EthTester::default(); - tester.client.set_balance(Address::from(1), U256::from(5)); + tester.client.set_balance(Address::from_low_u64_be(1), U256::from(5)); let request = r#"{ "jsonrpc": "2.0", @@ -460,7 +466,7 @@ fn rpc_eth_balance_pending() { #[test] fn rpc_eth_storage_at() { let tester = EthTester::default(); - tester.client.set_storage(Address::from(1), H256::from(4), H256::from(7)); + tester.client.set_storage(Address::from_low_u64_be(1), H256::from_low_u64_be(4), H256::from_low_u64_be(7)); let request = r#"{ "jsonrpc": "2.0", @@ -491,7 +497,7 @@ fn rpc_eth_transaction_count_next_nonce() { let tester = EthTester::new_with_options(EthClientOptions::with(|options| { options.pending_nonce_from_queue = true; })); - tester.miner.increment_nonce(&1.into()); + tester.miner.increment_nonce(&H160::from_low_u64_be(1)); let request1 = r#"{ "jsonrpc": "2.0", @@ -604,7 +610,7 @@ fn rpc_eth_uncle_count_by_block_number() { #[test] fn rpc_eth_code() { let tester = EthTester::default(); - tester.client.set_code(Address::from(1), vec![0xff, 0x21]); + tester.client.set_code(Address::from_low_u64_be(1), vec![0xff, 0x21]); let request = r#"{ "jsonrpc": "2.0", @@ -873,8 +879,8 @@ fn rpc_eth_transaction_receipt() { transaction_log_index: 0, log_index: 1, }], - log_bloom: 0.into(), - outcome: TransactionOutcome::StateRoot(0.into()), + log_bloom: Bloom::zero(), + outcome: TransactionOutcome::StateRoot(H256::zero()), }; let hash = H256::from_str("b903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238").unwrap(); diff --git a/rpc/src/v1/tests/mocked/eth_pubsub.rs b/rpc/src/v1/tests/mocked/eth_pubsub.rs index 21f413530ea..f2b8c8fe138 100644 --- a/rpc/src/v1/tests/mocked/eth_pubsub.rs +++ b/rpc/src/v1/tests/mocked/eth_pubsub.rs @@ -25,6 +25,7 @@ use std::time::Duration; use v1::{EthPubSub, EthPubSubClient, Metadata}; use ethcore::client::{TestBlockChainClient, EachBlockWith, ChainNotify, NewBlocks, ChainRoute, ChainRouteType}; use parity_runtime::Runtime; +use ethereum_types::{Address, H256}; const DURATION_ZERO: Duration = Duration::from_millis(0); @@ -98,8 +99,8 @@ fn should_subscribe_to_logs() { client.set_logs(vec![ LocalizedLogEntry { entry: LogEntry { - address: 5.into(), - topics: vec![1.into(), 2.into(), 0.into(), 0.into()], + address: Address::from_low_u64_be(5), + topics: vec![H256::from_low_u64_be(1), H256::from_low_u64_be(2), H256::from_low_u64_be(0), H256::from_low_u64_be(0)], data: vec![], }, block_hash: h1, @@ -180,7 +181,7 @@ fn should_subscribe_to_pending_transactions() { assert_eq!(io.handle_request_sync(request, metadata.clone()), Some(response.to_owned())); // Send new transactions - handler.notify_new_transactions(&[5.into(), 7.into()]); + handler.notify_new_transactions(&[H256::from_low_u64_be(5), H256::from_low_u64_be(7)]); let (res, receiver) = receiver.into_future().wait().unwrap(); let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":"0x0000000000000000000000000000000000000000000000000000000000000005","subscription":"0x416d77337e24399d"}}"#; diff --git a/rpc/src/v1/tests/mocked/parity.rs b/rpc/src/v1/tests/mocked/parity.rs index 6608589f557..78599d545a4 100644 --- a/rpc/src/v1/tests/mocked/parity.rs +++ b/rpc/src/v1/tests/mocked/parity.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use ethcore::client::{TestBlockChainClient, Executed, TransactionId}; use ethcore_logger::RotatingLogger; -use ethereum_types::{Address, U256, H256}; +use ethereum_types::{Address, U256, H256, BigEndianHash, Bloom}; use ethstore::ethkey::{Generator, Random}; use miner::pool::local_transactions::Status as LocalTransactionStatus; use sync::ManageNetwork; @@ -396,10 +396,10 @@ fn rpc_parity_local_transactions() { action: ::types::transaction::Action::Create, data: vec![1, 2, 3], nonce: 0.into(), - }.fake_sign(3.into()); + }.fake_sign(Address::from_low_u64_be(3)); let tx = Arc::new(::miner::pool::VerifiedTransaction::from_pending_block_transaction(tx)); - deps.miner.local_transactions.lock().insert(10.into(), LocalTransactionStatus::Pending(tx.clone())); - deps.miner.local_transactions.lock().insert(15.into(), LocalTransactionStatus::Pending(tx.clone())); + deps.miner.local_transactions.lock().insert(H256::from_low_u64_be(10), LocalTransactionStatus::Pending(tx.clone())); + deps.miner.local_transactions.lock().insert(H256::from_low_u64_be(15), LocalTransactionStatus::Pending(tx.clone())); let request = r#"{"jsonrpc": "2.0", "method": "parity_localTransactions", "params":[], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","result":{"0x000000000000000000000000000000000000000000000000000000000000000a":{"status":"pending"},"0x000000000000000000000000000000000000000000000000000000000000000f":{"status":"pending"}},"id":1}"#; @@ -413,7 +413,7 @@ fn rpc_parity_chain_status() { let io = deps.default_client(); *deps.client.ancient_block.write() = Some((H256::default(), 5)); - *deps.client.first_block.write() = Some((H256::from(U256::from(1234)), 3333)); + *deps.client.first_block.write() = Some((BigEndianHash::from_uint(&U256::from(1234)), 3333)); let request = r#"{"jsonrpc": "2.0", "method": "parity_chainStatus", "params":[], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","result":{"blockGap":["0x6","0xd05"]},"id":1}"#; @@ -484,19 +484,19 @@ fn rpc_parity_call() { fn rpc_parity_block_receipts() { let deps = Dependencies::new(); deps.client.receipts.write() - .insert(TransactionId::Hash(1.into()), LocalizedReceipt { - transaction_hash: 1.into(), + .insert(TransactionId::Hash(H256::from_low_u64_be(1)), LocalizedReceipt { + transaction_hash: H256::from_low_u64_be(1), transaction_index: 0, - block_hash: 3.into(), + block_hash: H256::from_low_u64_be(3), block_number: 0, cumulative_gas_used: 21_000.into(), gas_used: 21_000.into(), contract_address: None, logs: vec![], - log_bloom: 1.into(), + log_bloom: Bloom::from_low_u64_be(1), outcome: TransactionOutcome::Unknown, to: None, - from: 9.into(), + from: Address::from_low_u64_be(9), }); let io = deps.default_client(); diff --git a/rpc/src/v1/tests/mocked/parity_accounts.rs b/rpc/src/v1/tests/mocked/parity_accounts.rs index 5b2e0762b18..76b8b80887c 100644 --- a/rpc/src/v1/tests/mocked/parity_accounts.rs +++ b/rpc/src/v1/tests/mocked/parity_accounts.rs @@ -15,6 +15,7 @@ // along with Parity Ethereum. If not, see . use std::sync::Arc; +use std::str::FromStr; use accounts::{AccountProvider, AccountProviderSettings}; use ethereum_types::Address; @@ -74,7 +75,7 @@ fn rpc_parity_accounts_info() { assert_eq!(accounts.len(), 1); let address = accounts[0]; - tester.accounts.set_address_name(1.into(), "XX".into()); + tester.accounts.set_address_name(Address::from_low_u64_be(1), "XX".into()); tester.accounts.set_account_name(address.clone(), "Test".into()).unwrap(); tester.accounts.set_account_meta(address.clone(), "{foo: 69}".into()).unwrap(); @@ -456,7 +457,7 @@ fn should_import_wallet() { assert_eq!(res, response); - let account_meta = tester.accounts.account_meta("0x00bac56a8a27232baa044c03f43bf3648c961735".into()).unwrap(); + let account_meta = tester.accounts.account_meta(Address::from_str("0x00bac56a8a27232baa044c03f43bf3648c961735").unwrap()).unwrap(); let account_uuid: String = account_meta.uuid.unwrap().into(); // the RPC should import the account with a new id diff --git a/rpc/src/v1/tests/mocked/parity_set.rs b/rpc/src/v1/tests/mocked/parity_set.rs index 25c13fb1cb6..683f681e444 100644 --- a/rpc/src/v1/tests/mocked/parity_set.rs +++ b/rpc/src/v1/tests/mocked/parity_set.rs @@ -230,11 +230,11 @@ fn rpc_parity_remove_transaction() { nonce: 1.into(), gas_price: 0x9184e72a000u64.into(), gas: 0x76c0.into(), - action: Action::Call(5.into()), + action: Action::Call(Address::from_low_u64_be(5)), value: 0x9184e72au64.into(), data: vec![] }; - let signed = tx.fake_sign(2.into()); + let signed = tx.fake_sign(Address::from_low_u64_be(2)); let hash = signed.hash(); let request = r#"{"jsonrpc": "2.0", "method": "parity_removeTransaction", "params":[""#.to_owned() + &format!("0x{:x}", hash) + r#""], "id": 1}"#; @@ -268,4 +268,3 @@ fn rpc_parity_set_engine_signer() { let signature = miner.signer.read().as_ref().unwrap().sign(::hash::keccak("x")).unwrap().to_vec(); assert_eq!(&format!("{}", signature.pretty()), "6f46069ded2154af6e806706e4f7f6fd310ac45f3c6dccb85f11c0059ee20a09245df0a0008bb84a10882b1298284bc93058e7bc5938ea728e77620061687a6401"); } - diff --git a/rpc/src/v1/tests/mocked/personal.rs b/rpc/src/v1/tests/mocked/personal.rs index a2d6b87ce26..5a339bc18f0 100644 --- a/rpc/src/v1/tests/mocked/personal.rs +++ b/rpc/src/v1/tests/mocked/personal.rs @@ -363,7 +363,7 @@ fn sign_eip191_with_validator() { }"#; let with_validator = to_value(PresignedTransaction { validator: address.into(), - data: keccak("hello world").to_vec().into() + data: keccak("hello world").as_bytes().to_vec().into() }).unwrap(); let result = eip191::hash_message(EIP191Version::PresignedTransaction, with_validator).unwrap(); let result = tester.accounts.sign(address, Some("password123".into()), result).unwrap().into_electrum(); diff --git a/rpc/src/v1/tests/mocked/signer.rs b/rpc/src/v1/tests/mocked/signer.rs index e22c5b8d249..78b875d4113 100644 --- a/rpc/src/v1/tests/mocked/signer.rs +++ b/rpc/src/v1/tests/mocked/signer.rs @@ -84,7 +84,7 @@ fn should_return_list_of_items_to_confirm() { // given let tester = signer_tester(); let _send_future = tester.signer.add_request(ConfirmationPayload::SendTransaction(FilledTransactionRequest { - from: Address::from(1), + from: Address::from_low_u64_be(1), used_default_from: false, to: Some(Address::from_str("d46e8dd67c5d32be8058bb8eb970870f07244567").unwrap()), gas_price: U256::from(10_000), @@ -94,7 +94,7 @@ fn should_return_list_of_items_to_confirm() { nonce: None, condition: None, }), Origin::Unknown).unwrap(); - let _sign_future = tester.signer.add_request(ConfirmationPayload::EthSignMessage(1.into(), vec![5].into()), Origin::Unknown).unwrap(); + let _sign_future = tester.signer.add_request(ConfirmationPayload::EthSignMessage(Address::from_low_u64_be(1), vec![5].into()), Origin::Unknown).unwrap(); // when let request = r#"{"jsonrpc":"2.0","method":"signer_requestsToConfirm","params":[],"id":1}"#; @@ -114,7 +114,7 @@ fn should_reject_transaction_from_queue_without_dispatching() { // given let tester = signer_tester(); let _confirmation_future = tester.signer.add_request(ConfirmationPayload::SendTransaction(FilledTransactionRequest { - from: Address::from(1), + from: Address::from_low_u64_be(1), used_default_from: false, to: Some(Address::from_str("d46e8dd67c5d32be8058bb8eb970870f07244567").unwrap()), gas_price: U256::from(10_000), @@ -141,7 +141,7 @@ fn should_not_remove_transaction_if_password_is_invalid() { // given let tester = signer_tester(); let _confirmation_future = tester.signer.add_request(ConfirmationPayload::SendTransaction(FilledTransactionRequest { - from: Address::from(1), + from: Address::from_low_u64_be(1), used_default_from: false, to: Some(Address::from_str("d46e8dd67c5d32be8058bb8eb970870f07244567").unwrap()), gas_price: U256::from(10_000), @@ -166,7 +166,7 @@ fn should_not_remove_transaction_if_password_is_invalid() { fn should_not_remove_sign_if_password_is_invalid() { // given let tester = signer_tester(); - let _confirmation_future = tester.signer.add_request(ConfirmationPayload::EthSignMessage(0.into(), vec![5].into()), Origin::Unknown).unwrap(); + let _confirmation_future = tester.signer.add_request(ConfirmationPayload::EthSignMessage(Address::zero(), vec![5].into()), Origin::Unknown).unwrap(); assert_eq!(tester.signer.requests().len(), 1); // when @@ -231,7 +231,7 @@ fn should_alter_the_sender_and_nonce() { let tester = signer_tester(); let recipient = Address::from_str("d46e8dd67c5d32be8058bb8eb970870f07244567").unwrap(); let _confirmation_future = tester.signer.add_request(ConfirmationPayload::SendTransaction(FilledTransactionRequest { - from: 0.into(), + from: Address::zero(), used_default_from: false, to: Some(recipient), gas_price: U256::from(10_000), diff --git a/rpc/src/v1/tests/mocked/signing.rs b/rpc/src/v1/tests/mocked/signing.rs index 39385d19bd8..febf002d881 100644 --- a/rpc/src/v1/tests/mocked/signing.rs +++ b/rpc/src/v1/tests/mocked/signing.rs @@ -33,7 +33,7 @@ use v1::tests::mocked::parity; use accounts::AccountProvider; use bytes::ToPretty; -use ethereum_types::{U256, Address}; +use ethereum_types::{U256, Address, Signature, H256}; use ethcore::client::TestBlockChainClient; use ethkey::Secret; use ethstore::ethkey::{Generator, Random}; @@ -138,7 +138,7 @@ fn should_add_sign_to_queue() { if signer.requests().len() == 1 { // respond let sender = signer.take(&1.into()).unwrap(); - signer.request_confirmed(sender, Ok(ConfirmationResponse::Signature(0.into()))); + signer.request_confirmed(sender, Ok(ConfirmationResponse::Signature(Signature::zero()))); break } ::std::thread::sleep(Duration::from_millis(100)) @@ -217,7 +217,7 @@ fn should_check_status_of_request_when_its_resolved() { }"#; tester.io.handle_request_sync(&request).expect("Sent"); let sender = tester.signer.take(&1.into()).unwrap(); - tester.signer.request_confirmed(sender, Ok(ConfirmationResponse::Signature(1.into()))); + tester.signer.request_confirmed(sender, Ok(ConfirmationResponse::Signature(Signature::from_low_u64_be(1)))); // This is not ideal, but we need to give futures some time to be executed, and they need to run in a separate thread thread::sleep(Duration::from_millis(20)); @@ -289,7 +289,7 @@ fn should_add_transaction_to_queue() { if signer.requests().len() == 1 { // respond let sender = signer.take(&1.into()).unwrap(); - signer.request_confirmed(sender, Ok(ConfirmationResponse::SendTransaction(0.into()))); + signer.request_confirmed(sender, Ok(ConfirmationResponse::SendTransaction(H256::zero()))); break } ::std::thread::sleep(Duration::from_millis(100)) diff --git a/rpc/src/v1/tests/mocked/traces.rs b/rpc/src/v1/tests/mocked/traces.rs index 89cf198aa1d..8f0f0eaa0c6 100644 --- a/rpc/src/v1/tests/mocked/traces.rs +++ b/rpc/src/v1/tests/mocked/traces.rs @@ -20,6 +20,7 @@ use ethcore::executed::{Executed, CallError}; use ethcore::trace::trace::{Action, Res, Call}; use ethcore::trace::LocalizedTrace; use ethcore::client::TestBlockChainClient; +use ethereum_types::{Address, H256}; use vm::CallType; @@ -37,8 +38,8 @@ fn io() -> Tester { let client = Arc::new(TestBlockChainClient::new()); *client.traces.write() = Some(vec![LocalizedTrace { action: Action::Call(Call { - from: 0xf.into(), - to: 0x10.into(), + from: Address::from_low_u64_be(0xf), + to: Address::from_low_u64_be(0x10), value: 0x1.into(), gas: 0x100.into(), input: vec![1, 2, 3], @@ -48,9 +49,9 @@ fn io() -> Tester { subtraces: 0, trace_address: vec![0], transaction_number: Some(0), - transaction_hash: Some(5.into()), + transaction_hash: Some(H256::from_low_u64_be(5)), block_number: 10, - block_hash: 10.into(), + block_hash: H256::from_low_u64_be(10), }]); *client.execution_result.write() = Some(Ok(Executed { exception: None, diff --git a/rpc/src/v1/types/call_request.rs b/rpc/src/v1/types/call_request.rs index d75e4b1a2d7..14a94de9b61 100644 --- a/rpc/src/v1/types/call_request.rs +++ b/rpc/src/v1/types/call_request.rs @@ -75,8 +75,8 @@ mod tests { let deserialized: CallRequest = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, CallRequest { - from: Some(H160::from(1)), - to: Some(H160::from(2)), + from: Some(H160::from_low_u64_be(1)), + to: Some(H160::from_low_u64_be(2)), gas_price: Some(U256::from(1)), gas: Some(U256::from(2)), value: Some(U256::from(3)), @@ -114,7 +114,7 @@ mod tests { let deserialized: CallRequest = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, CallRequest { - from: Some(H160::from(1)), + from: Some(H160::from_low_u64_be(1)), to: None, gas_price: None, gas: None, diff --git a/rpc/src/v1/types/confirmations.rs b/rpc/src/v1/types/confirmations.rs index dedd0ba2539..0c3418add2e 100644 --- a/rpc/src/v1/types/confirmations.rs +++ b/rpc/src/v1/types/confirmations.rs @@ -282,7 +282,7 @@ impl Serialize for Either where #[cfg(test)] mod tests { use std::str::FromStr; - use ethereum_types::{H256, U256}; + use ethereum_types::{H256, U256, Address}; use serde_json; use v1::types::TransactionCondition; use v1::helpers; @@ -293,7 +293,7 @@ mod tests { // given let request = helpers::ConfirmationRequest { id: 15.into(), - payload: helpers::ConfirmationPayload::EthSignMessage(1.into(), vec![5].into()), + payload: helpers::ConfirmationPayload::EthSignMessage(Address::from_low_u64_be(1), vec![5].into()), origin: Origin::Rpc("test service".into()), }; @@ -311,7 +311,7 @@ mod tests { let request = helpers::ConfirmationRequest { id: 15.into(), payload: helpers::ConfirmationPayload::SendTransaction(helpers::FilledTransactionRequest { - from: 0.into(), + from: Address::zero(), used_default_from: false, to: None, gas: 15_000.into(), @@ -322,7 +322,7 @@ mod tests { condition: None, }), origin: Origin::Signer { - session: 5.into(), + session: H256::from_low_u64_be(5), } }; @@ -340,7 +340,7 @@ mod tests { let request = helpers::ConfirmationRequest { id: 15.into(), payload: helpers::ConfirmationPayload::SignTransaction(helpers::FilledTransactionRequest { - from: 0.into(), + from: Address::zero(), used_default_from: false, to: None, gas: 15_000.into(), @@ -367,7 +367,7 @@ mod tests { let request = helpers::ConfirmationRequest { id: 15.into(), payload: helpers::ConfirmationPayload::Decrypt( - 10.into(), vec![1, 2, 3].into(), + Address::from_low_u64_be(10), vec![1, 2, 3].into(), ), origin: Default::default(), }; @@ -398,7 +398,7 @@ mod tests { // then assert_eq!(res1, TransactionModification { - sender: Some(10.into()), + sender: Some(Address::from_low_u64_be(10)), gas_price: Some(U256::from_str("0ba43b7400").unwrap()), gas: None, condition: Some(Some(TransactionCondition::Number(0x42))), diff --git a/rpc/src/v1/types/eth_types.rs b/rpc/src/v1/types/eth_types.rs index 606e7592489..baa56fc1e45 100644 --- a/rpc/src/v1/types/eth_types.rs +++ b/rpc/src/v1/types/eth_types.rs @@ -18,10 +18,10 @@ fn should_serialize_u256() { #[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(); + let serialized1 = serde_json::to_string(&H256::from_low_u64_be(0)).unwrap(); + let serialized2 = serde_json::to_string(&H256::from_low_u64_be(1)).unwrap(); + let serialized3 = serde_json::to_string(&H256::from_low_u64_be(16)).unwrap(); + let serialized4 = serde_json::to_string(&H256::from_low_u64_be(256)).unwrap(); assert_eq!(serialized1, r#""0x0000000000000000000000000000000000000000000000000000000000000000""#); assert_eq!(serialized2, r#""0x0000000000000000000000000000000000000000000000000000000000000001""#); @@ -78,7 +78,7 @@ fn should_deserialize_h256() { 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()); + assert_eq!(deserialized1, H256::from_low_u64_be(0)); + assert_eq!(deserialized2, H256::from_low_u64_be(1)); + assert_eq!(deserialized3, H256::from_low_u64_be(256)); } diff --git a/rpc/src/v1/types/filter.rs b/rpc/src/v1/types/filter.rs index ec9f541797c..bd1edd270f5 100644 --- a/rpc/src/v1/types/filter.rs +++ b/rpc/src/v1/types/filter.rs @@ -188,7 +188,7 @@ mod tests { address: Some(VariadicValue::Multiple(vec![])), topics: Some(vec![ VariadicValue::Null, - VariadicValue::Single("000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b".into()), + VariadicValue::Single(H256::from_str("000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap()), VariadicValue::Null, ]), limit: None, @@ -201,7 +201,7 @@ mod tests { address: Some(vec![]), topics: vec![ None, - Some(vec!["000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b".into()]), + Some(vec![H256::from_str("000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap()]), None, None, ], diff --git a/rpc/src/v1/types/provenance.rs b/rpc/src/v1/types/provenance.rs index dcdd2408fe8..41a11506059 100644 --- a/rpc/src/v1/types/provenance.rs +++ b/rpc/src/v1/types/provenance.rs @@ -67,18 +67,19 @@ impl fmt::Display for Origin { mod tests { use serde_json; use super::Origin; + use ethereum_types::H256; #[test] fn should_serialize_origin() { // given let o1 = Origin::Rpc("test service".into()); - let o3 = Origin::Ipc(5.into()); + let o3 = Origin::Ipc(H256::from_low_u64_be(5)); let o4 = Origin::Signer { - session: 10.into(), + session: H256::from_low_u64_be(10), }; let o5 = Origin::Unknown; let o6 = Origin::Ws { - session: 5.into(), + session: H256::from_low_u64_be(5), }; // when diff --git a/rpc/src/v1/types/receipt.rs b/rpc/src/v1/types/receipt.rs index f492ca98c52..9e5b5e3a686 100644 --- a/rpc/src/v1/types/receipt.rs +++ b/rpc/src/v1/types/receipt.rs @@ -132,6 +132,7 @@ impl From for Receipt { mod tests { use serde_json; use v1::types::{Log, Receipt}; + use ethereum_types::{H256, Bloom}; #[test] fn receipt_serialization() { @@ -140,7 +141,7 @@ mod tests { let receipt = Receipt { from: None, to: None, - transaction_hash: Some(0.into()), + transaction_hash: Some(H256::zero()), transaction_index: Some(0.into()), block_hash: Some("ed76641c68a1c641aee09a94b3b471f4dc0316efe5ac19cf488e2674cf8d05b5".parse().unwrap()), block_number: Some(0x4510c.into()), @@ -156,15 +157,15 @@ mod tests { data: vec![].into(), block_hash: Some("ed76641c68a1c641aee09a94b3b471f4dc0316efe5ac19cf488e2674cf8d05b5".parse().unwrap()), block_number: Some(0x4510c.into()), - transaction_hash: Some(0.into()), + transaction_hash: Some(H256::zero()), transaction_index: Some(0.into()), transaction_log_index: None, log_index: Some(1.into()), log_type: "mined".into(), removed: false, }], - logs_bloom: 15.into(), - state_root: Some(10.into()), + logs_bloom: Bloom::from_low_u64_be(15), + state_root: Some(H256::from_low_u64_be(10)), status_code: Some(1u64.into()), }; diff --git a/rpc/src/v1/types/secretstore.rs b/rpc/src/v1/types/secretstore.rs index ef76ec5b464..5e94328b94a 100644 --- a/rpc/src/v1/types/secretstore.rs +++ b/rpc/src/v1/types/secretstore.rs @@ -32,13 +32,13 @@ pub struct EncryptedDocumentKey { #[cfg(test)] mod tests { use serde_json; - use super::EncryptedDocumentKey; + use super::{EncryptedDocumentKey, H512}; #[test] fn test_serialize_encrypted_document_key() { let initial = EncryptedDocumentKey { - common_point: 1.into(), - encrypted_point: 2.into(), + common_point: H512::from_low_u64_be(1), + encrypted_point: H512::from_low_u64_be(2), encrypted_key: vec![3].into(), }; @@ -46,8 +46,8 @@ mod tests { assert_eq!(serialized, r#"{"common_point":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001","encrypted_point":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002","encrypted_key":"0x03"}"#); let deserialized: EncryptedDocumentKey = serde_json::from_str(&serialized).unwrap(); - assert_eq!(deserialized.common_point, 1.into()); - assert_eq!(deserialized.encrypted_point, 2.into()); + assert_eq!(deserialized.common_point, H512::from_low_u64_be(1)); + assert_eq!(deserialized.encrypted_point, H512::from_low_u64_be(2)); assert_eq!(deserialized.encrypted_key, vec![3].into()); } } diff --git a/rpc/src/v1/types/sync.rs b/rpc/src/v1/types/sync.rs index 901611fea2b..812eaa1a8c7 100644 --- a/rpc/src/v1/types/sync.rs +++ b/rpc/src/v1/types/sync.rs @@ -197,7 +197,7 @@ pub struct ChainStatus { mod tests { use serde_json; use std::collections::BTreeMap; - use super::{SyncInfo, SyncStatus, Peers, TransactionStats, ChainStatus}; + use super::{SyncInfo, SyncStatus, Peers, TransactionStats, ChainStatus, H512}; #[test] fn test_serialize_sync_info() { @@ -241,7 +241,7 @@ mod tests { let stats = TransactionStats { first_seen: 100, propagated_to: map![ - 10.into() => 50 + H512::from_low_u64_be(10) => 50 ], }; diff --git a/rpc/src/v1/types/trace.rs b/rpc/src/v1/types/trace.rs index 58a5ee59622..b8fc2c001b3 100644 --- a/rpc/src/v1/types/trace.rs +++ b/rpc/src/v1/types/trace.rs @@ -657,6 +657,7 @@ mod tests { use std::collections::BTreeMap; use v1::types::Bytes; use ethcore::trace::TraceError; + use ethereum_types::Address; use super::*; #[test] @@ -675,8 +676,8 @@ mod tests { fn test_trace_call_serialize() { let t = LocalizedTrace { action: Action::Call(Call { - from: 4.into(), - to: 5.into(), + from: Address::from_low_u64_be(4), + to: Address::from_low_u64_be(5), value: 6.into(), gas: 7.into(), input: Bytes::new(vec![0x12, 0x34]), @@ -689,9 +690,9 @@ mod tests { trace_address: vec![10], subtraces: 1, transaction_position: Some(11), - transaction_hash: Some(12.into()), + transaction_hash: Some(H256::from_low_u64_be(12)), block_number: 13, - block_hash: 14.into(), + block_hash: H256::from_low_u64_be(14), }; let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"{"type":"call","action":{"from":"0x0000000000000000000000000000000000000004","to":"0x0000000000000000000000000000000000000005","value":"0x6","gas":"0x7","input":"0x1234","callType":"call"},"result":{"gasUsed":"0x8","output":"0x5678"},"traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#); @@ -701,8 +702,8 @@ mod tests { fn test_trace_failed_call_serialize() { let t = LocalizedTrace { action: Action::Call(Call { - from: 4.into(), - to: 5.into(), + from: Address::from_low_u64_be(4), + to: Address::from_low_u64_be(5), value: 6.into(), gas: 7.into(), input: Bytes::new(vec![0x12, 0x34]), @@ -712,9 +713,9 @@ mod tests { trace_address: vec![10], subtraces: 1, transaction_position: Some(11), - transaction_hash: Some(12.into()), + transaction_hash: Some(H256::from_low_u64_be(12)), block_number: 13, - block_hash: 14.into(), + block_hash: H256::from_low_u64_be(14), }; let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"{"type":"call","action":{"from":"0x0000000000000000000000000000000000000004","to":"0x0000000000000000000000000000000000000005","value":"0x6","gas":"0x7","input":"0x1234","callType":"call"},"error":"Out of gas","traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#); @@ -724,7 +725,7 @@ mod tests { fn test_trace_create_serialize() { let t = LocalizedTrace { action: Action::Create(Create { - from: 4.into(), + from: Address::from_low_u64_be(4), value: 6.into(), gas: 7.into(), init: Bytes::new(vec![0x12, 0x34]), @@ -732,14 +733,14 @@ mod tests { result: Res::Create(CreateResult { gas_used: 8.into(), code: vec![0x56, 0x78].into(), - address: 0xff.into(), + address: Address::from_low_u64_be(0xff), }), trace_address: vec![10], subtraces: 1, transaction_position: Some(11), - transaction_hash: Some(12.into()), + transaction_hash: Some(H256::from_low_u64_be(12)), block_number: 13, - block_hash: 14.into(), + block_hash: H256::from_low_u64_be(14), }; let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"{"type":"create","action":{"from":"0x0000000000000000000000000000000000000004","value":"0x6","gas":"0x7","init":"0x1234"},"result":{"gasUsed":"0x8","code":"0x5678","address":"0x00000000000000000000000000000000000000ff"},"traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#); @@ -749,7 +750,7 @@ mod tests { fn test_trace_failed_create_serialize() { let t = LocalizedTrace { action: Action::Create(Create { - from: 4.into(), + from: Address::from_low_u64_be(4), value: 6.into(), gas: 7.into(), init: Bytes::new(vec![0x12, 0x34]), @@ -758,9 +759,9 @@ mod tests { trace_address: vec![10], subtraces: 1, transaction_position: Some(11), - transaction_hash: Some(12.into()), + transaction_hash: Some(H256::from_low_u64_be(12)), block_number: 13, - block_hash: 14.into(), + block_hash: H256::from_low_u64_be(14), }; let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"{"type":"create","action":{"from":"0x0000000000000000000000000000000000000004","value":"0x6","gas":"0x7","init":"0x1234"},"error":"Out of gas","traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#); @@ -770,17 +771,17 @@ mod tests { fn test_trace_suicide_serialize() { let t = LocalizedTrace { action: Action::Suicide(Suicide { - address: 4.into(), - refund_address: 6.into(), + address: Address::from_low_u64_be(4), + refund_address: Address::from_low_u64_be(6), balance: 7.into(), }), result: Res::None, trace_address: vec![10], subtraces: 1, transaction_position: Some(11), - transaction_hash: Some(12.into()), + transaction_hash: Some(H256::from_low_u64_be(12)), block_number: 13, - block_hash: 14.into(), + block_hash: H256::from_low_u64_be(14), }; let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"{"type":"suicide","action":{"address":"0x0000000000000000000000000000000000000004","refundAddress":"0x0000000000000000000000000000000000000006","balance":"0x7"},"result":null,"traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#); @@ -790,7 +791,7 @@ mod tests { fn test_trace_reward_serialize() { let t = LocalizedTrace { action: Action::Reward(Reward { - author: 4.into(), + author: Address::from_low_u64_be(4), value: 6.into(), reward_type: RewardType::Block, }), @@ -800,7 +801,7 @@ mod tests { transaction_position: None, transaction_hash: None, block_number: 13, - block_hash: 14.into(), + block_hash: H256::from_low_u64_be(14), }; let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"{"type":"reward","action":{"author":"0x0000000000000000000000000000000000000004","value":"0x6","rewardType":"block"},"result":null,"traceAddress":[10],"subtraces":1,"transactionPosition":null,"transactionHash":null,"blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#); @@ -852,15 +853,15 @@ mod tests { #[test] fn test_statediff_serialize() { let t = StateDiff(map![ - 42.into() => AccountDiff { + Address::from_low_u64_be(42) => AccountDiff { balance: Diff::Same, nonce: Diff::Born(1.into()), code: Diff::Same, storage: map![ - 42.into() => Diff::Same + H256::from_low_u64_be(42) => Diff::Same ] }, - 69.into() => AccountDiff { + Address::from_low_u64_be(69) => AccountDiff { balance: Diff::Same, nonce: Diff::Changed(ChangedType { from: 1.into(), to: 0.into() }), code: Diff::Died(vec![96].into()), diff --git a/rpc/src/v1/types/trace_filter.rs b/rpc/src/v1/types/trace_filter.rs index a455c3d1cc2..60c7701953d 100644 --- a/rpc/src/v1/types/trace_filter.rs +++ b/rpc/src/v1/types/trace_filter.rs @@ -97,8 +97,8 @@ mod tests { assert_eq!(deserialized, TraceFilter { from_block: Some(BlockNumber::Latest), to_block: Some(BlockNumber::Latest), - from_address: Some(vec![Address::from(3).into()]), - to_address: Some(vec![Address::from(5).into()]), + from_address: Some(vec![Address::from_low_u64_be(3).into()]), + to_address: Some(vec![Address::from_low_u64_be(5).into()]), after: 50.into(), count: 100.into(), }); diff --git a/rpc/src/v1/types/transaction.rs b/rpc/src/v1/types/transaction.rs index 931e0386696..9d75aca3cb7 100644 --- a/rpc/src/v1/types/transaction.rs +++ b/rpc/src/v1/types/transaction.rs @@ -286,6 +286,8 @@ mod tests { #[test] fn test_local_transaction_status_serialize() { + use ethereum_types::H256; + let tx_ser = serde_json::to_string(&Transaction::default()).unwrap(); let status1 = LocalTransactionStatus::Pending; let status2 = LocalTransactionStatus::Future; @@ -293,7 +295,7 @@ mod tests { let status4 = LocalTransactionStatus::Dropped(Transaction::default()); let status5 = LocalTransactionStatus::Invalid(Transaction::default()); let status6 = LocalTransactionStatus::Rejected(Transaction::default(), "Just because".into()); - let status7 = LocalTransactionStatus::Replaced(Transaction::default(), 5.into(), 10.into()); + let status7 = LocalTransactionStatus::Replaced(Transaction::default(), 5.into(), H256::from_low_u64_be(10)); assert_eq!( serde_json::to_string(&status1).unwrap(), diff --git a/rpc/src/v1/types/transaction_request.rs b/rpc/src/v1/types/transaction_request.rs index 944ee111484..0f1463931ff 100644 --- a/rpc/src/v1/types/transaction_request.rs +++ b/rpc/src/v1/types/transaction_request.rs @@ -157,8 +157,8 @@ mod tests { let deserialized: TransactionRequest = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, TransactionRequest { - from: Some(H160::from(1)), - to: Some(H160::from(2)), + from: Some(H160::from_low_u64_be(1)), + to: Some(H160::from_low_u64_be(2)), gas_price: Some(U256::from(1)), gas: Some(U256::from(2)), value: Some(U256::from(3)), @@ -198,7 +198,7 @@ mod tests { let deserialized: TransactionRequest = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, TransactionRequest { - from: Some(H160::from(1).into()), + from: Some(H160::from_low_u64_be(1)), to: None, gas_price: None, gas: None, From 348984b21932f589ded0ce184f97df967d534cca Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 11:16:34 +0200 Subject: [PATCH 60/90] [ethcore] finally fix compilation in tests FUCK YEAH!!! --- Cargo.lock | 121 +++++++------------------- ethcore/Cargo.toml | 2 +- ethcore/src/snapshot/tests/helpers.rs | 5 +- 3 files changed, 36 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d42461c7d57..079c71d5617 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -722,18 +722,6 @@ dependencies = [ "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ethbloom" -version = "0.5.3" -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.2 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.5 (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)", -] - [[package]] name = "ethbloom" version = "0.6.4" @@ -815,7 +803,7 @@ dependencies = [ "time-utils 0.1.0", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-standardmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-standardmap 0.12.3 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", "triehash-ethereum 0.2.0", "unexpected 0.1.0", "using_queue 0.1.0", @@ -1214,19 +1202,6 @@ dependencies = [ "triehash-ethereum 0.2.0", ] -[[package]] -name = "ethereum-types" -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.3 (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.5 (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" version = "0.6.0" @@ -1240,14 +1215,6 @@ dependencies = [ "uint 0.7.1 (git+https://github.com/ordian/parity-common)", ] -[[package]] -name = "ethereum-types-serialize" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ethjson" version = "0.1.0" @@ -1452,16 +1419,6 @@ dependencies = [ "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "fixed-hash" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fixed-hash" version = "0.3.2" @@ -1617,6 +1574,19 @@ name = "hash-db" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "hash-db" +version = "0.12.2" +source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" + +[[package]] +name = "hash256-std-hasher" +version = "0.12.2" +source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" +dependencies = [ + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "heapsize" version = "0.4.2" @@ -2039,15 +2009,6 @@ dependencies = [ "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "keccak-hash" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "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)", -] - [[package]] name = "keccak-hash" version = "0.2.0" @@ -2067,6 +2028,16 @@ dependencies = [ "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "keccak-hasher" +version = "0.12.2" +source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" +dependencies = [ + "hash-db 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", + "hash256-std-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", + "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -3483,17 +3454,6 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rlp" -version = "0.2.4" -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.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rlp" version = "0.3.0" @@ -4248,13 +4208,11 @@ dependencies = [ [[package]] name = "trie-standardmap" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.12.3" +source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" dependencies = [ - "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)", + "hash-db 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", + "keccak-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", ] [[package]] @@ -4295,17 +4253,6 @@ name = "ucd-util" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "uint" -version = "0.4.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)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "uint" version = "0.7.1" @@ -4713,17 +4660,13 @@ dependencies = [ "checksum ethabi 8.0.0 (git+https://github.com/ordian/ethabi)" = "" "checksum ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)" = "" "checksum ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)" = "" -"checksum ethbloom 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6294da962646baa738414e8e718d1a1f0360a51d92de89ccbf91870418f5360" "checksum ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)" = "" -"checksum ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e742184dc63a01c8ea0637369f8faa27c40f537949908a237f95c05e68d2c96" "checksum ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)" = "" -"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" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" -"checksum fixed-hash 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7afe6ce860afb14422711595a7b26ada9ed7de2f43c0b2ab79d09ee196287273" "checksum fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)" = "" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" @@ -4743,6 +4686,8 @@ dependencies = [ "checksum hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1" "checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd" "checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" +"checksum hash-db 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" +"checksum hash256-std-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" "checksum heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)" = "" "checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" "checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa" @@ -4782,8 +4727,8 @@ dependencies = [ "checksum jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3372b3248a53abcca8f61924f188052bb0c4cd80b482b2b4eaf9f8667efb9f4" "checksum jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c873dac37a601fb88d40ba49eeac3f1aa60953c06b2e99ddbf0569b6f8028478" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" -"checksum keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "253bbe643c32c816bf58fa5a88248fafedeebb139705ad17a62add3517854a86" "checksum keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum keccak-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" "checksum kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45bcdf5eb083602cff61a6f8438dce2a7900d714e893fc48781c39fb119d37aa" @@ -4897,7 +4842,6 @@ dependencies = [ "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" -"checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" "checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" "checksum rlp 0.4.0 (git+https://github.com/ordian/parity-common)" = "" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" @@ -4982,13 +4926,12 @@ dependencies = [ "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 trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" -"checksum trie-standardmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e26f52976a57a0859616d6fcec87092ac35d08eabbd78dc3dabee93b480ea5f" +"checksum trie-standardmap 0.12.3 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" "checksum triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d26efb4ddf87870fc08dc9a6580dc3061be350d7b9d0eb30aef1c8b4227aa46" "checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" "checksum uint 0.7.1 (git+https://github.com/ordian/parity-common)" = "" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 892a5f9bb91..c707d5c4fbd 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -83,7 +83,7 @@ kvdb-rocksdb = "0.1.3" parity-runtime = { path = "../util/runtime" } rlp_compress = { path = "../util/rlp-compress" } tempdir = "0.3" -trie-standardmap = "0.1.1" +trie-standardmap = { git = "https://github.com/paritytech/trie", branch = "ao-fix-trie-standardmap-deps" } [features] parity = ["work-notify", "price-info", "stratum"] diff --git a/ethcore/src/snapshot/tests/helpers.rs b/ethcore/src/snapshot/tests/helpers.rs index 55ed8d8109e..0bf926d31d4 100644 --- a/ethcore/src/snapshot/tests/helpers.rs +++ b/ethcore/src/snapshot/tests/helpers.rs @@ -124,8 +124,9 @@ pub fn fill_storage(mut db: AccountDBMut, root: &mut H256, seed: &mut H256) { SecTrieDBMut::from_existing(&mut db, root).unwrap() }; - // TODO: upgrade trie_standardmap - for (k, v) in map.make_with(seed) { + let mut bytes = [0u8; 32]; + bytes.copy_from_slice(seed.as_bytes()); + for (k, v) in map.make_with(&mut bytes) { trie.insert(&k, &v).unwrap(); } } From 8a91a6e1861410c05ed88015c873b5a0d12f67c4 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 11:22:13 +0200 Subject: [PATCH 61/90] [ethstore] lazy_static is unused --- Cargo.lock | 2 +- accounts/ethstore/Cargo.toml | 1 - accounts/ethstore/src/lib.rs | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a3519b477b..4d992076a08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4866,6 +4866,7 @@ dependencies = [ "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 digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05f47366984d3ad862010e22c7ce81a7dbcaebbdfb37241a620f8b6596ee135c" "checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" "checksum docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db2906c2579b5b7207fc1e328796a9a8835dc44e22dbe8e460b1d636f9a7b225" @@ -5067,7 +5068,6 @@ dependencies = [ "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" "checksum ripemd160 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a" -"checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" "checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" "checksum rlp 0.4.0 (git+https://github.com/ordian/parity-common)" = "" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 70e4e041c13..a2990f47cc6 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -22,7 +22,6 @@ dir = { path = "../../util/dir" } smallvec = "0.6" parity-wordlist = "1.0" tempdir = "0.3" -lazy_static = "1.2.0" [dev-dependencies] matches = "0.1" diff --git a/accounts/ethstore/src/lib.rs b/accounts/ethstore/src/lib.rs index c0955caeb0d..aa2bb86a471 100644 --- a/accounts/ethstore/src/lib.rs +++ b/accounts/ethstore/src/lib.rs @@ -36,8 +36,6 @@ extern crate ethereum_types; extern crate ethkey as _ethkey; extern crate parity_wordlist; -#[macro_use] -extern crate lazy_static; #[macro_use] extern crate log; #[macro_use] From c2c935f9eebc81d8970b9ec9775f64799023202e Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 11:30:15 +0200 Subject: [PATCH 62/90] [ethcore] fix test --- Cargo.lock | 1 - ethcore/types/src/transaction/transaction.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4d992076a08..d7df4bf4a12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1378,7 +1378,6 @@ dependencies = [ "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", "ethkey 0.3.0", "itertools 0.5.10 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ethcore/types/src/transaction/transaction.rs b/ethcore/types/src/transaction/transaction.rs index f17bdccfb4c..f2d7c52a093 100644 --- a/ethcore/types/src/transaction/transaction.rs +++ b/ethcore/types/src/transaction/transaction.rs @@ -654,7 +654,7 @@ mod tests { let test_vector = |tx_data: &str, address: &'static str| { let signed = rlp::decode(&FromHex::from_hex(tx_data).unwrap()).expect("decoding tx data failed"); let signed = SignedTransaction::new(signed).unwrap(); - assert_eq!(signed.sender(), Address::from_str(address).unwrap()); + assert_eq!(signed.sender(), Address::from_str(&address[2..]).unwrap()); println!("chainid: {:?}", signed.chain_id()); }; From a654c15aa641dd3dcdc6bc290d40bc35b21dee1a Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 11:40:27 +0200 Subject: [PATCH 63/90] fix up bad merge --- accounts/fake-hardware-wallet/Cargo.toml | 10 - accounts/hw/Cargo.toml | 21 - accounts/hw/src/trezor.rs | 463 ----------------------- 3 files changed, 494 deletions(-) delete mode 100644 accounts/fake-hardware-wallet/Cargo.toml delete mode 100644 accounts/hw/Cargo.toml delete mode 100644 accounts/hw/src/trezor.rs diff --git a/accounts/fake-hardware-wallet/Cargo.toml b/accounts/fake-hardware-wallet/Cargo.toml deleted file mode 100644 index 8d2c2d2aad5..00000000000 --- a/accounts/fake-hardware-wallet/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -description = "Fake hardware-wallet, for OS' that don't support libusb" -name = "fake-hardware-wallet" -version = "0.0.1" -license = "GPL-3.0" -authors = ["Parity Technologies "] - -[dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } -ethkey = { path = "../../accounts/ethkey" } diff --git a/accounts/hw/Cargo.toml b/accounts/hw/Cargo.toml deleted file mode 100644 index c7a9c202fcd..00000000000 --- a/accounts/hw/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -description = "Hardware wallet support." -homepage = "http://parity.io" -license = "GPL-3.0" -name = "hardware-wallet" -version = "1.12.0" -authors = ["Parity Technologies "] - -[dependencies] -log = "0.4" -parking_lot = "0.7" -protobuf = "1.4" -hidapi = { git = "https://github.com/paritytech/hidapi-rs" } -libusb = { git = "https://github.com/paritytech/libusb-rs" } -trezor-sys = { git = "https://github.com/paritytech/trezor-sys" } -ethkey = { path = "../ethkey" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } -semver = "0.9" - -[dev-dependencies] -rustc-hex = "1.0" diff --git a/accounts/hw/src/trezor.rs b/accounts/hw/src/trezor.rs deleted file mode 100644 index 310cc09ba57..00000000000 --- a/accounts/hw/src/trezor.rs +++ /dev/null @@ -1,463 +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 . - -//! Trezor hardware wallet module. Supports Trezor v1. -//! See -//! and -//! for protocol details. - -use std::cmp::{min, max}; -use std::sync::Arc; -use std::time::{Duration, Instant}; -use std::fmt; - -use ethereum_types::{U256, H256, Address}; -use ethkey::Signature; -use hidapi; -use libusb; -use parking_lot::{Mutex, RwLock}; -use protobuf::{self, Message, ProtobufEnum}; -use super::{DeviceDirection, WalletInfo, TransactionInfo, KeyPath, Wallet, Device, is_valid_hid_device}; -use trezor_sys::messages::{EthereumAddress, PinMatrixAck, MessageType, EthereumTxRequest, EthereumSignTx, EthereumGetAddress, EthereumTxAck, ButtonAck}; - -/// Trezor v1 vendor ID -const TREZOR_VID: u16 = 0x534c; -/// Trezor product IDs -const TREZOR_PIDS: [u16; 1] = [0x0001]; - -const ETH_DERIVATION_PATH: [u32; 5] = [0x8000_002C, 0x8000_003C, 0x8000_0000, 0, 0]; // m/44'/60'/0'/0/0 -const ETC_DERIVATION_PATH: [u32; 5] = [0x8000_002C, 0x8000_003D, 0x8000_0000, 0, 0]; // m/44'/61'/0'/0/0 - -/// Hardware wallet error. -#[derive(Debug)] -pub enum Error { - /// Ethereum wallet protocol error. - Protocol(&'static str), - /// Hidapi error. - Usb(hidapi::HidError), - /// Libusb error - LibUsb(libusb::Error), - /// Device with request key is not available. - KeyNotFound, - /// Signing has been cancelled by user. - UserCancel, - /// The Message Type given in the trezor RPC call is not something we recognize - BadMessageType, - /// Trying to read from a closed device at the given path - LockedDevice(String), - /// Signing messages are not supported by Trezor - NoSigningMessage, - /// No device arrived - NoDeviceArrived, - /// No device left - NoDeviceLeft, - /// Invalid PID or VID - InvalidDevice, -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - match *self { - Error::Protocol(ref s) => write!(f, "Trezor protocol error: {}", s), - Error::Usb(ref e) => write!(f, "USB communication error: {}", e), - Error::LibUsb(ref e) => write!(f, "LibUSB communication error: {}", e), - Error::KeyNotFound => write!(f, "Key not found"), - Error::UserCancel => write!(f, "Operation has been cancelled"), - Error::BadMessageType => write!(f, "Bad Message Type in RPC call"), - Error::LockedDevice(ref s) => write!(f, "Device is locked, needs PIN to perform operations: {}", s), - Error::NoSigningMessage=> write!(f, "Signing messages are not supported by Trezor"), - Error::NoDeviceArrived => write!(f, "No device arrived"), - Error::NoDeviceLeft => write!(f, "No device left"), - Error::InvalidDevice => write!(f, "Device with non-supported product ID or vendor ID was detected"), - } - } -} - -impl From for Error { - fn from(err: hidapi::HidError) -> Self { - Error::Usb(err) - } -} - -impl From for Error { - fn from(err: libusb::Error) -> Self { - Error::LibUsb(err) - } -} - -impl From for Error { - fn from(_: protobuf::ProtobufError) -> Self { - Error::Protocol(&"Could not read response from Trezor Device") - } -} - -/// Trezor device manager -pub struct Manager { - usb: Arc>, - devices: RwLock>, - locked_devices: RwLock>, - key_path: RwLock, -} - -/// HID Version used for the Trezor device -enum HidVersion { - V1, - V2, -} - -impl Manager { - /// Create a new instance. - pub fn new(usb: Arc>) -> Arc { - Arc::new(Self { - usb, - devices: RwLock::new(Vec::new()), - locked_devices: RwLock::new(Vec::new()), - key_path: RwLock::new(KeyPath::Ethereum), - }) - } - - pub fn pin_matrix_ack(&self, device_path: &str, pin: &str) -> Result { - let unlocked = { - let usb = self.usb.lock(); - let device = self.open_path(|| usb.open_path(&device_path))?; - let t = MessageType::MessageType_PinMatrixAck; - let mut m = PinMatrixAck::new(); - m.set_pin(pin.to_string()); - self.send_device_message(&device, t, &m)?; - let (resp_type, _) = self.read_device_response(&device)?; - match resp_type { - // Getting an Address back means it's unlocked, this is undocumented behavior - MessageType::MessageType_EthereumAddress => Ok(true), - // Getting anything else means we didn't unlock it - _ => Ok(false), - - } - }; - self.update_devices(DeviceDirection::Arrived)?; - unlocked - } - - fn u256_to_be_vec(&self, val: &U256) -> Vec { - let mut buf = [0_u8; 32]; - val.to_big_endian(&mut buf); - buf.iter().skip_while(|x| **x == 0).cloned().collect() - } - - fn signing_loop(&self, handle: &hidapi::HidDevice, chain_id: &Option, data: &[u8]) -> Result { - let (resp_type, bytes) = self.read_device_response(&handle)?; - match resp_type { - MessageType::MessageType_Cancel => Err(Error::UserCancel), - MessageType::MessageType_ButtonRequest => { - self.send_device_message(handle, MessageType::MessageType_ButtonAck, &ButtonAck::new())?; - // Signing loop goes back to the top and reading blocks - // for up to 5 minutes waiting for response from the device - // if the user doesn't click any button within 5 minutes you - // get a signing error and the device sort of locks up on the signing screen - self.signing_loop(handle, chain_id, data) - } - MessageType::MessageType_EthereumTxRequest => { - let resp: EthereumTxRequest = protobuf::core::parse_from_bytes(&bytes)?; - if resp.has_data_length() { - let mut msg = EthereumTxAck::new(); - let len = resp.get_data_length() as usize; - msg.set_data_chunk(data[..len].to_vec()); - self.send_device_message(handle, MessageType::MessageType_EthereumTxAck, &msg)?; - self.signing_loop(handle, chain_id, &data[len..]) - } else { - let v = resp.get_signature_v(); - let r = H256::from_slice(resp.get_signature_r()); - let s = H256::from_slice(resp.get_signature_s()); - if let Some(c_id) = *chain_id { - // If there is a chain_id supplied, Trezor will return a v - // part of the signature that is already adjusted for EIP-155, - // so v' = v + 2 * chain_id + 35, but code further down the - // pipeline will already do this transformation, so remove it here - let adjustment = 35 + 2 * c_id as u32; - Ok(Signature::from_rsv(&r, &s, (max(v, adjustment) - adjustment) as u8)) - } else { - // If there isn't a chain_id, v will be returned as v + 27 - let adjusted_v = if v < 27 { v } else { v - 27 }; - Ok(Signature::from_rsv(&r, &s, adjusted_v as u8)) - } - } - } - MessageType::MessageType_Failure => Err(Error::Protocol("Last message sent to Trezor failed")), - _ => Err(Error::Protocol("Unexpected response from Trezor device.")), - } - } - - fn send_device_message(&self, device: &hidapi::HidDevice, msg_type: MessageType, msg: &Message) -> Result { - let msg_id = msg_type as u16; - let mut message = msg.write_to_bytes()?; - let msg_size = message.len(); - let mut data = Vec::new(); - let hid_version = self.probe_hid_version(device)?; - // Magic constants - data.push(b'#'); - data.push(b'#'); - // Convert msg_id to BE and split into bytes - data.push(((msg_id >> 8) & 0xFF) as u8); - data.push((msg_id & 0xFF) as u8); - // Convert msg_size to BE and split into bytes - data.push(((msg_size >> 24) & 0xFF) as u8); - data.push(((msg_size >> 16) & 0xFF) as u8); - data.push(((msg_size >> 8) & 0xFF) as u8); - data.push((msg_size & 0xFF) as u8); - data.append(&mut message); - while data.len() % 63 > 0 { - data.push(0); - } - let mut total_written = 0; - for chunk in data.chunks(63) { - let mut padded_chunk = match hid_version { - HidVersion::V1 => vec![b'?'], - HidVersion::V2 => vec![0, b'?'], - }; - padded_chunk.extend_from_slice(&chunk); - total_written += device.write(&padded_chunk)?; - } - Ok(total_written) - } - - fn probe_hid_version(&self, device: &hidapi::HidDevice) -> Result { - let mut buf2 = [0xFF_u8; 65]; - buf2[0] = 0; - buf2[1] = 63; - let mut buf1 = [0xFF_u8; 64]; - buf1[0] = 63; - if device.write(&buf2)? == 65 { - Ok(HidVersion::V2) - } else if device.write(&buf1)? == 64 { - Ok(HidVersion::V1) - } else { - Err(Error::Usb("Unable to determine HID Version")) - } - } - - fn read_device_response(&self, device: &hidapi::HidDevice) -> Result<(MessageType, Vec), Error> { - let protocol_err = Error::Protocol(&"Unexpected wire response from Trezor Device"); - let mut buf = vec![0; 64]; - - let first_chunk = device.read_timeout(&mut buf, 300_000)?; - if first_chunk < 9 || buf[0] != b'?' || buf[1] != b'#' || buf[2] != b'#' { - return Err(protocol_err); - } - let msg_type = MessageType::from_i32(((buf[3] as i32 & 0xFF) << 8) + (buf[4] as i32 & 0xFF)).ok_or(protocol_err)?; - let msg_size = ((buf[5] as u32 & 0xFF) << 24) + ((buf[6] as u32 & 0xFF) << 16) + ((buf[7] as u32 & 0xFF) << 8) + (buf[8] as u32 & 0xFF); - let mut data = Vec::new(); - data.extend_from_slice(&buf[9..]); - while data.len() < (msg_size as usize) { - device.read_timeout(&mut buf, 10_000)?; - data.extend_from_slice(&buf[1..]); - } - Ok((msg_type, data[..msg_size as usize].to_vec())) - } -} - -impl<'a> Wallet<'a> for Manager { - type Error = Error; - type Transaction = &'a TransactionInfo; - - fn sign_transaction(&self, address: &Address, t_info: Self::Transaction) -> - Result { - let usb = self.usb.lock(); - let devices = self.devices.read(); - let device = devices.iter().find(|d| &d.info.address == address).ok_or(Error::KeyNotFound)?; - let handle = self.open_path(|| usb.open_path(&device.path))?; - let msg_type = MessageType::MessageType_EthereumSignTx; - let mut message = EthereumSignTx::new(); - match *self.key_path.read() { - KeyPath::Ethereum => message.set_address_n(ETH_DERIVATION_PATH.to_vec()), - KeyPath::EthereumClassic => message.set_address_n(ETC_DERIVATION_PATH.to_vec()), - } - message.set_nonce(self.u256_to_be_vec(&t_info.nonce)); - message.set_gas_limit(self.u256_to_be_vec(&t_info.gas_limit)); - message.set_gas_price(self.u256_to_be_vec(&t_info.gas_price)); - message.set_value(self.u256_to_be_vec(&t_info.value)); - - if let Some(addr) = t_info.to { - message.set_to(addr.as_bytes().to_vec()) - } - let first_chunk_length = min(t_info.data.len(), 1024); - let chunk = &t_info.data[0..first_chunk_length]; - message.set_data_initial_chunk(chunk.to_vec()); - message.set_data_length(t_info.data.len() as u32); - if let Some(c_id) = t_info.chain_id { - message.set_chain_id(c_id as u32); - } - - self.send_device_message(&handle, msg_type, &message)?; - - self.signing_loop(&handle, &t_info.chain_id, &t_info.data[first_chunk_length..]) - } - - fn set_key_path(&self, key_path: KeyPath) { - *self.key_path.write() = key_path; - } - - fn update_devices(&self, device_direction: DeviceDirection) -> Result { - let mut usb = self.usb.lock(); - usb.refresh_devices(); - let devices = usb.devices(); - let num_prev_devices = self.devices.read().len(); - - let detected_devices = devices.iter() - .filter(|&d| is_valid_trezor(d.vendor_id, d.product_id) && - is_valid_hid_device(d.usage_page, d.interface_number) - ) - .fold(Vec::new(), |mut v, d| { - match self.read_device(&usb, &d) { - Ok(info) => { - trace!(target: "hw", "Found device: {:?}", info); - v.push(info); - } - Err(e) => trace!(target: "hw", "Error reading device info: {}", e), - }; - v - }); - - let num_curr_devices = detected_devices.len(); - *self.devices.write() = detected_devices; - - match device_direction { - DeviceDirection::Arrived => { - if num_curr_devices > num_prev_devices { - Ok(num_curr_devices - num_prev_devices) - } else { - Err(Error::NoDeviceArrived) - } - } - DeviceDirection::Left => { - if num_prev_devices > num_curr_devices { - Ok(num_prev_devices - num_curr_devices) - } else { - Err(Error::NoDeviceLeft) - } - } - } - } - - fn read_device(&self, usb: &hidapi::HidApi, dev_info: &hidapi::HidDeviceInfo) -> Result { - let handle = self.open_path(|| usb.open_path(&dev_info.path))?; - let manufacturer = dev_info.manufacturer_string.clone().unwrap_or_else(|| "Unknown".to_owned()); - let name = dev_info.product_string.clone().unwrap_or_else(|| "Unknown".to_owned()); - let serial = dev_info.serial_number.clone().unwrap_or_else(|| "Unknown".to_owned()); - match self.get_address(&handle) { - Ok(Some(addr)) => { - Ok(Device { - path: dev_info.path.clone(), - info: WalletInfo { - name, - manufacturer, - serial, - address: addr, - }, - }) - } - Ok(None) => Err(Error::LockedDevice(dev_info.path.clone())), - Err(e) => Err(e), - } - } - - fn list_devices(&self) -> Vec { - self.devices.read().iter().map(|d| d.info.clone()).collect() - } - - fn list_locked_devices(&self) -> Vec { - (*self.locked_devices.read()).clone() - } - - fn get_wallet(&self, address: &Address) -> Option { - self.devices.read().iter().find(|d| &d.info.address == address).map(|d| d.info.clone()) - } - - fn get_address(&self, device: &hidapi::HidDevice) -> Result, Error> { - let typ = MessageType::MessageType_EthereumGetAddress; - let mut message = EthereumGetAddress::new(); - match *self.key_path.read() { - KeyPath::Ethereum => message.set_address_n(ETH_DERIVATION_PATH.to_vec()), - KeyPath::EthereumClassic => message.set_address_n(ETC_DERIVATION_PATH.to_vec()), - } - message.set_show_display(false); - self.send_device_message(&device, typ, &message)?; - - let (resp_type, bytes) = self.read_device_response(&device)?; - match resp_type { - MessageType::MessageType_EthereumAddress => { - let response: EthereumAddress = protobuf::core::parse_from_bytes(&bytes)?; - Ok(Some(Address::from_slice(response.get_address()))) - } - _ => Ok(None), - } - } - - fn open_path(&self, f: F) -> Result - where F: Fn() -> Result - { - f().map_err(Into::into) - } -} - -/// Poll the device in maximum `max_polling_duration` if it doesn't succeed -pub fn try_connect_polling(trezor: &Manager, duration: &Duration, dir: DeviceDirection) -> bool { - let start_time = Instant::now(); - while start_time.elapsed() <= *duration { - if let Ok(num_devices) = trezor.update_devices(dir) { - trace!(target: "hw", "{} Trezor devices {}", num_devices, dir); - return true - } - } - false -} - -/// Check if the detected device is a Trezor device by checking both the product ID and the vendor ID -pub fn is_valid_trezor(vid: u16, pid: u16) -> bool { - vid == TREZOR_VID && TREZOR_PIDS.contains(&pid) -} - -#[test] -#[ignore] -/// This test can't be run without an actual trezor device connected -/// (and unlocked) attached to the machine that's running the test -fn test_signature() { - use ethereum_types::Address; - use MAX_POLLING_DURATION; - use super::HardwareWalletManager; - - let manager = HardwareWalletManager::new().unwrap(); - - assert_eq!(try_connect_polling(&manager.trezor, &MAX_POLLING_DURATION, DeviceDirection::Arrived), true); - - let addr: Address = manager.list_wallets() - .iter() - .filter(|d| d.name == "TREZOR".to_string() && d.manufacturer == "SatoshiLabs".to_string()) - .nth(0) - .map(|d| d.address) - .unwrap(); - - let t_info = TransactionInfo { - nonce: U256::from(1), - gas_price: U256::from(100), - gas_limit: U256::from(21_000), - to: Some(Address::from(1337)), - chain_id: Some(1), - value: U256::from(1_000_000), - data: (&[1u8; 3000]).to_vec(), - }; - - let signature = manager.trezor.sign_transaction(&addr, &t_info); - assert!(signature.is_ok()); -} From a618804a1e361b570ebb050f2feb9686c0b7602f Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 11:46:03 +0200 Subject: [PATCH 64/90] [Cargo.toml] remove unused patches --- Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3a360debd04..1ab7f4497e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -145,5 +145,3 @@ members = [ [patch.crates-io] heapsize = { git = "https://github.com/cheme/heapsize.git", branch = "ec-macfix" } -ethbloom = { git = "https://github.com/ordian/parity-common" } -primitive-types = { git = "https://github.com/ordian/parity-common" } From d14d0ddd7b532afd3c5e6d9162422d898c2fd5c0 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 12:04:03 +0200 Subject: [PATCH 65/90] [*] replace some git dependencies with crates.io --- Cargo.lock | 314 ++++++++++++------------- Cargo.toml | 6 +- accounts/Cargo.toml | 2 +- accounts/ethkey/Cargo.toml | 2 +- accounts/ethstore/Cargo.toml | 4 +- cli-signer/Cargo.toml | 2 +- cli-signer/rpc-client/Cargo.toml | 4 +- ethash/Cargo.toml | 4 +- ethcore/Cargo.toml | 12 +- ethcore/blockchain/Cargo.toml | 6 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 4 +- ethcore/evm/Cargo.toml | 4 +- ethcore/light/Cargo.toml | 6 +- ethcore/node-filter/Cargo.toml | 8 +- ethcore/private-tx/Cargo.toml | 12 +- ethcore/service/Cargo.toml | 2 +- ethcore/sync/Cargo.toml | 6 +- ethcore/types/Cargo.toml | 6 +- ethcore/vm/Cargo.toml | 6 +- ethcore/wasm/Cargo.toml | 2 +- ethcore/wasm/run/Cargo.toml | 2 +- evmbin/Cargo.toml | 2 +- ipfs/Cargo.toml | 4 +- json/Cargo.toml | 2 +- miner/Cargo.toml | 12 +- miner/local-store/Cargo.toml | 2 +- miner/stratum/Cargo.toml | 4 +- rpc/Cargo.toml | 6 +- secret-store/Cargo.toml | 10 +- updater/Cargo.toml | 10 +- updater/hash-fetch/Cargo.toml | 10 +- util/EIP-712/Cargo.toml | 6 +- util/blooms-db/Cargo.toml | 2 +- util/dir/Cargo.toml | 2 +- util/fastmap/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 6 +- util/keccak-hasher/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 6 +- util/network/Cargo.toml | 4 +- util/patricia-trie-ethereum/Cargo.toml | 6 +- util/registrar/Cargo.toml | 8 +- util/rlp-compress/Cargo.toml | 2 +- util/rlp-derive/Cargo.toml | 2 +- util/triehash-ethereum/Cargo.toml | 2 +- util/version/Cargo.toml | 2 +- whisper/Cargo.toml | 4 +- 47 files changed, 267 insertions(+), 267 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7df4bf4a12..2363aa580d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -255,7 +255,7 @@ name = "blooms-db" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", + "ethbloom 0.6.4 (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)", @@ -361,7 +361,7 @@ dependencies = [ name = "cli-signer" version = "1.4.0" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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", @@ -400,13 +400,13 @@ dependencies = [ name = "common-types" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (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.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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)", "unexpected 0.1.0", @@ -675,7 +675,7 @@ name = "dir" version = "0.1.2" dependencies = [ "app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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", ] @@ -711,12 +711,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "eip-712" version = "0.1.0" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.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.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -783,11 +783,11 @@ dependencies = [ [[package]] name = "ethabi" -version = "8.0.0" -source = "git+https://github.com/ordian/ethabi#a8abed8528873112c4fde42b81f454baf4771436" +version = "8.0.0-beta.1" +source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#fa5f176e424d119614b7fe43cffa314fc4999642" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -797,15 +797,15 @@ dependencies = [ [[package]] name = "ethabi-contract" -version = "8.0.0" -source = "git+https://github.com/ordian/ethabi#a8abed8528873112c4fde42b81f454baf4771436" +version = "8.0.0-beta.1" +source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#fa5f176e424d119614b7fe43cffa314fc4999642" [[package]] name = "ethabi-derive" -version = "8.0.0" -source = "git+https://github.com/ordian/ethabi#a8abed8528873112c4fde42b81f454baf4771436" +version = "8.0.0-beta.1" +source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#fa5f176e424d119614b7fe43cffa314fc4999642" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "heck 0.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)", @@ -819,8 +819,8 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.2.0 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -833,12 +833,12 @@ dependencies = [ [[package]] name = "ethbloom" version = "0.6.4" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", - "impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)", - "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", + "fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 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)", ] @@ -855,9 +855,9 @@ dependencies = [ "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethash 1.12.0", "ethcore-accounts 0.1.0", "ethcore-blockchain 0.1.0", @@ -867,7 +867,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-stratum 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "evm 0.1.0", @@ -877,7 +877,7 @@ dependencies = [ "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)", "journaldb 0.2.0", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", @@ -900,7 +900,7 @@ dependencies = [ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -923,7 +923,7 @@ dependencies = [ name = "ethcore-accounts" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -943,18 +943,18 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (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.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.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -973,7 +973,7 @@ name = "ethcore-call-contract" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -982,11 +982,11 @@ name = "ethcore-db" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", ] @@ -1020,7 +1020,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", @@ -1028,7 +1028,7 @@ dependencies = [ "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)", "journaldb 0.2.0", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", @@ -1039,7 +1039,7 @@ dependencies = [ "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "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)", @@ -1074,24 +1074,24 @@ dependencies = [ "common-types 0.1.0", "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 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethash 1.12.0", "ethcore-call-contract 0.1.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "price-info 1.12.0", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1108,14 +1108,14 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.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.4.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.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1132,11 +1132,11 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.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.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1147,7 +1147,7 @@ dependencies = [ "parity-snappy 0.1.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.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1165,27 +1165,27 @@ 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)", - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.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.4.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.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1205,19 +1205,19 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", "jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1250,7 +1250,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1263,10 +1263,10 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.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)", @@ -1286,14 +1286,14 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", "ethcore-private-tx 1.0.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fastmap 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", @@ -1304,7 +1304,7 @@ dependencies = [ "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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)", "triehash-ethereum 0.2.0", @@ -1312,22 +1312,22 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.6.0" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +version = "0.6.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)", - "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", - "impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)", - "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", - "primitive-types 0.3.0 (git+https://github.com/ordian/parity-common)", - "uint 0.7.1 (git+https://github.com/ordian/parity-common)", + "ethbloom 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "primitive-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethjson" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1341,7 +1341,7 @@ 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?branch=rand-0.6)", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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", @@ -1375,7 +1375,7 @@ name = "ethstore" version = "0.2.1" dependencies = [ "dir 0.1.2", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1418,9 +1418,9 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.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)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", @@ -1438,7 +1438,7 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -1500,7 +1500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fastmap" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1529,7 +1529,7 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.3.2" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", @@ -1868,7 +1868,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1876,15 +1876,15 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "impl-serde" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1989,11 +1989,11 @@ name = "journaldb" version = "0.2.0" dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", @@ -2001,7 +2001,7 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2136,9 +2136,9 @@ dependencies = [ [[package]] name = "keccak-hash" version = "0.2.0" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "primitive-types 0.3.0 (git+https://github.com/ordian/parity-common)", + "primitive-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2146,7 +2146,7 @@ dependencies = [ name = "keccak-hasher" version = "0.1.1" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", @@ -2498,14 +2498,14 @@ dependencies = [ name = "node-filter" version = "1.12.0" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-io 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2718,7 +2718,7 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-service 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-fetch 0.0.1", @@ -2727,7 +2727,7 @@ dependencies = [ "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2752,7 +2752,7 @@ dependencies = [ "pretty_assertions 0.1.2 (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.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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)", @@ -2771,14 +2771,14 @@ dependencies = [ name = "parity-hash-fetch" version = "1.12.0" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (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)", @@ -2796,12 +2796,12 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2815,7 +2815,7 @@ 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)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (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)", @@ -2865,7 +2865,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.1", @@ -2880,7 +2880,7 @@ dependencies = [ "jsonrpc-ipc-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)", "jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (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)", @@ -2893,7 +2893,7 @@ dependencies = [ "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.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2912,11 +2912,11 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.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-rpc 1.12.0", @@ -2974,13 +2974,13 @@ name = "parity-updater" version = "1.12.0" dependencies = [ "common-types 0.1.0", - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.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)", "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)", @@ -3000,7 +3000,7 @@ name = "parity-version" version = "2.6.0" dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.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.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3022,7 +3022,7 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", @@ -3035,7 +3035,7 @@ dependencies = [ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (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)", @@ -3122,14 +3122,14 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", "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)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3285,13 +3285,13 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.3.0" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)", - "impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)", - "impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)", - "impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)", - "uint 0.7.1 (git+https://github.com/ordian/parity-common)", + "fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3316,7 +3316,7 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3574,11 +3574,11 @@ dependencies = [ name = "registrar" version = "0.0.1" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)", - "ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)", + "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3632,7 +3632,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.4.0" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3644,7 +3644,7 @@ version = "0.1.0" dependencies = [ "elastic-array 0.10.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.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3653,7 +3653,7 @@ version = "0.1.0" 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)", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4435,7 +4435,7 @@ dependencies = [ name = "triehash-ethereum" version = "0.2.0" dependencies = [ - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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)", ] @@ -4463,7 +4463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uint" version = "0.7.1" -source = "git+https://github.com/ordian/parity-common#82a897cfffb25ac25af7aa90ab5adf58033a83be" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4608,13 +4608,13 @@ name = "vm" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", - "keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)", + "keccak-hash 0.2.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)", "patricia-trie-ethereum 0.1.0", - "rlp 0.4.0 (git+https://github.com/ordian/parity-common)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4659,7 +4659,7 @@ 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.6.0 (git+https://github.com/ordian/parity-common)", + "ethereum-types 0.6.0-beta.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4876,17 +4876,17 @@ dependencies = [ "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" "checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6)" = "" -"checksum ethabi 8.0.0 (git+https://github.com/ordian/ethabi)" = "" -"checksum ethabi-contract 8.0.0 (git+https://github.com/ordian/ethabi)" = "" -"checksum ethabi-derive 8.0.0 (git+https://github.com/ordian/ethabi)" = "" -"checksum ethbloom 0.6.4 (git+https://github.com/ordian/parity-common)" = "" -"checksum ethereum-types 0.6.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" +"checksum ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" +"checksum ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" +"checksum ethbloom 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3932e82d64d347a045208924002930dc105a138995ccdc1479d0f05f0359f17c" +"checksum ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)" = "239975e7810f498bce4d3c0bee3913cfd1d040a19b6b89beca3245348ac14b5a" "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" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" -"checksum fixed-hash 0.3.2 (git+https://github.com/ordian/parity-common)" = "" +"checksum fixed-hash 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" @@ -4922,9 +4922,9 @@ dependencies = [ "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" "checksum igd 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a254e265e8810deb357a9de757f784787ec415d056ededf410c0aa460afee9e" -"checksum impl-codec 0.2.0 (git+https://github.com/ordian/parity-common)" = "" -"checksum impl-rlp 0.2.0 (git+https://github.com/ordian/parity-common)" = "" -"checksum impl-serde 0.2.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b" +"checksum impl-rlp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f39b9963cf5f12fcc4ae4b30a6927ed67d6b4ea4cbe7d17a41131163b401303b" +"checksum impl-serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d26be4b97d738552ea423f76c4f681012ff06c3fa36fa968656b3679f60b4a1" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "26746cbc2e680af687e88d717f20ff90079bd10fc984ad57d277cd0e37309fa5" "checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" @@ -4948,7 +4948,7 @@ dependencies = [ "checksum jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3372b3248a53abcca8f61924f188052bb0c4cd80b482b2b4eaf9f8667efb9f4" "checksum jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c873dac37a601fb88d40ba49eeac3f1aa60953c06b2e99ddbf0569b6f8028478" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" -"checksum keccak-hash 0.2.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "69e8ee697b9aa6dcc34d7657565fa5052763a1627a5b59e4c3c0ae3ed0d70a65" "checksum keccak-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" @@ -5033,7 +5033,7 @@ dependencies = [ "checksum primal-check 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1" "checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" "checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" -"checksum primitive-types 0.3.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum primitive-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2288eb2a39386c4bc817974cc413afe173010dc80e470fcb1e9a35580869f024" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" "checksum pwasm-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e9135bed7b452e20dbb395a2d519abaf0c46d60e7ecc02daeeab447d29bada1" @@ -5068,7 +5068,7 @@ dependencies = [ "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" "checksum ripemd160 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a" "checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" -"checksum rlp 0.4.0 (git+https://github.com/ordian/parity-common)" = "" +"checksum rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b0d56c1450bfbef1181fdeb78b902dc1d23178de77c23d705317508e03d1b7c" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" "checksum rprompt 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1601f32bc5858aae3cbfa1c645c96c4d820cc5c16be0194f089560c00b6eb625" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" @@ -5162,7 +5162,7 @@ dependencies = [ "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum uint 0.7.1 (git+https://github.com/ordian/parity-common)" = "" +"checksum uint 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2143cded94692b156c356508d92888acc824db5bffc0b4089732264c6fcf86d4" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" diff --git a/Cargo.toml b/Cargo.toml index 1ab7f4497e5..c282f495016 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,12 +45,12 @@ ethcore-network = { path = "util/network" } ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-service = { path = "ethcore/service" } ethcore-sync = { path = "ethcore/sync" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } node-filter = { path = "ethcore/node-filter" } -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" cli-signer= { path = "cli-signer" } parity-daemonize = "0.3" parity-hash-fetch = { path = "updater/hash-fetch" } @@ -64,7 +64,7 @@ parity-whisper = { path = "whisper" } parity-path = "0.1" dir = { path = "util/dir" } panic_hook = { path = "util/panic-hook" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" migration-rocksdb = { path = "util/migration-rocksdb" } kvdb = "0.1" kvdb-rocksdb = "0.1.3" diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index 35da53f1cc1..a141d4f4060 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -17,5 +17,5 @@ serde_derive = "1.0" serde_json = "1.0" [dev-dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" tempdir = "0.3" diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index 91e7dda44e3..41f03da74ca 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -9,7 +9,7 @@ edit-distance = "2.0" parity-crypto = "0.4.0" # TODO: use master branch after we switch to rand 0.6 eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", branch = "rand-0.6" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" lazy_static = "1.0" log = "0.4" memzero = { path = "../../util/memzero" } diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index a2990f47cc6..fa47b7c656d 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -17,7 +17,7 @@ time = "0.1.34" itertools = "0.5" parking_lot = "0.7" parity-crypto = "0.4.0" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" dir = { path = "../../util/dir" } smallvec = "0.6" parity-wordlist = "1.0" @@ -25,6 +25,6 @@ tempdir = "0.3" [dev-dependencies] matches = "0.1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" [lib] diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index fe172d81f36..0c21041839d 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -7,7 +7,7 @@ name = "cli-signer" version = "1.4.0" [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" 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 e017f1ecf4c..304c444983e 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -7,7 +7,7 @@ name = "parity-rpc-client" version = "1.4.0" [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" futures = "0.1" log = "0.4" serde = "1.0" @@ -18,4 +18,4 @@ parking_lot = "0.7" jsonrpc-core = "10.0.1" jsonrpc-ws-server = "10.0.1" parity-rpc = { path = "../../rpc" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index 0b47c7fb0ef..2fe512835af 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -6,8 +6,8 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1.0" either = "1.0.0" -ethereum-types = { git = "https://github.com/ordian/parity-common" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" +keccak-hash = "0.2.0" log = "0.4" memmap = "0.6" parking_lot = "0.7" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index cc0476750db..c42da5c415c 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -15,9 +15,9 @@ common-types = { path = "types" } crossbeam = "0.4" derive_more = "0.14.0" env_logger = { version = "0.5", optional = true } -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethash = { path = "../ethash" } ethcore-blockchain = { path = "./blockchain" } ethcore-bloom-journal = { path = "../util/bloom" } @@ -26,7 +26,7 @@ ethcore-db = { path = "./db" } ethcore-io = { path = "../util/io" } ethcore-miner = { path = "../miner" } ethcore-stratum = { path = "../miner/stratum", optional = true } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } evm = { path = "evm" } @@ -35,7 +35,7 @@ hash-db = "0.11.0" heapsize = "0.4" itertools = "0.5" journaldb = { path = "../util/journaldb" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" keccak-hasher = { path = "../util/keccak-hasher" } kvdb = "0.1" kvdb-memorydb = "0.1" @@ -57,7 +57,7 @@ trie-db = "0.11.0" patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" } rand = "0.6" rayon = "1.0" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" rlp_derive = { path = "../util/rlp-derive" } rustc-hex = "1.0" serde = "1.0" diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index 383679684bc..9d7764a9248 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -12,7 +12,7 @@ ansi_term = "0.10" blooms-db = { path = "../../util/blooms-db" } common-types = { path = "../types" } ethcore-db = { path = "../db" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" heapsize = "0.4" itertools = "0.5" kvdb = "0.1" @@ -20,14 +20,14 @@ log = "0.4" parity-bytes = "0.1" parking_lot = "0.7" rayon = "1.0" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" rlp_compress = { path = "../../util/rlp-compress" } rlp_derive = { path = "../../util/rlp-derive" } [dev-dependencies] env_logger = "0.5" ethkey = { path = "../../accounts/ethkey" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" rustc-hex = "1.0" tempdir = "0.3" kvdb-memorydb = "0.1" diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index fbf95a6acad..afa334edbb9 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -7,5 +7,5 @@ edition = "2018" [dependencies] types = { path = "../types", package = "common-types" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" bytes = { version = "0.1", package = "parity-bytes" } diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index 612025e446d..03709909c20 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -9,9 +9,9 @@ edition = "2018" [dependencies] common-types = { path = "../types" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" heapsize = "0.4" kvdb = "0.1" parking_lot = "0.7" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" rlp_derive = { path = "../../util/rlp-derive" } diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 985921d2e05..8edd7afecd7 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -6,12 +6,12 @@ authors = ["Parity Technologies "] [dependencies] bit-set = "0.4" parity-bytes = "0.1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" heapsize = "0.4" lazy_static = "1.0" log = "0.4" vm = { path = "../vm" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" parking_lot = "0.7" memory-cache = { path = "../../util/memory-cache" } diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 20dec8fdb4c..b3093f31878 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../types" } ethcore = { path = ".."} ethcore-db = { path = "../db" } ethcore-blockchain = { path = "../blockchain" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" memory-db = "0.11.0" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } @@ -25,7 +25,7 @@ heapsize = "0.4" vm = { path = "../vm" } fastmap = { path = "../../util/fastmap" } failsafe = { version = "0.3.0", default-features = false, features = ["parking_lot_mutex"] } -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" rlp_derive = { path = "../../util/rlp-derive" } smallvec = "0.6" futures = "0.1" @@ -36,7 +36,7 @@ serde = "1.0" serde_derive = "1.0" parking_lot = "0.7" stats = { path = "../../util/stats" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" keccak-hasher = { path = "../../util/keccak-hasher" } triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } kvdb = "0.1" diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index c5d8ca77055..4d0fc64fe40 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -10,12 +10,12 @@ authors = ["Parity Technologies "] ethcore = { path = ".."} ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" log = "0.4" parking_lot = "0.7" -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } lru-cache = "0.1" [dev-dependencies] diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 594e0b3edbc..17d86e3b675 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -8,20 +8,20 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../types" } derive_more = "0.14.0" -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethcore = { path = ".." } ethcore-call-contract = { path = "../call-contract" } ethcore-io = { path = "../../util/io" } ethcore-miner = { path = "../../miner" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } fetch = { path = "../../util/fetch" } futures = "0.1" heapsize = "0.4" -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" log = "0.4" parity-bytes = "0.1" parity-crypto = "0.4.0" @@ -29,7 +29,7 @@ parking_lot = "0.7" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } rand = "0.3" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" rlp_derive = { path = "../../util/rlp-derive" } rustc-hex = "1.0" serde = "1.0" diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index b12744a500f..6450502ff24 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -11,7 +11,7 @@ ethcore-blockchain = { path = "../blockchain" } ethcore-io = { path = "../../util/io" } ethcore-private-tx = { path = "../private-tx" } ethcore-sync = { path = "../sync" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" kvdb = "0.1" log = "0.4" trace-time = "0.1" diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 72df73d5c59..50f17656936 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -15,13 +15,13 @@ ethcore-io = { path = "../../util/io" } ethcore-light = { path = "../light" } ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethkey = { path = "../../accounts/ethkey" } ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } hash-db = "0.11.0" heapsize = "0.4" -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" keccak-hasher = { path = "../../util/keccak-hasher" } kvdb = "0.1" log = "0.4" @@ -29,7 +29,7 @@ macros = { path = "../../util/macros" } parity-bytes = "0.1" parking_lot = "0.7" rand = "0.6" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" trace-time = "0.1" triehash-ethereum = {version = "0.2", path = "../../util/triehash-ethereum" } futures = "0.1" diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index cd7753c7a50..c43966ff3d1 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -5,13 +5,13 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" parity-bytes = "0.1" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" rlp_derive = { path = "../../util/rlp-derive" } unexpected = { path = "../../util/unexpected" } diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 34b64a5d446..5afc2fd6b93 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -6,10 +6,10 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" parity-bytes = "0.1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" ethjson = { path = "../../json" } -rlp = { git = "https://github.com/ordian/parity-common" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" +keccak-hash = "0.2.0" diff --git a/ethcore/wasm/Cargo.toml b/ethcore/wasm/Cargo.toml index c963be2c40a..39fc30c75a1 100644 --- a/ethcore/wasm/Cargo.toml +++ b/ethcore/wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" log = "0.4" parity-wasm = "0.31" libc = "0.2" diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml index 538222a530c..5e0e46f7854 100644 --- a/ethcore/wasm/run/Cargo.toml +++ b/ethcore/wasm/run/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] serde = "1" serde_json = "1" serde_derive = "1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethjson = { path = "../../../json" } vm = { path = "../../vm" } wasm = { path = "../" } diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index 88f30e27dff..a56eaa24234 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../ethcore/types" } docopt = "1.0" env_logger = "0.5" ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethjson = { path = "../json" } evm = { path = "../ethcore/evm" } panic_hook = { path = "../util/panic-hook" } diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 47ca240b608..33238485561 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -8,10 +8,10 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } parity-bytes = "0.1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" jsonrpc-core = "10.0.1" jsonrpc-http-server = "10.0.1" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" cid = "0.3" multihash = "0.8" unicase = "2.0" diff --git a/json/Cargo.toml b/json/Cargo.toml index 1a6eded8c00..9dc56e13ad2 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" rustc-hex = "1.0" serde = "1.0" serde_json = "1.0" diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 3f66d3e0707..55fdb043154 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -17,20 +17,20 @@ url = { version = "1", optional = true } ansi_term = "0.10" common-types = { path = "../ethcore/types" } error-chain = "0.12" -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethcore-call-contract = { path = "../ethcore/call-contract" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" futures = "0.1" heapsize = "0.4" -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" linked-hash-map = "0.5" log = "0.4" parity-runtime = { path = "../util/runtime" } parking_lot = "0.7" price-info = { path = "./price-info", optional = true } -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/miner/local-store/Cargo.toml b/miner/local-store/Cargo.toml index 27e678a3f37..3d80308515d 100644 --- a/miner/local-store/Cargo.toml +++ b/miner/local-store/Cargo.toml @@ -9,7 +9,7 @@ common-types = { path = "../../ethcore/types" } ethcore-io = { path = "../../util/io" } kvdb = "0.1" log = "0.4" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/miner/stratum/Cargo.toml b/miner/stratum/Cargo.toml index cd18c6feca4..9afc9768b0d 100644 --- a/miner/stratum/Cargo.toml +++ b/miner/stratum/Cargo.toml @@ -6,8 +6,8 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" +keccak-hash = "0.2.0" jsonrpc-core = "10.0.1" jsonrpc-tcp-server = "10.0.1" log = "0.4" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 23395ceb5fe..272c545f841 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -44,7 +44,7 @@ ethcore-miner = { path = "../miner" } ethcore-network = { path = "../util/network" } ethcore-private-tx = { path = "../ethcore/private-tx" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" fastmap = { path = "../util/fastmap" } parity-bytes = "0.1" parity-crypto = "0.4.0" @@ -54,11 +54,11 @@ ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } ethstore = { path = "../accounts/ethstore" } fetch = { path = "../util/fetch" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" parity-runtime = { path = "../util/runtime" } parity-updater = { path = "../updater" } parity-version = { path = "../util/version" } -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" stats = { path = "../util/stats" } vm = { path = "../ethcore/vm" } diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index f4b62575596..23d1926ca33 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -8,18 +8,18 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" common-types = { path = "../ethcore/types" } -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethcore = { path = "../ethcore" } ethcore-accounts = { path = "../accounts", optional = true} ethcore-call-contract = { path = "../ethcore/call-contract" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethkey = { path = "../accounts/ethkey" } futures = "0.1" hyper = { version = "0.12", default-features = false } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" kvdb = "0.1" lazy_static = "1.0" log = "0.4" diff --git a/updater/Cargo.toml b/updater/Cargo.toml index b15a2094a94..c99e7644dcf 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -7,13 +7,13 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../ethcore/types" } -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" +keccak-hash = "0.2.0" lazy_static = "1.0" log = "0.4" parity-bytes = "0.1" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index 55b61479a69..1157561b7bf 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -15,14 +15,14 @@ rand = "0.6" rustc-hex = "1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" parity-runtime = { path = "../../util/runtime" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" registrar = { path = "../../util/registrar" } -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } [dev-dependencies] parking_lot = "0.7" diff --git a/util/EIP-712/Cargo.toml b/util/EIP-712/Cargo.toml index 7cd9342f04d..a8a9d956775 100644 --- a/util/EIP-712/Cargo.toml +++ b/util/EIP-712/Cargo.toml @@ -14,9 +14,9 @@ edition = "2018" serde_derive = "1.0" serde = "1.0" serde_json = "1.0" -ethabi = { git = "https://github.com/ordian/ethabi" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +keccak-hash = "0.2.0" +ethereum-types = "0.6.0-beta.1" failure = "0.1" itertools = "0.7" lazy_static = "1.1" diff --git a/util/blooms-db/Cargo.toml b/util/blooms-db/Cargo.toml index 7f0951e79ee..f4a2bb5d318 100644 --- a/util/blooms-db/Cargo.toml +++ b/util/blooms-db/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.2" -ethbloom = { git = "https://github.com/ordian/parity-common" } +ethbloom = "0.6.4" parking_lot = "0.7" tiny-keccak = "1.4" diff --git a/util/dir/Cargo.toml b/util/dir/Cargo.toml index 5d4f171f978..87d4f72b5da 100644 --- a/util/dir/Cargo.toml +++ b/util/dir/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] license = "GPL3" [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" journaldb = { path = "../journaldb" } app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } home = "0.3" diff --git a/util/fastmap/Cargo.toml b/util/fastmap/Cargo.toml index 87ff1b36b37..40a82f764f1 100644 --- a/util/fastmap/Cargo.toml +++ b/util/fastmap/Cargo.toml @@ -6,5 +6,5 @@ description = "Specialized version of `HashMap` with H256 keys and fast hashing license = "GPL-3.0" [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" plain_hasher = "0.2" diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 7c106690538..40a1528be5d 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL3" [dependencies] parity-bytes = "0.1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" hash-db = "0.11.0" heapsize = "0.4" keccak-hasher = { path = "../keccak-hasher" } @@ -16,9 +16,9 @@ log = "0.4" memory-db = "0.11.0" parking_lot = "0.7" fastmap = { path = "../../util/fastmap" } -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" [dev-dependencies] env_logger = "0.5" -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" kvdb-memorydb = "0.1" diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index c7b1a04e25a..ac0348f2a54 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -6,7 +6,7 @@ description = "Keccak-256 implementation of the Hasher trait" license = "GPL-3.0" [dependencies] -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" tiny-keccak = "1.4.2" hash-db = "0.11.0" plain_hasher = "0.2" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index e317a50055a..332108e6d8a 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -23,12 +23,12 @@ ethcore-io = { path = "../io", features = ["mio"] } parity-bytes = "0.1" parity-crypto = "0.4.0" ethcore-network = { path = "../network" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethkey = { path = "../../accounts/ethkey" } -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" parity-path = "0.1" ipnetwork = "0.12.6" -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" parity-snappy = "0.1" serde = "1.0" serde_json = "1.0" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index 2574f874bee..74b88192037 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -10,11 +10,11 @@ authors = ["Parity Technologies "] error-chain = { version = "0.12", default-features = false } parity-crypto = "0.4.0" ethcore-io = { path = "../io" } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethkey = { path = "../../accounts/ethkey" } ipnetwork = "0.12.6" lazy_static = "1.0" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" libc = "0.2" parity-snappy = "0.1" semver = {version="0.9.0", features=["serde"]} diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index 4aa2af315cc..c63bd9ca02b 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -9,12 +9,12 @@ license = "GPL-3.0" trie-db = "0.11.0" keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } hash-db = "0.11.0" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" parity-bytes = "0.1" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" elastic-array = "0.10" [dev-dependencies] memory-db = "0.11.0" -keccak-hash = { git = "https://github.com/ordian/parity-common" } +keccak-hash = "0.2.0" journaldb = { path = "../journaldb" } diff --git a/util/registrar/Cargo.toml b/util/registrar/Cargo.toml index 76e59e058ab..710cab0474d 100644 --- a/util/registrar/Cargo.toml +++ b/util/registrar/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] [dependencies] futures = "0.1" -ethabi = { git = "https://github.com/ordian/ethabi" } -ethabi-derive = { git = "https://github.com/ordian/ethabi" } -ethabi-contract = { git = "https://github.com/ordian/ethabi" } -keccak-hash = { git = "https://github.com/ordian/parity-common" } +ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +keccak-hash = "0.2.0" diff --git a/util/rlp-compress/Cargo.toml b/util/rlp-compress/Cargo.toml index 7ec83eaf2fc..0bcb092a185 100644 --- a/util/rlp-compress/Cargo.toml +++ b/util/rlp-compress/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" elastic-array = "0.10" lazy_static = "1.0" diff --git a/util/rlp-derive/Cargo.toml b/util/rlp-derive/Cargo.toml index 1d0e3db49ab..ba5fb984f30 100644 --- a/util/rlp-derive/Cargo.toml +++ b/util/rlp-derive/Cargo.toml @@ -13,4 +13,4 @@ quote = "0.6" proc-macro2 = "0.4" [dev-dependencies] -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index 6a4d2c90ba5..7f5b5893051 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -7,5 +7,5 @@ license = "GPL-3.0" [dependencies] triehash = { version = "0.4.0", default-features = false } -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" keccak-hasher = { path = "../keccak-hasher" } diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 209caec07af..238c02db7a4 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -23,7 +23,7 @@ goerli = { forkBlock = 0, critical = false } [dependencies] parity-bytes = "0.1" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" target_info = "0.1" [build-dependencies] diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index 47d387c7d3a..aa9bb906aee 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -7,7 +7,7 @@ description = "Whisper Protocol implementation for Parity" [dependencies] bitflags = "0.9" byteorder = "1.0.0" -ethereum-types = { git = "https://github.com/ordian/parity-common" } +ethereum-types = "0.6.0-beta.1" ethcore-network = { path = "../util/network" } ring = "0.14.6" ethkey = { path = "../accounts/ethkey" } @@ -18,7 +18,7 @@ ordered-float = "0.5" parking_lot = "0.7" rand = "0.6" rand_xorshift = "0.1.1" -rlp = { git = "https://github.com/ordian/parity-common" } +rlp = "0.4.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" From 86410dd2d909b33e66f1affccf883b3979632457 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 12:06:31 +0200 Subject: [PATCH 66/90] [Cargo.toml] remove unused lazy_static --- Cargo.lock | 1 - Cargo.toml | 1 - parity/lib.rs | 4 ---- 3 files changed, 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2363aa580d7..459cf859e8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2730,7 +2730,6 @@ dependencies = [ "keccak-hash 0.2.0 (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.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", diff --git a/Cargo.toml b/Cargo.toml index c282f495016..a56ba4ba8e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,7 +82,6 @@ pretty_assertions = "0.1" ipnetwork = "0.12.6" tempdir = "0.3" fake-fetch = { path = "util/fake-fetch" } -lazy_static = "1.2.0" [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] } diff --git a/parity/lib.rs b/parity/lib.rs index 9141bdcadee..7d1bf108b79 100644 --- a/parity/lib.rs +++ b/parity/lib.rs @@ -89,10 +89,6 @@ extern crate pretty_assertions; #[cfg(test)] extern crate tempdir; -#[cfg(test)] -#[macro_use] -extern crate lazy_static; - mod account; mod account_utils; mod blockchain; From 98ff9a25796d6222ad7283044db50b640af951cc Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 12:35:21 +0200 Subject: [PATCH 67/90] [*] clean up --- Cargo.lock | 162 +++++++++--------- Cargo.toml | 2 +- accounts/Cargo.toml | 2 +- accounts/ethkey/Cargo.toml | 2 +- accounts/ethkey/src/extended.rs | 3 +- accounts/ethkey/src/secret.rs | 4 +- accounts/ethkey/src/signature.rs | 1 - accounts/ethstore/Cargo.toml | 4 +- cli-signer/Cargo.toml | 2 +- cli-signer/rpc-client/Cargo.toml | 2 +- ethash/Cargo.toml | 2 +- ethash/src/lib.rs | 5 +- ethcore/Cargo.toml | 2 +- ethcore/blockchain/Cargo.toml | 2 +- ethcore/blockchain/src/blockchain.rs | 12 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 2 +- ethcore/evm/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 2 +- ethcore/light/src/cht.rs | 2 +- ethcore/light/src/net/status.rs | 8 +- ethcore/light/src/net/tests/mod.rs | 12 +- ethcore/light/src/on_demand/request.rs | 4 +- ethcore/light/src/on_demand/tests.rs | 10 +- ethcore/light/src/types/request/batch.rs | 2 +- ethcore/light/src/types/request/mod.rs | 6 +- ethcore/node-filter/Cargo.toml | 2 +- ethcore/private-tx/Cargo.toml | 2 +- ethcore/service/Cargo.toml | 2 +- ethcore/src/client/client.rs | 4 +- ethcore/src/client/evm_test_client.rs | 2 +- ethcore/src/client/test_client.rs | 2 +- ethcore/src/engines/authority_round/mod.rs | 2 +- .../engines/validator_set/safe_contract.rs | 2 +- ethcore/src/externalities.rs | 2 +- ethcore/src/json_tests/trie.rs | 2 +- ethcore/src/snapshot/service.rs | 4 +- ethcore/src/snapshot/tests/proof_of_work.rs | 4 +- ethcore/src/snapshot/tests/state.rs | 6 +- ethcore/src/trace/db.rs | 6 +- ethcore/sync/Cargo.toml | 2 +- ethcore/sync/src/private_tx.rs | 8 +- ethcore/types/Cargo.toml | 2 +- ethcore/types/src/header.rs | 2 +- ethcore/types/src/transaction/transaction.rs | 6 +- ethcore/vm/Cargo.toml | 2 +- ethcore/vm/src/tests.rs | 6 +- ethcore/wasm/Cargo.toml | 2 +- ethcore/wasm/run/Cargo.toml | 2 +- evmbin/Cargo.toml | 2 +- evmbin/src/info.rs | 2 +- ipfs/Cargo.toml | 2 +- json/Cargo.toml | 2 +- miner/Cargo.toml | 2 +- miner/stratum/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- rpc/src/v1/tests/mocked/eth.rs | 16 +- rpc/src/v1/tests/mocked/parity.rs | 2 +- rpc/src/v1/types/block.rs | 44 ++--- rpc/src/v1/types/confirmations.rs | 2 +- rpc/src/v1/types/log.rs | 2 +- secret-store/Cargo.toml | 2 +- .../signing_session_schnorr.rs | 4 +- updater/Cargo.toml | 2 +- updater/hash-fetch/Cargo.toml | 2 +- util/EIP-712/Cargo.toml | 2 +- util/dir/Cargo.toml | 2 +- util/fastmap/Cargo.toml | 2 +- util/journaldb/Cargo.toml | 2 +- util/journaldb/src/earlymergedb.rs | 1 - util/keccak-hasher/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 2 +- util/network-devp2p/src/connection.rs | 2 +- util/network-devp2p/src/discovery.rs | 4 +- util/network-devp2p/src/handshake.rs | 2 +- util/network/Cargo.toml | 2 +- util/patricia-trie-ethereum/Cargo.toml | 2 +- util/triehash-ethereum/Cargo.toml | 2 +- whisper/Cargo.toml | 2 +- 79 files changed, 224 insertions(+), 228 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 459cf859e8b..6067b8b16c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -361,7 +361,7 @@ dependencies = [ name = "cli-signer" version = "1.4.0" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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", @@ -400,7 +400,7 @@ dependencies = [ name = "common-types" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -675,7 +675,7 @@ name = "dir" version = "0.1.2" dependencies = [ "app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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", ] @@ -711,8 +711,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "eip-712" version = "0.1.0" dependencies = [ - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethereum-types 0.6.0 (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)", @@ -783,11 +783,11 @@ dependencies = [ [[package]] name = "ethabi" -version = "8.0.0-beta.1" -source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#fa5f176e424d119614b7fe43cffa314fc4999642" +version = "8.0.0" +source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#db5af6986aa2682a2367856c605d7e3766d4a266" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -797,15 +797,15 @@ dependencies = [ [[package]] name = "ethabi-contract" -version = "8.0.0-beta.1" -source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#fa5f176e424d119614b7fe43cffa314fc4999642" +version = "8.0.0" +source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#db5af6986aa2682a2367856c605d7e3766d4a266" [[package]] name = "ethabi-derive" -version = "8.0.0-beta.1" -source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#fa5f176e424d119614b7fe43cffa314fc4999642" +version = "8.0.0" +source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#db5af6986aa2682a2367856c605d7e3766d4a266" dependencies = [ - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "heck 0.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)", @@ -819,7 +819,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.2.0 (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)", @@ -855,9 +855,9 @@ dependencies = [ "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethash 1.12.0", "ethcore-accounts 0.1.0", "ethcore-blockchain 0.1.0", @@ -867,7 +867,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-stratum 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "evm 0.1.0", @@ -923,7 +923,7 @@ dependencies = [ name = "ethcore-accounts" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -943,7 +943,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -973,7 +973,7 @@ name = "ethcore-call-contract" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -982,7 +982,7 @@ name = "ethcore-db" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1020,7 +1020,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -1074,12 +1074,12 @@ dependencies = [ "common-types 0.1.0", "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 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethash 1.12.0", "ethcore-call-contract 0.1.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -1108,7 +1108,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1132,7 +1132,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -1165,14 +1165,14 @@ 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)", - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "fetch 0.1.0", @@ -1205,14 +1205,14 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -1250,7 +1250,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1263,7 +1263,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.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-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1286,7 +1286,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", "ethcore-private-tx 1.0.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fastmap 0.1.0", @@ -1312,7 +1312,7 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.6.0-beta.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ethbloom 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1327,7 +1327,7 @@ dependencies = [ name = "ethjson" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1341,7 +1341,7 @@ 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?branch=rand-0.6)", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.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)", "memzero 0.1.0", @@ -1375,7 +1375,7 @@ name = "ethstore" version = "0.2.1" dependencies = [ "dir 0.1.2", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1418,7 +1418,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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.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)", @@ -1438,7 +1438,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -1500,7 +1500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fastmap" version = "0.1.0" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1989,7 +1989,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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -2146,7 +2146,7 @@ dependencies = [ name = "keccak-hasher" version = "0.1.1" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -2498,14 +2498,14 @@ dependencies = [ name = "node-filter" version = "1.12.0" dependencies = [ - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-io 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.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.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2718,7 +2718,7 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-service 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethstore 0.2.1", "fake-fetch 0.0.1", @@ -2770,10 +2770,10 @@ dependencies = [ name = "parity-hash-fetch" version = "1.12.0" dependencies = [ - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethereum-types 0.6.0 (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)", @@ -2795,7 +2795,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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.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-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)", @@ -2864,7 +2864,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.1", @@ -2911,7 +2911,7 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -2973,12 +2973,12 @@ name = "parity-updater" version = "1.12.0" dependencies = [ "common-types 0.1.0", - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "ethcore 1.12.0", "ethcore-sync 1.12.0", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.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)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3021,7 +3021,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", @@ -3121,7 +3121,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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3315,7 +3315,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3408,7 +3408,7 @@ name = "rand_chacha" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 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)", ] @@ -3435,7 +3435,7 @@ name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3473,7 +3473,7 @@ name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3573,9 +3573,9 @@ dependencies = [ name = "registrar" version = "0.0.1" dependencies = [ - "ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4434,7 +4434,7 @@ dependencies = [ name = "triehash-ethereum" version = "0.2.0" dependencies = [ - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (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)", ] @@ -4607,7 +4607,7 @@ name = "vm" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4658,7 +4658,7 @@ 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.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.6.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.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4875,11 +4875,11 @@ dependencies = [ "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" "checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6)" = "" -"checksum ethabi 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" -"checksum ethabi-contract 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" -"checksum ethabi-derive 8.0.0-beta.1 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" +"checksum ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" +"checksum ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" +"checksum ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" "checksum ethbloom 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3932e82d64d347a045208924002930dc105a138995ccdc1479d0f05f0359f17c" -"checksum ethereum-types 0.6.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)" = "239975e7810f498bce4d3c0bee3913cfd1d040a19b6b89beca3245348ac14b5a" +"checksum ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62d1bc682337e2c5ec98930853674dd2b4bd5d0d246933a9e98e5280f7c76c5f" "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" diff --git a/Cargo.toml b/Cargo.toml index a56ba4ba8e3..28d2b4e83a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ ethcore-network = { path = "util/network" } ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-service = { path = "ethcore/service" } ethcore-sync = { path = "ethcore/sync" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index a141d4f4060..61f82815f9d 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -17,5 +17,5 @@ serde_derive = "1.0" serde_json = "1.0" [dev-dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" tempdir = "0.3" diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index 41f03da74ca..aacf9c801cf 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -9,7 +9,7 @@ edit-distance = "2.0" parity-crypto = "0.4.0" # TODO: use master branch after we switch to rand 0.6 eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", branch = "rand-0.6" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" lazy_static = "1.0" log = "0.4" memzero = { path = "../../util/memzero" } diff --git a/accounts/ethkey/src/extended.rs b/accounts/ethkey/src/extended.rs index e534d04d583..571d0d6aec1 100644 --- a/accounts/ethkey/src/extended.rs +++ b/accounts/ethkey/src/extended.rs @@ -295,8 +295,7 @@ mod derivation { // todo: surely can be optimized fn modulo(u1: U512, u2: U256) -> U256 { let m = u1 % U512::from(u2); - // TODO: remove ok() - m.try_into().ok().expect("U512 modulo U256 should fit into U256; qed") + m.try_into().expect("U512 modulo U256 should fit into U256; qed") } pub fn public(public_key: H512, chain_code: H256, derivation: Derivation) -> Result<(H512, H256), Error> where T: Label { diff --git a/accounts/ethkey/src/secret.rs b/accounts/ethkey/src/secret.rs index 56197188170..c9ab410f81a 100644 --- a/accounts/ethkey/src/secret.rs +++ b/accounts/ethkey/src/secret.rs @@ -59,14 +59,14 @@ impl Secret { if key.len() != 32 { return None } - let mut h = H256::default(); + let mut h = H256::zero(); h.as_bytes_mut().copy_from_slice(&key[0..32]); Some(Secret { inner: Memzero::from(h) }) } /// Creates zero key, which is invalid for crypto operations, but valid for math operation. pub fn zero() -> Self { - Secret { inner: Memzero::from(H256::default()) } + Secret { inner: Memzero::from(H256::zero()) } } /// Imports and validates the key. diff --git a/accounts/ethkey/src/signature.rs b/accounts/ethkey/src/signature.rs index f99d6f5e581..c4c4bfd9e63 100644 --- a/accounts/ethkey/src/signature.rs +++ b/accounts/ethkey/src/signature.rs @@ -228,7 +228,6 @@ pub fn verify_public(public: &Public, signature: &Signature, message: &Message) let pdata: [u8; 65] = { let mut temp = [4u8; 65]; - // TODO(review): verify byte order, why was it &**public before? temp[1..65].copy_from_slice(public.as_bytes()); temp }; diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index fa47b7c656d..29b6e6b54fd 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -17,7 +17,7 @@ time = "0.1.34" itertools = "0.5" parking_lot = "0.7" parity-crypto = "0.4.0" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" dir = { path = "../../util/dir" } smallvec = "0.6" parity-wordlist = "1.0" @@ -25,6 +25,6 @@ tempdir = "0.3" [dev-dependencies] matches = "0.1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" [lib] diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index 0c21041839d..522eb796f8f 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -7,7 +7,7 @@ name = "cli-signer" version = "1.4.0" [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" 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 304c444983e..6a974aa5ab1 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -7,7 +7,7 @@ name = "parity-rpc-client" version = "1.4.0" [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" futures = "0.1" log = "0.4" serde = "1.0" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index 2fe512835af..5994e338a3d 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1.0" either = "1.0.0" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" keccak-hash = "0.2.0" log = "0.4" memmap = "0.6" diff --git a/ethash/src/lib.rs b/ethash/src/lib.rs index 71a5d60ee97..59a620d122d 100644 --- a/ethash/src/lib.rs +++ b/ethash/src/lib.rs @@ -177,9 +177,8 @@ fn difficulty_to_boundary_aux>(difficulty: T) -> ethereum_types::U if difficulty == U512::one() { U256::max_value() } else { - const PROOF: &str = "difficulty > 1, so result should never overflow 256 bits; qed"; - // TODO: ok() is a hacky workaround for `primitive_types::Error` not being `std::fmt::Debug` - U256::try_from((U512::one() << 256) / difficulty).ok().expect(PROOF) + const PROOF: &str = "difficulty > 1, so result never overflows 256 bits; qed"; + U256::try_from((U512::one() << 256) / difficulty).expect(PROOF) } } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index c42da5c415c..bdcf237feb4 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -26,7 +26,7 @@ ethcore-db = { path = "./db" } ethcore-io = { path = "../util/io" } ethcore-miner = { path = "../miner" } ethcore-stratum = { path = "../miner/stratum", optional = true } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethjson = { path = "../json" } ethkey = { path = "../accounts/ethkey" } evm = { path = "evm" } diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index 9d7764a9248..17ef11a997a 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -12,7 +12,7 @@ ansi_term = "0.10" blooms-db = { path = "../../util/blooms-db" } common-types = { path = "../types" } ethcore-db = { path = "../db" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" heapsize = "0.4" itertools = "0.5" kvdb = "0.1" diff --git a/ethcore/blockchain/src/blockchain.rs b/ethcore/blockchain/src/blockchain.rs index 3605cdb8c8c..b528334cad3 100644 --- a/ethcore/blockchain/src/blockchain.rs +++ b/ethcore/blockchain/src/blockchain.rs @@ -469,7 +469,7 @@ impl<'a> Iterator for AncestryWithMetadataIter<'a> { }) }, _ => { - self.current = H256::default(); + self.current = H256::zero(); None }, } @@ -1259,7 +1259,7 @@ impl BlockChain { current: if self.is_known(&first) { first } else { - H256::default() // zero hash + H256::zero() // zero hash }, chain: self } @@ -2129,7 +2129,7 @@ mod tests { let db = new_db(); let bc = new_chain(genesis.last().encoded(), db.clone()); insert_block(&db, &bc, b1.last().encoded(), vec![Receipt { - outcome: TransactionOutcome::StateRoot(H256::default()), + outcome: TransactionOutcome::StateRoot(H256::zero()), gas_used: 10_000.into(), log_bloom: Default::default(), logs: vec![ @@ -2138,7 +2138,7 @@ mod tests { ], }, Receipt { - outcome: TransactionOutcome::StateRoot(H256::default()), + outcome: TransactionOutcome::StateRoot(H256::zero()), gas_used: 10_000.into(), log_bloom: Default::default(), logs: vec![ @@ -2147,7 +2147,7 @@ mod tests { }]); insert_block(&db, &bc, b2.last().encoded(), vec![ Receipt { - outcome: TransactionOutcome::StateRoot(H256::default()), + outcome: TransactionOutcome::StateRoot(H256::zero()), gas_used: 10_000.into(), log_bloom: Default::default(), logs: vec![ @@ -2157,7 +2157,7 @@ mod tests { ]); insert_block(&db, &bc, b3.last().encoded(), vec![ Receipt { - outcome: TransactionOutcome::StateRoot(H256::default()), + outcome: TransactionOutcome::StateRoot(H256::zero()), gas_used: 10_000.into(), log_bloom: Default::default(), logs: vec![ diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index afa334edbb9..8836d7b30ff 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -7,5 +7,5 @@ edition = "2018" [dependencies] types = { path = "../types", package = "common-types" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" bytes = { version = "0.1", package = "parity-bytes" } diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index 03709909c20..ad02e4680b8 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] common-types = { path = "../types" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" heapsize = "0.4" kvdb = "0.1" parking_lot = "0.7" diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 8edd7afecd7..4c6d679a9f6 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] bit-set = "0.4" parity-bytes = "0.1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" heapsize = "0.4" lazy_static = "1.0" log = "0.4" diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index b3093f31878..8f76651d03c 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../types" } ethcore = { path = ".."} ethcore-db = { path = "../db" } ethcore-blockchain = { path = "../blockchain" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" memory-db = "0.11.0" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } diff --git a/ethcore/light/src/cht.rs b/ethcore/light/src/cht.rs index a9bc5d7f260..8aadbfc53c1 100644 --- a/ethcore/light/src/cht.rs +++ b/ethcore/light/src/cht.rs @@ -104,7 +104,7 @@ pub fn build(cht_num: u64, mut fetcher: F) -> Option Status { protocol_version: 1, network_id: 999, head_td: 1.into(), - head_hash: H256::default(), + head_hash: H256::zero(), head_num: 1359, - genesis_hash: H256::default(), + genesis_hash: H256::zero(), last_head: None, } } @@ -138,7 +138,7 @@ fn detects_hangup() { let on_demand = Harness::create().service; let result = on_demand.request_raw( &Context::NoOp, - vec![request::HeaderByHash(H256::default().into()).into()], + vec![request::HeaderByHash(H256::zero().into()).into()], ); assert_eq!(on_demand.pending.read().len(), 1); @@ -199,7 +199,7 @@ fn no_capabilities() { let _recv = harness.service.request_raw( &Context::NoOp, - vec![request::HeaderByHash(H256::default().into()).into()] + vec![request::HeaderByHash(H256::zero().into()).into()] ).unwrap(); assert_eq!(harness.service.pending.read().len(), 1); @@ -395,7 +395,7 @@ fn wrong_kind() { let _recv = harness.service.request_raw( &Context::NoOp, - vec![request::HeaderByHash(H256::default().into()).into()] + vec![request::HeaderByHash(H256::zero().into()).into()] ).unwrap(); assert_eq!(harness.service.pending.read().len(), 1); diff --git a/ethcore/light/src/types/request/batch.rs b/ethcore/light/src/types/request/batch.rs index f9df01a4ed2..caeba2940bb 100644 --- a/ethcore/light/src/types/request/batch.rs +++ b/ethcore/light/src/types/request/batch.rs @@ -220,7 +220,7 @@ mod tests { num: 100.into(), })).unwrap(); builder.push(Request::Receipts(IncompleteReceiptsRequest { - hash: H256::default().into(), + hash: H256::zero().into(), })).unwrap(); } diff --git a/ethcore/light/src/types/request/mod.rs b/ethcore/light/src/types/request/mod.rs index cacfbcbe508..685c3ba3010 100644 --- a/ethcore/light/src/types/request/mod.rs +++ b/ethcore/light/src/types/request/mod.rs @@ -1648,7 +1648,7 @@ mod tests { #[test] fn hash_or_number_roundtrip() { - let hash = HashOrNumber::Hash(H256::default()); + let hash = HashOrNumber::Hash(H256::zero()); let number = HashOrNumber::Number(5); check_roundtrip(hash); @@ -1808,7 +1808,7 @@ mod tests { let full_req = Request::Storage(req.clone()); let res = StorageResponse { proof: vec![vec![1, 2, 3], vec![4, 5, 6]], - value: H256::default(), + value: H256::zero(), }; let full_res = Response::Storage(res.clone()); @@ -1909,7 +1909,7 @@ mod tests { code_hash: Default::default(), storage_root: Default::default() }), - Response::Storage(StorageResponse { proof: vec![], value: H256::default() }), + Response::Storage(StorageResponse { proof: vec![], value: H256::zero() }), Response::Code(CodeResponse { code: vec![1, 2, 3, 4, 5] }), Response::Execution(ExecutionResponse { items: vec![] }), ]; diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index 4d0fc64fe40..9ae04d8fcdd 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] ethcore = { path = ".."} ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" log = "0.4" parking_lot = "0.7" ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 17d86e3b675..00528277ef5 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -15,7 +15,7 @@ ethcore = { path = ".." } ethcore-call-contract = { path = "../call-contract" } ethcore-io = { path = "../../util/io" } ethcore-miner = { path = "../../miner" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } fetch = { path = "../../util/fetch" } diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index 6450502ff24..218d4f475d5 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -11,7 +11,7 @@ ethcore-blockchain = { path = "../blockchain" } ethcore-io = { path = "../../util/io" } ethcore-private-tx = { path = "../private-tx" } ethcore-sync = { path = "../sync" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" kvdb = "0.1" log = "0.4" trace-time = "0.1" diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index bedeb57ae52..2630b02fd18 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -908,12 +908,12 @@ impl Client { let hashes = self.last_hashes.read(); if hashes.front().map_or(false, |h| h == parent_hash) { let mut res = Vec::from(hashes.clone()); - res.resize(256, H256::default()); + res.resize(256, H256::zero()); return Arc::new(res); } } let mut last_hashes = LastHashes::new(); - last_hashes.resize(256, H256::default()); + last_hashes.resize(256, H256::zero()); last_hashes[0] = parent_hash.clone(); let chain = self.chain.read(); for i in 0..255 { diff --git a/ethcore/src/client/evm_test_client.rs b/ethcore/src/client/evm_test_client.rs index d6c03e65a90..1e56e8c2d99 100644 --- a/ethcore/src/client/evm_test_client.rs +++ b/ethcore/src/client/evm_test_client.rs @@ -204,7 +204,7 @@ impl<'a> EvmTestClient<'a> { author: *genesis.author(), timestamp: genesis.timestamp(), difficulty: *genesis.difficulty(), - last_hashes: Arc::new([H256::default(); 256].to_vec()), + last_hashes: Arc::new([H256::zero(); 256].to_vec()), gas_used: 0.into(), gas_limit: *genesis.gas_limit(), }; diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index bc7c1cf8f64..c9c81ecb858 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -433,7 +433,7 @@ impl ScheduleInfo for TestBlockChainClient { impl ImportSealedBlock for TestBlockChainClient { fn import_sealed_block(&self, _block: SealedBlock) -> EthcoreResult { - Ok(H256::default()) + Ok(H256::zero()) } } diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index 6e47696de4b..bbaeec91985 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -212,7 +212,7 @@ struct EpochManager { impl EpochManager { fn blank() -> Self { EpochManager { - epoch_transition_hash: H256::default(), + epoch_transition_hash: H256::zero(), epoch_transition_number: 0, finality_checker: RollingFinality::blank(Vec::new()), force: true, diff --git a/ethcore/src/engines/validator_set/safe_contract.rs b/ethcore/src/engines/validator_set/safe_contract.rs index 49d539df3f3..8e1489b9300 100644 --- a/ethcore/src/engines/validator_set/safe_contract.rs +++ b/ethcore/src/engines/validator_set/safe_contract.rs @@ -106,7 +106,7 @@ fn check_first_proof(machine: &EthereumMachine, contract_address: Address, old_h timestamp: old_header.timestamp(), last_hashes: { // this will break if we don't inclue all 256 last hashes. - let mut last_hashes: Vec<_> = (0..256).map(|_| H256::default()).collect(); + let mut last_hashes: Vec<_> = (0..256).map(|_| H256::zero()).collect(); last_hashes[255] = *old_header.parent_hash(); Arc::new(last_hashes) }, diff --git a/ethcore/src/externalities.rs b/ethcore/src/externalities.rs index 050605aaa6c..54c913c73d8 100644 --- a/ethcore/src/externalities.rs +++ b/ethcore/src/externalities.rs @@ -629,7 +629,7 @@ mod tests { let address = { let mut ext = Externalities::new(state, &setup.env_info, &setup.machine, &setup.schedule, 0, 0, &origin_info, &mut setup.sub_state, OutputPolicy::InitContract, &mut tracer, &mut vm_tracer, false); - match ext.create(&U256::max_value(), &U256::zero(), &[], CreateContractAddress::FromSenderSaltAndCodeHash(H256::default()), false) { + match ext.create(&U256::max_value(), &U256::zero(), &[], CreateContractAddress::FromSenderSaltAndCodeHash(H256::zero()), false) { Ok(ContractCreateResult::Created(address, _)) => address, _ => panic!("Test create failed; expected Created, got Failed/Reverted."), } diff --git a/ethcore/src/json_tests/trie.rs b/ethcore/src/json_tests/trie.rs index d56490ec7e8..31ca6135e9d 100644 --- a/ethcore/src/json_tests/trie.rs +++ b/ethcore/src/json_tests/trie.rs @@ -35,7 +35,7 @@ fn test_trie(json: &[u8], trie: TrieSpec, start_stop_h start_stop_hook(&name, HookType::OnStart); let mut memdb = journaldb::new_memory_db(); - let mut root = H256::default(); + let mut root = H256::zero(); let mut t = factory.create(&mut memdb, &mut root); for (key, value) in test.input.data.into_iter() { diff --git a/ethcore/src/snapshot/service.rs b/ethcore/src/snapshot/service.rs index e8b380c3e73..8120f47b81f 100644 --- a/ethcore/src/snapshot/service.rs +++ b/ethcore/src/snapshot/service.rs @@ -928,9 +928,9 @@ mod tests { version: 2, state_hashes: state_hashes.clone(), block_hashes: block_hashes.clone(), - state_root: H256::default(), + state_root: H256::zero(), block_number: 100000, - block_hash: H256::default(), + block_hash: H256::zero(), }, pruning: Algorithm::Archive, db: restoration_db_handler(db_config).open(&tempdir.path().to_owned()).unwrap(), diff --git a/ethcore/src/snapshot/tests/proof_of_work.rs b/ethcore/src/snapshot/tests/proof_of_work.rs index 0040f49674b..fb714e667f5 100644 --- a/ethcore/src/snapshot/tests/proof_of_work.rs +++ b/ethcore/src/snapshot/tests/proof_of_work.rs @@ -119,7 +119,7 @@ fn checks_flag() { let mut stream = RlpStream::new_list(5); stream.append(&100u64) - .append(&H256::default()) + .append(&H256::zero()) .append(&(!0u64)); stream.append_empty_data().append_empty_data(); @@ -137,7 +137,7 @@ fn checks_flag() { block_hashes: Vec::new(), state_root: ::hash::KECCAK_NULL_RLP, block_number: 102, - block_hash: H256::default(), + block_hash: H256::zero(), }; let mut rebuilder = SNAPSHOT_MODE.rebuilder(chain, db.clone(), &manifest).unwrap(); diff --git a/ethcore/src/snapshot/tests/state.rs b/ethcore/src/snapshot/tests/state.rs index 91042438971..bbf3bfa6271 100644 --- a/ethcore/src/snapshot/tests/state.rs +++ b/ethcore/src/snapshot/tests/state.rs @@ -68,7 +68,7 @@ fn snap_and_restore() { block_hashes: Vec::new(), state_root: state_root, block_number: 1000, - block_hash: H256::default(), + block_hash: H256::zero(), }).unwrap(); let db_path = tempdir.path().join("db"); @@ -87,7 +87,7 @@ fn snap_and_restore() { } assert_eq!(rebuilder.state_root(), state_root); - rebuilder.finalize(1000, H256::default()).unwrap(); + rebuilder.finalize(1000, H256::zero()).unwrap(); new_db }; @@ -182,7 +182,7 @@ fn checks_flag() { block_hashes: Vec::new(), state_root: state_root, block_number: 0, - block_hash: H256::default(), + block_hash: H256::zero(), }).unwrap(); let tempdir = TempDir::new("").unwrap(); diff --git a/ethcore/src/trace/db.rs b/ethcore/src/trace/db.rs index 11be83911f5..2ee521a4ad6 100644 --- a/ethcore/src/trace/db.rs +++ b/ethcore/src/trace/db.rs @@ -351,7 +351,7 @@ mod tests { impl DatabaseExtras for NoopExtras { fn block_hash(&self, block_number: BlockNumber) -> Option { if block_number == 0 { - Some(H256::default()) + Some(H256::zero()) } else { unimplemented!() } @@ -518,7 +518,7 @@ mod tests { let tx_2 = H256::from_low_u64_be(0xaf); let mut extras = Extras::default(); - extras.block_hashes.insert(0, H256::default()); + extras.block_hashes.insert(0, H256::zero()); extras.block_hashes.insert(1, block_1.clone()); extras.block_hashes.insert(2, block_2.clone()); @@ -594,7 +594,7 @@ mod tests { let block_0 = H256::from_low_u64_be(0xa1); let tx_0 = H256::from_low_u64_be(0xff); - extras.block_hashes.insert(0, H256::default()); + extras.block_hashes.insert(0, H256::zero()); extras.transaction_hashes.insert(0, vec![]); extras.block_hashes.insert(1, block_0.clone()); extras.transaction_hashes.insert(1, vec![tx_0.clone()]); diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 50f17656936..83284063934 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -15,7 +15,7 @@ ethcore-io = { path = "../../util/io" } ethcore-light = { path = "../light" } ethcore-network = { path = "../../util/network" } ethcore-network-devp2p = { path = "../../util/network-devp2p" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethkey = { path = "../../accounts/ethkey" } ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } diff --git a/ethcore/sync/src/private_tx.rs b/ethcore/sync/src/private_tx.rs index c9396af5b4b..121ad081fb1 100644 --- a/ethcore/sync/src/private_tx.rs +++ b/ethcore/sync/src/private_tx.rs @@ -33,11 +33,11 @@ pub struct NoopPrivateTxHandler; impl PrivateTxHandler for NoopPrivateTxHandler { fn import_private_transaction(&self, _rlp: &[u8]) -> Result { - Ok(H256::default()) + Ok(H256::zero()) } fn import_signed_private_transaction(&self, _rlp: &[u8]) -> Result { - Ok(H256::default()) + Ok(H256::zero()) } } @@ -53,11 +53,11 @@ pub struct SimplePrivateTxHandler { impl PrivateTxHandler for SimplePrivateTxHandler { fn import_private_transaction(&self, rlp: &[u8]) -> Result { self.txs.lock().push(rlp.to_vec()); - Ok(H256::default()) + Ok(H256::zero()) } fn import_signed_private_transaction(&self, rlp: &[u8]) -> Result { self.signed_txs.lock().push(rlp.to_vec()); - Ok(H256::default()) + Ok(H256::zero()) } } diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index c43966ff3d1..98e7c325bf6 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -5,7 +5,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethjson = { path = "../../json" } ethkey = { path = "../../accounts/ethkey" } heapsize = "0.4" diff --git a/ethcore/types/src/header.rs b/ethcore/types/src/header.rs index cfe8f5bb655..bb5b58c20ab 100644 --- a/ethcore/types/src/header.rs +++ b/ethcore/types/src/header.rs @@ -115,7 +115,7 @@ impl PartialEq for Header { impl Default for Header { fn default() -> Self { Header { - parent_hash: H256::default(), + parent_hash: H256::zero(), timestamp: 0, number: 0, author: Address::default(), diff --git a/ethcore/types/src/transaction/transaction.rs b/ethcore/types/src/transaction/transaction.rs index f2d7c52a093..87241591cd7 100644 --- a/ethcore/types/src/transaction/transaction.rs +++ b/ethcore/types/src/transaction/transaction.rs @@ -179,7 +179,7 @@ impl From for UnverifiedTransaction { r: t.r.into(), s: t.s.into(), v: t.v.into(), - hash: H256::default(), + hash: H256::zero(), }.compute_hash() } } @@ -207,7 +207,7 @@ impl Transaction { r: sig.r().into(), s: sig.s().into(), v: signature::add_chain_replay_protection(sig.v() as u64, chain_id), - hash: H256::default(), + hash: H256::zero(), }.compute_hash() } @@ -246,7 +246,7 @@ impl Transaction { r: U256::zero(), s: U256::zero(), v: chain_id, - hash: H256::default(), + hash: H256::zero(), }.compute_hash(), sender: UNSIGNED_SENDER, public: None, diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 5afc2fd6b93..cde8ed79e6e 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" parity-bytes = "0.1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" trie-db = "0.11.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } log = "0.4" diff --git a/ethcore/vm/src/tests.rs b/ethcore/vm/src/tests.rs index 42d983896a7..49af8425969 100644 --- a/ethcore/vm/src/tests.rs +++ b/ethcore/vm/src/tests.rs @@ -107,11 +107,11 @@ impl FakeExt { impl Ext for FakeExt { fn initial_storage_at(&self, _key: &H256) -> Result { - Ok(H256::default()) + Ok(H256::zero()) } fn storage_at(&self, key: &H256) -> Result { - Ok(self.store.get(key).unwrap_or(&H256::default()).clone()) + Ok(self.store.get(key).unwrap_or(&H256::zero()).clone()) } fn set_storage(&mut self, key: H256, value: H256) -> Result<()> { @@ -136,7 +136,7 @@ impl Ext for FakeExt { } fn blockhash(&mut self, number: &U256) -> H256 { - self.blockhashes.get(number).unwrap_or(&H256::default()).clone() + self.blockhashes.get(number).unwrap_or(&H256::zero()).clone() } fn create( diff --git a/ethcore/wasm/Cargo.toml b/ethcore/wasm/Cargo.toml index 39fc30c75a1..9447642c66d 100644 --- a/ethcore/wasm/Cargo.toml +++ b/ethcore/wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" log = "0.4" parity-wasm = "0.31" libc = "0.2" diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml index 5e0e46f7854..029183d671a 100644 --- a/ethcore/wasm/run/Cargo.toml +++ b/ethcore/wasm/run/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] serde = "1" serde_json = "1" serde_derive = "1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethjson = { path = "../../../json" } vm = { path = "../../vm" } wasm = { path = "../" } diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index a56eaa24234..a483a4b191a 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -13,7 +13,7 @@ common-types = { path = "../ethcore/types" } docopt = "1.0" env_logger = "0.5" ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethjson = { path = "../json" } evm = { path = "../ethcore/evm" } panic_hook = { path = "../util/panic-hook" } diff --git a/evmbin/src/info.rs b/evmbin/src/info.rs index 10616e23437..9090c5377e6 100644 --- a/evmbin/src/info.rs +++ b/evmbin/src/info.rs @@ -174,7 +174,7 @@ pub fn run<'a, F, X>( error, time: Duration::from_secs(0), traces: None, - state_root: H256::default(), + state_root: H256::zero(), end_state: None, })?; diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 33238485561..2fc02a7f67c 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } parity-bytes = "0.1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" jsonrpc-core = "10.0.1" jsonrpc-http-server = "10.0.1" rlp = "0.4.0" diff --git a/json/Cargo.toml b/json/Cargo.toml index 9dc56e13ad2..747042e8543 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" rustc-hex = "1.0" serde = "1.0" serde_json = "1.0" diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 55fdb043154..70de6611322 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -21,7 +21,7 @@ ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-eth ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethcore-call-contract = { path = "../ethcore/call-contract" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" futures = "0.1" heapsize = "0.4" keccak-hash = "0.2.0" diff --git a/miner/stratum/Cargo.toml b/miner/stratum/Cargo.toml index 9afc9768b0d..8ae35ca8c64 100644 --- a/miner/stratum/Cargo.toml +++ b/miner/stratum/Cargo.toml @@ -6,7 +6,7 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" keccak-hash = "0.2.0" jsonrpc-core = "10.0.1" jsonrpc-tcp-server = "10.0.1" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 272c545f841..3745a232ce7 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -44,7 +44,7 @@ ethcore-miner = { path = "../miner" } ethcore-network = { path = "../util/network" } ethcore-private-tx = { path = "../ethcore/private-tx" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" fastmap = { path = "../util/fastmap" } parity-bytes = "0.1" parity-crypto = "0.4.0" diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 9c34c1fc2d7..cbd89d8441c 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -201,7 +201,7 @@ fn rpc_eth_logs() { let tester = EthTester::default(); tester.client.set_logs(vec![LocalizedLogEntry { block_number: 1, - block_hash: H256::default(), + block_hash: H256::zero(), entry: LogEntry { address: Address::default(), topics: vec![], @@ -209,11 +209,11 @@ fn rpc_eth_logs() { }, transaction_index: 0, transaction_log_index: 0, - transaction_hash: H256::default(), + transaction_hash: H256::zero(), log_index: 0, }, LocalizedLogEntry { block_number: 1, - block_hash: H256::default(), + block_hash: H256::zero(), entry: LogEntry { address: Address::default(), topics: vec![], @@ -221,7 +221,7 @@ fn rpc_eth_logs() { }, transaction_index: 0, transaction_log_index: 1, - transaction_hash: H256::default(), + transaction_hash: H256::zero(), log_index: 1, }]); @@ -259,7 +259,7 @@ fn rpc_logs_filter() { // Set some logs tester.client.set_logs(vec![LocalizedLogEntry { block_number: 1, - block_hash: H256::default(), + block_hash: H256::zero(), entry: LogEntry { address: Address::default(), topics: vec![], @@ -267,11 +267,11 @@ fn rpc_logs_filter() { }, transaction_index: 0, transaction_log_index: 0, - transaction_hash: H256::default(), + transaction_hash: H256::zero(), log_index: 0, }, LocalizedLogEntry { block_number: 1, - block_hash: H256::default(), + block_hash: H256::zero(), entry: LogEntry { address: Address::default(), topics: vec![], @@ -279,7 +279,7 @@ fn rpc_logs_filter() { }, transaction_index: 0, transaction_log_index: 1, - transaction_hash: H256::default(), + transaction_hash: H256::zero(), log_index: 1, }]); diff --git a/rpc/src/v1/tests/mocked/parity.rs b/rpc/src/v1/tests/mocked/parity.rs index 78599d545a4..81ae40253d9 100644 --- a/rpc/src/v1/tests/mocked/parity.rs +++ b/rpc/src/v1/tests/mocked/parity.rs @@ -412,7 +412,7 @@ fn rpc_parity_chain_status() { let deps = Dependencies::new(); let io = deps.default_client(); - *deps.client.ancient_block.write() = Some((H256::default(), 5)); + *deps.client.ancient_block.write() = Some((H256::zero(), 5)); *deps.client.first_block.write() = Some((BigEndianHash::from_uint(&U256::from(1234)), 3333)); let request = r#"{"jsonrpc": "2.0", "method": "parity_chainStatus", "params":[], "id": 1}"#; diff --git a/rpc/src/v1/types/block.rs b/rpc/src/v1/types/block.rs index 61f4402af09..23129395b21 100644 --- a/rpc/src/v1/types/block.rs +++ b/rpc/src/v1/types/block.rs @@ -216,7 +216,7 @@ mod tests { let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"[{"hash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0","blockHash":null,"blockNumber":null,"transactionIndex":null,"from":"0x0000000000000000000000000000000000000000","to":null,"value":"0x0","gasPrice":"0x0","gas":"0x0","input":"0x","creates":null,"raw":"0x","publicKey":null,"chainId":null,"standardV":"0x0","v":"0x0","r":"0x0","s":"0x0","condition":null}]"#); - let t = BlockTransactions::Hashes(vec![H256::default().into()]); + let t = BlockTransactions::Hashes(vec![H256::zero().into()]); let serialized = serde_json::to_string(&t).unwrap(); assert_eq!(serialized, r#"["0x0000000000000000000000000000000000000000000000000000000000000000"]"#); } @@ -224,14 +224,14 @@ mod tests { #[test] fn test_serialize_block() { let block = Block { - hash: Some(H256::default()), - parent_hash: H256::default(), - uncles_hash: H256::default(), + hash: Some(H256::zero()), + parent_hash: H256::zero(), + uncles_hash: H256::zero(), author: H160::default(), miner: H160::default(), - state_root: H256::default(), - transactions_root: H256::default(), - receipts_root: H256::default(), + state_root: H256::zero(), + transactions_root: H256::zero(), + receipts_root: H256::zero(), number: Some(U256::default()), gas_used: U256::default(), gas_limit: U256::default(), @@ -249,7 +249,7 @@ mod tests { let rich_block = RichBlock { inner: block, extra_info: map![ - "mixHash".into() => format!("{:?}", H256::default()), + "mixHash".into() => format!("{:?}", H256::zero()), "nonce".into() => format!("{:?}", H64::default()) ], }; @@ -262,14 +262,14 @@ mod tests { #[test] fn none_size_null() { let block = Block { - hash: Some(H256::default()), - parent_hash: H256::default(), - uncles_hash: H256::default(), + hash: Some(H256::zero()), + parent_hash: H256::zero(), + uncles_hash: H256::zero(), author: H160::default(), miner: H160::default(), - state_root: H256::default(), - transactions_root: H256::default(), - receipts_root: H256::default(), + state_root: H256::zero(), + transactions_root: H256::zero(), + receipts_root: H256::zero(), number: Some(U256::default()), gas_used: U256::default(), gas_limit: U256::default(), @@ -287,7 +287,7 @@ mod tests { let rich_block = RichBlock { inner: block, extra_info: map![ - "mixHash".into() => format!("{:?}", H256::default()), + "mixHash".into() => format!("{:?}", H256::zero()), "nonce".into() => format!("{:?}", H64::default()) ], }; @@ -300,14 +300,14 @@ mod tests { #[test] fn test_serialize_header() { let header = Header { - hash: Some(H256::default()), - parent_hash: H256::default(), - uncles_hash: H256::default(), + hash: Some(H256::zero()), + parent_hash: H256::zero(), + uncles_hash: H256::zero(), author: H160::default(), miner: H160::default(), - state_root: H256::default(), - transactions_root: H256::default(), - receipts_root: H256::default(), + state_root: H256::zero(), + transactions_root: H256::zero(), + receipts_root: H256::zero(), number: Some(U256::default()), gas_used: U256::default(), gas_limit: U256::default(), @@ -322,7 +322,7 @@ mod tests { let rich_header = RichHeader { inner: header, extra_info: map![ - "mixHash".into() => format!("{:?}", H256::default()), + "mixHash".into() => format!("{:?}", H256::zero()), "nonce".into() => format!("{:?}", H64::default()) ], }; diff --git a/rpc/src/v1/types/confirmations.rs b/rpc/src/v1/types/confirmations.rs index 0c3418add2e..de54d0decdb 100644 --- a/rpc/src/v1/types/confirmations.rs +++ b/rpc/src/v1/types/confirmations.rs @@ -421,7 +421,7 @@ mod tests { fn should_serialize_confirmation_response_with_token() { // given let response = ConfirmationResponseWithToken { - result: ConfirmationResponse::SendTransaction(H256::default()), + result: ConfirmationResponse::SendTransaction(H256::zero()), token: "test-token".into(), }; diff --git a/rpc/src/v1/types/log.rs b/rpc/src/v1/types/log.rs index 57b2cdd5dcd..fb24d155c19 100644 --- a/rpc/src/v1/types/log.rs +++ b/rpc/src/v1/types/log.rs @@ -104,7 +104,7 @@ mod tests { data: vec![].into(), block_hash: Some(H256::from_str("ed76641c68a1c641aee09a94b3b471f4dc0316efe5ac19cf488e2674cf8d05b5").unwrap()), block_number: Some(U256::from(0x4510c)), - transaction_hash: Some(H256::default()), + transaction_hash: Some(H256::zero()), transaction_index: Some(U256::default()), transaction_log_index: Some(1.into()), log_index: Some(U256::from(1)), diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index 23d1926ca33..063e8488dca 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -15,7 +15,7 @@ ethcore = { path = "../ethcore" } ethcore-accounts = { path = "../accounts", optional = true} ethcore-call-contract = { path = "../ethcore/call-contract" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethkey = { path = "../accounts/ethkey" } futures = "0.1" hyper = { version = "0.12", default-features = false } diff --git a/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs b/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs index 9a5fcdca3ed..79c540d1a04 100644 --- a/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs +++ b/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs @@ -1023,7 +1023,7 @@ mod tests { sub_session: session.core.access_key.clone().into(), session_nonce: 0, request_id: Secret::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap().into(), - message_hash: H256::default().into(), + message_hash: H256::zero().into(), nodes: Default::default(), }), Err(Error::InvalidStateForRequest)); } @@ -1037,7 +1037,7 @@ mod tests { sub_session: session.core.access_key.clone().into(), session_nonce: 0, request_id: Secret::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap().into(), - message_hash: H256::default().into(), + message_hash: H256::zero().into(), nodes: Default::default(), }), Err(Error::InvalidMessage)); } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index c99e7644dcf..a52be1e1dab 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -12,7 +12,7 @@ ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-u ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" keccak-hash = "0.2.0" lazy_static = "1.0" log = "0.4" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index 1157561b7bf..6792de7c62c 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -15,7 +15,7 @@ rand = "0.6" rustc-hex = "1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" parity-runtime = { path = "../../util/runtime" } keccak-hash = "0.2.0" registrar = { path = "../../util/registrar" } diff --git a/util/EIP-712/Cargo.toml b/util/EIP-712/Cargo.toml index a8a9d956775..fff13d4f4ef 100644 --- a/util/EIP-712/Cargo.toml +++ b/util/EIP-712/Cargo.toml @@ -16,7 +16,7 @@ serde = "1.0" serde_json = "1.0" ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } keccak-hash = "0.2.0" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" failure = "0.1" itertools = "0.7" lazy_static = "1.1" diff --git a/util/dir/Cargo.toml b/util/dir/Cargo.toml index 87d4f72b5da..baa9d63b96d 100644 --- a/util/dir/Cargo.toml +++ b/util/dir/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] license = "GPL3" [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" journaldb = { path = "../journaldb" } app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } home = "0.3" diff --git a/util/fastmap/Cargo.toml b/util/fastmap/Cargo.toml index 40a82f764f1..5e0a882c050 100644 --- a/util/fastmap/Cargo.toml +++ b/util/fastmap/Cargo.toml @@ -6,5 +6,5 @@ description = "Specialized version of `HashMap` with H256 keys and fast hashing license = "GPL-3.0" [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" plain_hasher = "0.2" diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 40a1528be5d..eaae9404304 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL3" [dependencies] parity-bytes = "0.1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" hash-db = "0.11.0" heapsize = "0.4" keccak-hasher = { path = "../keccak-hasher" } diff --git a/util/journaldb/src/earlymergedb.rs b/util/journaldb/src/earlymergedb.rs index 19be462f6b5..563df751b8b 100644 --- a/util/journaldb/src/earlymergedb.rs +++ b/util/journaldb/src/earlymergedb.rs @@ -129,7 +129,6 @@ impl EarlyMergeDB { } fn morph_key(key: &H256, index: u8) -> Bytes { - // TODO(review): verify byte order let mut ret = key.as_bytes().to_owned(); ret.push(index); ret diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index ac0348f2a54..c33dab9aa49 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -6,7 +6,7 @@ description = "Keccak-256 implementation of the Hasher trait" license = "GPL-3.0" [dependencies] -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" tiny-keccak = "1.4.2" hash-db = "0.11.0" plain_hasher = "0.2" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index 332108e6d8a..95a39831f23 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -23,7 +23,7 @@ ethcore-io = { path = "../io", features = ["mio"] } parity-bytes = "0.1" parity-crypto = "0.4.0" ethcore-network = { path = "../network" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethkey = { path = "../../accounts/ethkey" } rlp = "0.4.0" parity-path = "0.1" diff --git a/util/network-devp2p/src/connection.rs b/util/network-devp2p/src/connection.rs index 37a1bb60416..07b14622a95 100644 --- a/util/network-devp2p/src/connection.rs +++ b/util/network-devp2p/src/connection.rs @@ -388,7 +388,7 @@ impl EncryptedConnection { } EncryptedConnection::update_mac(&mut self.ingress_mac, &mut self.mac_encoder, &header[0..16]); let mac = &header[16..]; - let mut expected = H256::default(); + let mut expected = H256::zero(); self.ingress_mac.clone().finalize(expected.as_bytes_mut()); if mac != &expected[0..16] { return Err(ErrorKind::Auth.into()); diff --git a/util/network-devp2p/src/discovery.rs b/util/network-devp2p/src/discovery.rs index 2bc859d665c..262730bfd37 100644 --- a/util/network-devp2p/src/discovery.rs +++ b/util/network-devp2p/src/discovery.rs @@ -1267,7 +1267,7 @@ mod tests { // Create a pong packet with incorrect echo hash and assert that it is rejected. let mut incorrect_pong_rlp = RlpStream::new_list(3); ep1.to_rlp_list(&mut incorrect_pong_rlp); - incorrect_pong_rlp.append(&H256::default()); + incorrect_pong_rlp.append(&H256::zero()); append_expiration(&mut incorrect_pong_rlp); let incorrect_pong_data = assemble_packet( PACKET_PONG, &incorrect_pong_rlp.drain(), &discovery2.secret @@ -1296,7 +1296,7 @@ mod tests { // Deliver an unexpected PONG message to discover1. let mut unexpected_pong_rlp = RlpStream::new_list(3); ep3.to_rlp_list(&mut unexpected_pong_rlp); - unexpected_pong_rlp.append(&H256::default()); + unexpected_pong_rlp.append(&H256::zero()); append_expiration(&mut unexpected_pong_rlp); let unexpected_pong = assemble_packet( PACKET_PONG, &unexpected_pong_rlp.drain(), key3.secret() diff --git a/util/network-devp2p/src/handshake.rs b/util/network-devp2p/src/handshake.rs index 4e44db8eaa0..e07b609b1a4 100644 --- a/util/network-devp2p/src/handshake.rs +++ b/util/network-devp2p/src/handshake.rs @@ -89,7 +89,7 @@ impl Handshake { ecdhe: Random.generate()?, nonce: *nonce, remote_ephemeral: Public::default(), - remote_nonce: H256::default(), + remote_nonce: H256::zero(), remote_version: PROTOCOL_VERSION, auth_cipher: Bytes::new(), ack_cipher: Bytes::new(), diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index 74b88192037..018152c72f0 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] error-chain = { version = "0.12", default-features = false } parity-crypto = "0.4.0" ethcore-io = { path = "../io" } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethkey = { path = "../../accounts/ethkey" } ipnetwork = "0.12.6" lazy_static = "1.0" diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index c63bd9ca02b..f6a25b876fd 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -11,7 +11,7 @@ keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } hash-db = "0.11.0" rlp = "0.4.0" parity-bytes = "0.1" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" elastic-array = "0.10" [dev-dependencies] diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index 7f5b5893051..da71831c17c 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -7,5 +7,5 @@ license = "GPL-3.0" [dependencies] triehash = { version = "0.4.0", default-features = false } -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" keccak-hasher = { path = "../keccak-hasher" } diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index aa9bb906aee..1998de55a8f 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -7,7 +7,7 @@ description = "Whisper Protocol implementation for Parity" [dependencies] bitflags = "0.9" byteorder = "1.0.0" -ethereum-types = "0.6.0-beta.1" +ethereum-types = "0.6.0" ethcore-network = { path = "../util/network" } ring = "0.14.6" ethkey = { path = "../accounts/ethkey" } From 7e236f38d5bc5b3ba4d7cb46d72e29e1ae8bebe6 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 14:07:26 +0200 Subject: [PATCH 68/90] [ethcore] fix transaction_filter_deprecated test --- ethcore/src/tx_filter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/tx_filter.rs b/ethcore/src/tx_filter.rs index 815f29faff1..2b9a7c94198 100644 --- a/ethcore/src/tx_filter.rs +++ b/ethcore/src/tx_filter.rs @@ -257,7 +257,7 @@ mod test { let filter = TransactionFilter::from_params(spec.params()).unwrap(); let mut basic_tx = Transaction::default(); - basic_tx.action = Action::Call(Address::from_str("000000000000000000000000000000000000032").unwrap()); + basic_tx.action = Action::Call(Address::from_str("0000000000000000000000000000000000000032").unwrap()); let create_tx = Transaction::default(); let mut call_tx = Transaction::default(); call_tx.action = Action::Call(Address::from_str("0000000000000000000000000000000000000005").unwrap()); From 44ce143f64543f4e945474d744ba38e2b9879e27 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 14:20:15 +0200 Subject: [PATCH 69/90] [private-tx] fix serialization tests --- ethcore/private-tx/src/log.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ethcore/private-tx/src/log.rs b/ethcore/private-tx/src/log.rs index 3663dd32917..2d2be018160 100644 --- a/ethcore/private-tx/src/log.rs +++ b/ethcore/private-tx/src/log.rs @@ -361,8 +361,8 @@ mod tests { let logger = Logging::new(Arc::new(StringLogSerializer::new("".into()))); let private_tx = Transaction::default(); let hash = private_tx.hash(None); - logger.private_tx_created(&hash, &vec![Address::from_str("0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()]); - logger.signature_added(&hash, &Address::from_str("0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()); + logger.private_tx_created(&hash, &vec![Address::from_str("82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()]); + logger.signature_added(&hash, &Address::from_str("82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()); logger.tx_deployed(&hash, &hash); let tx_log = logger.tx_log(&hash).unwrap(); assert_eq!(tx_log.status, PrivateTxStatus::Deployed); @@ -372,35 +372,35 @@ mod tests { fn serialization() { let current_timestamp = SystemTime::now(); let initial_validator_log = ValidatorLog { - account: Address::from_str("0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap(), + account: Address::from_str("82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap(), validation_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(1)).unwrap()), }; let initial_log = TransactionLog { - tx_hash: H256::from_str("0x64f648ca7ae7f4138014f860ae56164d8d5732969b1cea54d8be9d144d8aa6f6").unwrap(), + tx_hash: H256::from_str("64f648ca7ae7f4138014f860ae56164d8d5732969b1cea54d8be9d144d8aa6f6").unwrap(), status: PrivateTxStatus::Deployed, creation_timestamp: current_timestamp, validators: vec![initial_validator_log], deployment_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(2)).unwrap()), - public_tx_hash: Some(H256::from_str("0x69b9c691ede7993effbcc88911c309af1c82be67b04b3882dd446b808ae146da").unwrap()), + public_tx_hash: Some(H256::from_str("69b9c691ede7993effbcc88911c309af1c82be67b04b3882dd446b808ae146da").unwrap()), }; let serializer = Arc::new(StringLogSerializer::new(serde_json::to_string(&vec![initial_log.clone()]).unwrap())); let logger = Logging::new(serializer.clone()); - let hash = H256::from_str("0x63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6").unwrap(); - logger.private_tx_created(&hash, &vec![Address::from_str("0x7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap()]); - logger.signature_added(&hash, &Address::from_str("0x7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap()); - logger.tx_deployed(&hash, &H256::from_str("0xde2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7").unwrap()); + let hash = H256::from_str("63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6").unwrap(); + logger.private_tx_created(&hash, &vec![Address::from_str("7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap()]); + logger.signature_added(&hash, &Address::from_str("7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap()); + logger.tx_deployed(&hash, &H256::from_str("de2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7").unwrap()); drop(logger); let added_validator_log = ValidatorLog { - account: Address::from_str("0x7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap(), + account: Address::from_str("7ffbe3512782069be388f41be4d8eb350672d3a5").unwrap(), validation_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(7)).unwrap()), }; let added_log = TransactionLog { - tx_hash: H256::from_str("0x63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6").unwrap(), + tx_hash: H256::from_str("63c715e88f7291e66069302f6fcbb4f28a19ef5d7cbd1832d0c01e221c0061c6").unwrap(), status: PrivateTxStatus::Deployed, creation_timestamp: current_timestamp.checked_add(Duration::from_secs(6)).unwrap(), validators: vec![added_validator_log], deployment_timestamp: Some(current_timestamp.checked_add(Duration::from_secs(8)).unwrap()), - public_tx_hash: Some(H256::from_str("0xde2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7").unwrap()), + public_tx_hash: Some(H256::from_str("de2209a8635b9cab9eceb67928b217c70ab53f6498e5144492ec01e6f43547d7").unwrap()), }; let should_be_final = vec![added_log, initial_log]; let deserialized_logs: Vec = serde_json::from_str(&serializer.log()).unwrap(); From 87f14c9d0a25da4feebcc9b91de5ec85c0ca527f Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 14:53:35 +0200 Subject: [PATCH 70/90] fix more serialization tests --- json/src/spec/authority_round.rs | 2 +- json/src/spec/basic_authority.rs | 2 +- json/src/spec/ethash.rs | 42 +++++++++++----------- json/src/spec/genesis.rs | 12 +++---- json/src/spec/hardcoded_sync.rs | 4 +-- json/src/spec/seal.rs | 10 +++--- json/src/spec/validator_set.rs | 6 ++-- rpc/src/v1/tests/mocked/eth.rs | 2 +- rpc/src/v1/tests/mocked/parity_accounts.rs | 2 +- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/json/src/spec/authority_round.rs b/json/src/spec/authority_round.rs index fee6202d198..cc437f6b947 100644 --- a/json/src/spec/authority_round.rs +++ b/json/src/spec/authority_round.rs @@ -98,7 +98,7 @@ mod tests { assert_eq!(deserialized.params.step_duration, Uint(U256::from(0x02))); assert_eq!( deserialized.params.validators, - ValidatorSet::List(vec![Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())]), + ValidatorSet::List(vec![Address(H160::from_str("c6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())]), ); assert_eq!(deserialized.params.start_step, Some(Uint(U256::from(24)))); assert_eq!(deserialized.params.immediate_transitions, None); diff --git a/json/src/spec/basic_authority.rs b/json/src/spec/basic_authority.rs index fc552b81a99..c21333a12ce 100644 --- a/json/src/spec/basic_authority.rs +++ b/json/src/spec/basic_authority.rs @@ -62,7 +62,7 @@ mod tests { let deserialized: BasicAuthority = serde_json::from_str(s).unwrap(); assert_eq!(deserialized.params.duration_limit, Uint(U256::from(0x0d))); - let vs = ValidatorSet::List(vec![Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())]); + let vs = ValidatorSet::List(vec![Address(H160::from_str("c6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())]); assert_eq!(deserialized.params.validators, vs); } } diff --git a/json/src/spec/ethash.rs b/json/src/spec/ethash.rs index 57048e96035..c9748c94459 100644 --- a/json/src/spec/ethash.rs +++ b/json/src/spec/ethash.rs @@ -172,28 +172,28 @@ mod tests { block_reward_contract_code: None, block_reward_contract_transition: None, dao_hardfork_transition: Some(Uint(U256::from(0x08))), - dao_hardfork_beneficiary: Some(Address(H160::from_str("0xabcabcabcabcabcabcabcabcabcabcabcabcabca").unwrap())), + dao_hardfork_beneficiary: Some(Address(H160::from_str("abcabcabcabcabcabcabcabcabcabcabcabcabca").unwrap())), dao_hardfork_accounts: Some(vec![ - Address(H160::from_str("0x304a554a310c7e546dfe434669c62820b7d83490").unwrap()), - Address(H160::from_str("0x914d1b8b43e92723e64fd0a06f5bdb8dd9b10c79").unwrap()), - Address(H160::from_str("0xfe24cdd8648121a43a7c86d289be4dd2951ed49f").unwrap()), - Address(H160::from_str("0x17802f43a0137c506ba92291391a8a8f207f487d").unwrap()), - Address(H160::from_str("0xb136707642a4ea12fb4bae820f03d2562ebff487").unwrap()), - Address(H160::from_str("0xdbe9b615a3ae8709af8b93336ce9b477e4ac0940").unwrap()), - Address(H160::from_str("0xf14c14075d6c4ed84b86798af0956deef67365b5").unwrap()), - Address(H160::from_str("0xca544e5c4687d109611d0f8f928b53a25af72448").unwrap()), - Address(H160::from_str("0xaeeb8ff27288bdabc0fa5ebb731b6f409507516c").unwrap()), - Address(H160::from_str("0xcbb9d3703e651b0d496cdefb8b92c25aeb2171f7").unwrap()), - Address(H160::from_str("0xaccc230e8a6e5be9160b8cdf2864dd2a001c28b6").unwrap()), - Address(H160::from_str("0x2b3455ec7fedf16e646268bf88846bd7a2319bb2").unwrap()), - Address(H160::from_str("0x4613f3bca5c44ea06337a9e439fbc6d42e501d0a").unwrap()), - Address(H160::from_str("0xd343b217de44030afaa275f54d31a9317c7f441e").unwrap()), - Address(H160::from_str("0x84ef4b2357079cd7a7c69fd7a37cd0609a679106").unwrap()), - Address(H160::from_str("0xda2fef9e4a3230988ff17df2165440f37e8b1708").unwrap()), - Address(H160::from_str("0xf4c64518ea10f995918a454158c6b61407ea345c").unwrap()), - Address(H160::from_str("0x7602b46df5390e432ef1c307d4f2c9ff6d65cc97").unwrap()), - Address(H160::from_str("0xbb9bc244d798123fde783fcc1c72d3bb8c189413").unwrap()), - Address(H160::from_str("0x807640a13483f8ac783c557fcdf27be11ea4ac7a").unwrap()), + Address(H160::from_str("304a554a310c7e546dfe434669c62820b7d83490").unwrap()), + Address(H160::from_str("914d1b8b43e92723e64fd0a06f5bdb8dd9b10c79").unwrap()), + Address(H160::from_str("fe24cdd8648121a43a7c86d289be4dd2951ed49f").unwrap()), + Address(H160::from_str("17802f43a0137c506ba92291391a8a8f207f487d").unwrap()), + Address(H160::from_str("b136707642a4ea12fb4bae820f03d2562ebff487").unwrap()), + Address(H160::from_str("dbe9b615a3ae8709af8b93336ce9b477e4ac0940").unwrap()), + Address(H160::from_str("f14c14075d6c4ed84b86798af0956deef67365b5").unwrap()), + Address(H160::from_str("ca544e5c4687d109611d0f8f928b53a25af72448").unwrap()), + Address(H160::from_str("aeeb8ff27288bdabc0fa5ebb731b6f409507516c").unwrap()), + Address(H160::from_str("cbb9d3703e651b0d496cdefb8b92c25aeb2171f7").unwrap()), + Address(H160::from_str("accc230e8a6e5be9160b8cdf2864dd2a001c28b6").unwrap()), + Address(H160::from_str("2b3455ec7fedf16e646268bf88846bd7a2319bb2").unwrap()), + Address(H160::from_str("4613f3bca5c44ea06337a9e439fbc6d42e501d0a").unwrap()), + Address(H160::from_str("d343b217de44030afaa275f54d31a9317c7f441e").unwrap()), + Address(H160::from_str("84ef4b2357079cd7a7c69fd7a37cd0609a679106").unwrap()), + Address(H160::from_str("da2fef9e4a3230988ff17df2165440f37e8b1708").unwrap()), + Address(H160::from_str("f4c64518ea10f995918a454158c6b61407ea345c").unwrap()), + Address(H160::from_str("7602b46df5390e432ef1c307d4f2c9ff6d65cc97").unwrap()), + Address(H160::from_str("bb9bc244d798123fde783fcc1c72d3bb8c189413").unwrap()), + Address(H160::from_str("807640a13483f8ac783c557fcdf27be11ea4ac7a").unwrap()), ]), difficulty_hardfork_transition: Some(Uint(U256::from(0x59d9))), difficulty_hardfork_bound_divisor: Some(Uint(U256::from(0x0200))), diff --git a/json/src/spec/genesis.rs b/json/src/spec/genesis.rs index 424ee874aac..6c6def199af 100644 --- a/json/src/spec/genesis.rs +++ b/json/src/spec/genesis.rs @@ -82,19 +82,19 @@ mod tests { let deserialized: Genesis = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, Genesis { seal: Seal::Ethereum(Ethereum { - nonce: H64(Eth64::from_str("0x00006d6f7264656e").unwrap()), - mix_hash: H256(Eth256::from_str("0x0000000000000000000000000000000000000000000000000000000000000000").unwrap()) + nonce: H64(Eth64::from_str("00006d6f7264656e").unwrap()), + mix_hash: H256(Eth256::from_str("0000000000000000000000000000000000000000000000000000000000000000").unwrap()) }), difficulty: Uint(U256::from(0x400000000u64)), - author: Some(Address(H160::from_str("0x1000000000000000000000000000000000000001").unwrap())), + author: Some(Address(H160::from_str("1000000000000000000000000000000000000001").unwrap())), timestamp: Some(Uint(U256::from(0x07))), - parent_hash: Some(H256(Eth256::from_str("0x9000000000000000000000000000000000000000000000000000000000000000").unwrap())), + parent_hash: Some(H256(Eth256::from_str("9000000000000000000000000000000000000000000000000000000000000000").unwrap())), gas_limit: Uint(U256::from(0x1388)), transactions_root: None, receipts_root: None, - state_root: Some(H256(Eth256::from_str("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544").unwrap())), + state_root: Some(H256(Eth256::from_str("d7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544").unwrap())), gas_used: None, - extra_data: Some(Bytes::from_str("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa").unwrap()), + extra_data: Some(Bytes::from_str("11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa").unwrap()), }); } } diff --git a/json/src/spec/hardcoded_sync.rs b/json/src/spec/hardcoded_sync.rs index 68852c0290e..262d54312b7 100644 --- a/json/src/spec/hardcoded_sync.rs +++ b/json/src/spec/hardcoded_sync.rs @@ -57,8 +57,8 @@ mod tests { header: String::from("f901f9a0d405da4e66f1445d455195229624e133f5baafe72b5cf7b3c36c12c8146e98b7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a05fb2b4bfdef7b314451cb138a534d225c922fc0e5fbe25e451142732c3e25c25a088d2ec6b9860aae1a2c3b299f72b6a5d70d7f7ba4722c78f2c49ba96273c2158a007c6fdfa8eea7e86b81f5b0fc0f78f90cc19f4aa60d323151e0cac660199e9a1b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefba82524d84568e932a80a0a0349d8c3df71f1a48a9df7d03fd5f14aeee7d91332c009ecaff0a71ead405bd88ab4e252a7e8c2a23"), total_difficulty: Uint(U256::from(0x400000000u64)), chts: vec![ - H256(Eth256::from_str("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa").unwrap()), - H256(Eth256::from_str("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544").unwrap()), + H256(Eth256::from_str("11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa").unwrap()), + H256(Eth256::from_str("d7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544").unwrap()), ] }); } diff --git a/json/src/spec/seal.rs b/json/src/spec/seal.rs index 9a00ba19b08..67238a5f5c0 100644 --- a/json/src/spec/seal.rs +++ b/json/src/spec/seal.rs @@ -107,8 +107,8 @@ mod tests { // [0] assert_eq!(deserialized[0], Seal::Ethereum(Ethereum { - nonce: H64(Eth64::from_str("0x0000000000000042").unwrap()), - mix_hash: H256(Eth256::from_str("0x1000000000000000000000000000000000000000000000000000000000000001").unwrap()) + nonce: H64(Eth64::from_str("0000000000000042").unwrap()), + mix_hash: H256(Eth256::from_str("1000000000000000000000000000000000000000000000000000000000000001").unwrap()) })); // [1] @@ -119,14 +119,14 @@ mod tests { // [2] assert_eq!(deserialized[2], Seal::AuthorityRound(AuthorityRoundSeal { step: Uint(U256::from(0x0)), - signature: H520(Eth520::from_str("0x2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002").unwrap()) + signature: H520(Eth520::from_str("2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002").unwrap()) })); // [3] assert_eq!(deserialized[3], Seal::Tendermint(TendermintSeal { round: Uint(U256::from(0x3)), - proposal: H520(Eth520::from_str("0x3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003").unwrap()), - precommits: vec![H520(Eth520::from_str("0x4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004").unwrap())] + proposal: H520(Eth520::from_str("3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003").unwrap()), + precommits: vec![H520(Eth520::from_str("4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004").unwrap())] })); } } diff --git a/json/src/spec/validator_set.rs b/json/src/spec/validator_set.rs index bd3ffbba84b..4de1d3aa0b5 100644 --- a/json/src/spec/validator_set.rs +++ b/json/src/spec/validator_set.rs @@ -63,9 +63,9 @@ mod tests { let deserialized: Vec = serde_json::from_str(s).unwrap(); assert_eq!(deserialized.len(), 4); - assert_eq!(deserialized[0], ValidatorSet::List(vec![Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())])); - assert_eq!(deserialized[1], ValidatorSet::SafeContract(Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap()))); - assert_eq!(deserialized[2], ValidatorSet::Contract(Address(H160::from_str("0xc6d9d2cd449a754c494264e1809c50e34d64562b").unwrap()))); + assert_eq!(deserialized[0], ValidatorSet::List(vec![Address(H160::from_str("c6d9d2cd449a754c494264e1809c50e34d64562b").unwrap())])); + assert_eq!(deserialized[1], ValidatorSet::SafeContract(Address(H160::from_str("c6d9d2cd449a754c494264e1809c50e34d64562b").unwrap()))); + assert_eq!(deserialized[2], ValidatorSet::Contract(Address(H160::from_str("c6d9d2cd449a754c494264e1809c50e34d64562b").unwrap()))); match deserialized[3] { ValidatorSet::Multi(ref map) => { assert_eq!(map.len(), 3); diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index cbd89d8441c..687735c3417 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -355,7 +355,7 @@ fn rpc_eth_submit_hashrate() { let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; assert_eq!(tester.io.handle_request_sync(request), Some(response.to_owned())); - assert_eq!(tester.hashrates.lock().get(&H256::from_str("0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c").unwrap()).cloned().unwrap().1, + assert_eq!(tester.hashrates.lock().get(&H256::from_str("59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c").unwrap()).cloned().unwrap().1, U256::from(0x500_000)); } diff --git a/rpc/src/v1/tests/mocked/parity_accounts.rs b/rpc/src/v1/tests/mocked/parity_accounts.rs index 76b8b80887c..e50dd666c00 100644 --- a/rpc/src/v1/tests/mocked/parity_accounts.rs +++ b/rpc/src/v1/tests/mocked/parity_accounts.rs @@ -457,7 +457,7 @@ fn should_import_wallet() { assert_eq!(res, response); - let account_meta = tester.accounts.account_meta(Address::from_str("0x00bac56a8a27232baa044c03f43bf3648c961735").unwrap()).unwrap(); + let account_meta = tester.accounts.account_meta(Address::from_str("00bac56a8a27232baa044c03f43bf3648c961735").unwrap()).unwrap(); let account_uuid: String = account_meta.uuid.unwrap().into(); // the RPC should import the account with a new id From 7dc2d7cd14b1be75b6c3cd264c93d3f479a8f89d Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 15:26:54 +0200 Subject: [PATCH 71/90] [ethkey] fix smoky test --- accounts/ethkey/src/extended.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/ethkey/src/extended.rs b/accounts/ethkey/src/extended.rs index 571d0d6aec1..64039130b1c 100644 --- a/accounts/ethkey/src/extended.rs +++ b/accounts/ethkey/src/extended.rs @@ -427,7 +427,7 @@ mod tests { let keypair = ExtendedKeyPair::with_secret( Secret::from_str("a100df7a048e50ed308ea696dc600215098141cb391e9527329df289f9383f65").unwrap(), - H256::zero(), + H256::from_low_u64_be(64), ); assert_eq!( **keypair.derive(2147483648u32.into()).expect("Derivation of keypair should succeed").secret().as_raw(), From 86ee88055384d0a57598dae0e3aa7c59c0cc3f19 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 17:21:56 +0200 Subject: [PATCH 72/90] [rpc] fix tests, please? --- Cargo.lock | 1 + rpc/Cargo.toml | 1 + rpc/src/lib.rs | 3 ++ rpc/src/v1/helpers/subscribers.rs | 32 +++++++++++++++++----- rpc/src/v1/helpers/subscription_manager.rs | 2 +- rpc/src/v1/tests/mocked/eth_pubsub.rs | 28 +++++++++---------- rpc/src/v1/tests/mocked/pubsub.rs | 8 +++--- 7 files changed, 49 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6067b8b16c5..8e27de2214d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2892,6 +2892,7 @@ dependencies = [ "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.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.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)", diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 3745a232ce7..bd71c81e6a1 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -16,6 +16,7 @@ multihash = "0.8" order-stat = "0.1" parking_lot = "0.7" rand = "0.6" +rand_xorshift = "0.1.1" rustc-hex = "1.0" semver = "0.9" serde = "1.0" diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index e34aab673f2..324aea1d270 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -97,6 +97,9 @@ extern crate log; #[macro_use] extern crate serde_derive; +#[cfg(test)] +extern crate rand_xorshift; + #[cfg(test)] extern crate ethjson; #[cfg(test)] diff --git a/rpc/src/v1/helpers/subscribers.rs b/rpc/src/v1/helpers/subscribers.rs index 864b9670dd1..f9fa90ad9a7 100644 --- a/rpc/src/v1/helpers/subscribers.rs +++ b/rpc/src/v1/helpers/subscribers.rs @@ -20,7 +20,6 @@ use std::{ops, str}; use std::collections::HashMap; use jsonrpc_pubsub::{typed::{Subscriber, Sink}, SubscriptionId}; use ethereum_types::H64; -use rand::{RngCore, rngs::EntropyRng}; #[derive(Debug, Clone, Hash, Eq, PartialEq)] pub struct Id(H64); @@ -42,15 +41,36 @@ impl Id { } } +#[cfg(not(test))] +mod random { + use rand; + + pub type Rng = rand::rngs::OsRng; + + pub fn new() -> Rng { Rng::new().expect("Valid random source is required.") } +} + +#[cfg(test)] +mod random { + use rand::SeedableRng; + use rand_xorshift::XorShiftRng; + + const RNG_SEED: [u8; 16] = [0u8; 16]; + + pub type Rng = XorShiftRng; + + pub fn new() -> Rng { Rng::from_seed(RNG_SEED) } +} + pub struct Subscribers { - rand: EntropyRng, + rand: random::Rng, subscriptions: HashMap, } impl Default for Subscribers { fn default() -> Self { Subscribers { - rand: EntropyRng::new(), + rand: random::new(), subscriptions: HashMap::new(), } } @@ -61,15 +81,13 @@ impl Subscribers { #[cfg(test)] pub fn new_test() -> Self { Subscribers { - // TODO: how important is determinism here? - rand: EntropyRng::new(), + rand: random::new(), subscriptions: HashMap::new(), } } fn next_id(&mut self) -> Id { - let mut data = H64::default(); - self.rand.fill_bytes(&mut data.0); + let data = H64::random_using(&mut self.rand); Id(data) } diff --git a/rpc/src/v1/helpers/subscription_manager.rs b/rpc/src/v1/helpers/subscription_manager.rs index d83beb397f0..376c3c66a8c 100644 --- a/rpc/src/v1/helpers/subscription_manager.rs +++ b/rpc/src/v1/helpers/subscription_manager.rs @@ -165,7 +165,7 @@ mod tests { let mut el = Runtime::new().unwrap(); let mut poll_manager = poll_manager(); let (id, rx) = poll_manager.subscribe(Default::default(), "hello".into(), Params::None); - assert_eq!(id, SubscriptionId::String("0x416d77337e24399d".into())); + assert_eq!(id, SubscriptionId::String("0x43ca64edf03768e1".into())); // then poll_manager.tick().wait().unwrap(); diff --git a/rpc/src/v1/tests/mocked/eth_pubsub.rs b/rpc/src/v1/tests/mocked/eth_pubsub.rs index f2b8c8fe138..02772965a09 100644 --- a/rpc/src/v1/tests/mocked/eth_pubsub.rs +++ b/rpc/src/v1/tests/mocked/eth_pubsub.rs @@ -53,13 +53,13 @@ fn should_subscribe_to_new_heads() { // Subscribe let request = r#"{"jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newHeads"], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":"0x416d77337e24399d","id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":"0x43ca64edf03768e1","id":1}"#; assert_eq!(io.handle_request_sync(request, metadata.clone()), Some(response.to_owned())); // Check notifications handler.new_blocks(NewBlocks::new(vec![], vec![], ChainRoute::new(vec![(h1, ChainRouteType::Enacted)]), vec![], vec![], DURATION_ZERO, true)); let (res, receiver) = receiver.into_future().wait().unwrap(); - let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"author":"0x0000000000000000000000000000000000000000","difficulty":"0x1","extraData":"0x","gasLimit":"0xf4240","gasUsed":"0x0","hash":"0x3457d2fa2e3dd33c78ac681cf542e429becf718859053448748383af67e23218","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","number":"0x1","parentHash":"0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":[],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1c9","stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","timestamp":"0x0","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"},"subscription":"0x416d77337e24399d"}}"#; + let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"author":"0x0000000000000000000000000000000000000000","difficulty":"0x1","extraData":"0x","gasLimit":"0xf4240","gasUsed":"0x0","hash":"0x3457d2fa2e3dd33c78ac681cf542e429becf718859053448748383af67e23218","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","number":"0x1","parentHash":"0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":[],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1c9","stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","timestamp":"0x0","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"},"subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); // Notify about two blocks @@ -67,14 +67,14 @@ fn should_subscribe_to_new_heads() { // Receive both let (res, receiver) = receiver.into_future().wait().unwrap(); - let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"author":"0x0000000000000000000000000000000000000000","difficulty":"0x2","extraData":"0x","gasLimit":"0xf4240","gasUsed":"0x0","hash":"0x44e5ecf454ea99af9d8a8f2ca0daba96964c90de05db7a78f59b84ae9e749706","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","number":"0x2","parentHash":"0x3457d2fa2e3dd33c78ac681cf542e429becf718859053448748383af67e23218","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":[],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1c9","stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","timestamp":"0x0","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"},"subscription":"0x416d77337e24399d"}}"#; + let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"author":"0x0000000000000000000000000000000000000000","difficulty":"0x2","extraData":"0x","gasLimit":"0xf4240","gasUsed":"0x0","hash":"0x44e5ecf454ea99af9d8a8f2ca0daba96964c90de05db7a78f59b84ae9e749706","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","number":"0x2","parentHash":"0x3457d2fa2e3dd33c78ac681cf542e429becf718859053448748383af67e23218","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":[],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1c9","stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","timestamp":"0x0","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"},"subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); let (res, receiver) = receiver.into_future().wait().unwrap(); - let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"author":"0x0000000000000000000000000000000000000000","difficulty":"0x3","extraData":"0x","gasLimit":"0xf4240","gasUsed":"0x0","hash":"0xdf04a98bb0c6fa8441bd429822f65a46d0cb553f6bcef602b973e65c81497f8e","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","number":"0x3","parentHash":"0x44e5ecf454ea99af9d8a8f2ca0daba96964c90de05db7a78f59b84ae9e749706","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":[],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1c9","stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","timestamp":"0x0","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"},"subscription":"0x416d77337e24399d"}}"#; + let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"author":"0x0000000000000000000000000000000000000000","difficulty":"0x3","extraData":"0x","gasLimit":"0xf4240","gasUsed":"0x0","hash":"0xdf04a98bb0c6fa8441bd429822f65a46d0cb553f6bcef602b973e65c81497f8e","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","number":"0x3","parentHash":"0x44e5ecf454ea99af9d8a8f2ca0daba96964c90de05db7a78f59b84ae9e749706","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":[],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1c9","stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","timestamp":"0x0","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"},"subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); // And unsubscribe - let request = r#"{"jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x416d77337e24399d"], "id": 1}"#; + let request = r#"{"jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x43ca64edf03768e1"], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; assert_eq!(io.handle_request_sync(request, metadata), Some(response.to_owned())); @@ -125,7 +125,7 @@ fn should_subscribe_to_logs() { // Subscribe let request = r#"{"jsonrpc": "2.0", "method": "eth_subscribe", "params": ["logs", {}], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":"0x416d77337e24399d","id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":"0x43ca64edf03768e1","id":1}"#; assert_eq!(io.handle_request_sync(request, metadata.clone()), Some(response.to_owned())); // Check notifications (enacted) @@ -133,7 +133,7 @@ fn should_subscribe_to_logs() { let (res, receiver) = receiver.into_future().wait().unwrap(); let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"address":"0x0000000000000000000000000000000000000005","blockHash":"0x3457d2fa2e3dd33c78ac681cf542e429becf718859053448748383af67e23218","blockNumber":"0x1","data":"0x","logIndex":"0x0","removed":false,"topics":["0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000"],"transactionHash":""#.to_owned() + &format!("0x{:x}", tx_hash) - + r#"","transactionIndex":"0x0","transactionLogIndex":"0x0","type":"mined"},"subscription":"0x416d77337e24399d"}}"#; + + r#"","transactionIndex":"0x0","transactionLogIndex":"0x0","type":"mined"},"subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); // Check notifications (retracted) @@ -141,11 +141,11 @@ fn should_subscribe_to_logs() { let (res, receiver) = receiver.into_future().wait().unwrap(); let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":{"address":"0x0000000000000000000000000000000000000005","blockHash":"0x3457d2fa2e3dd33c78ac681cf542e429becf718859053448748383af67e23218","blockNumber":"0x1","data":"0x","logIndex":"0x0","removed":true,"topics":["0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000"],"transactionHash":""#.to_owned() + &format!("0x{:x}", tx_hash) - + r#"","transactionIndex":"0x0","transactionLogIndex":"0x0","type":"removed"},"subscription":"0x416d77337e24399d"}}"#; + + r#"","transactionIndex":"0x0","transactionLogIndex":"0x0","type":"removed"},"subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); // And unsubscribe - let request = r#"{"jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x416d77337e24399d"], "id": 1}"#; + let request = r#"{"jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x43ca64edf03768e1"], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; assert_eq!(io.handle_request_sync(request, metadata), Some(response.to_owned())); @@ -177,22 +177,22 @@ fn should_subscribe_to_pending_transactions() { // Subscribe let request = r#"{"jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newPendingTransactions"], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":"0x416d77337e24399d","id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":"0x43ca64edf03768e1","id":1}"#; assert_eq!(io.handle_request_sync(request, metadata.clone()), Some(response.to_owned())); // Send new transactions handler.notify_new_transactions(&[H256::from_low_u64_be(5), H256::from_low_u64_be(7)]); let (res, receiver) = receiver.into_future().wait().unwrap(); - let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":"0x0000000000000000000000000000000000000000000000000000000000000005","subscription":"0x416d77337e24399d"}}"#; + let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":"0x0000000000000000000000000000000000000000000000000000000000000005","subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); let (res, receiver) = receiver.into_future().wait().unwrap(); - let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":"0x0000000000000000000000000000000000000000000000000000000000000007","subscription":"0x416d77337e24399d"}}"#; + let response = r#"{"jsonrpc":"2.0","method":"eth_subscription","params":{"result":"0x0000000000000000000000000000000000000000000000000000000000000007","subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); // And unsubscribe - let request = r#"{"jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x416d77337e24399d"], "id": 1}"#; + let request = r#"{"jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x43ca64edf03768e1"], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; assert_eq!(io.handle_request_sync(request, metadata), Some(response.to_owned())); @@ -216,7 +216,7 @@ fn eth_subscribe_syncing() { metadata.session = Some(Arc::new(Session::new(sender))); // Subscribe - let response = r#"{"jsonrpc":"2.0","result":"0x416d77337e24399d","id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":"0x43ca64edf03768e1","id":1}"#; let request = r#"{"jsonrpc": "2.0", "method": "eth_subscribe", "params": ["syncing"], "id": 1}"#; assert_eq!(io.handle_request_sync(request, metadata.clone()), Some(response.to_owned())); } diff --git a/rpc/src/v1/tests/mocked/pubsub.rs b/rpc/src/v1/tests/mocked/pubsub.rs index c0f664d5fc1..a0fafa4ba74 100644 --- a/rpc/src/v1/tests/mocked/pubsub.rs +++ b/rpc/src/v1/tests/mocked/pubsub.rs @@ -53,22 +53,22 @@ fn should_subscribe_to_a_method() { // Subscribe let request = r#"{"jsonrpc": "2.0", "method": "parity_subscribe", "params": ["hello", []], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":"0x416d77337e24399d","id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":"0x43ca64edf03768e1","id":1}"#; assert_eq!(io.handle_request_sync(request, metadata.clone()), Some(response.to_owned())); // Check notifications let (res, receiver) = receiver.into_future().wait().unwrap(); let response = - r#"{"jsonrpc":"2.0","method":"parity_subscription","params":{"result":"hello","subscription":"0x416d77337e24399d"}}"#; + r#"{"jsonrpc":"2.0","method":"parity_subscription","params":{"result":"hello","subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); let (res, receiver) = receiver.into_future().wait().unwrap(); let response = - r#"{"jsonrpc":"2.0","method":"parity_subscription","params":{"result":"world","subscription":"0x416d77337e24399d"}}"#; + r#"{"jsonrpc":"2.0","method":"parity_subscription","params":{"result":"world","subscription":"0x43ca64edf03768e1"}}"#; assert_eq!(res, Some(response.into())); // And unsubscribe - let request = r#"{"jsonrpc": "2.0", "method": "parity_unsubscribe", "params": ["0x416d77337e24399d"], "id": 1}"#; + let request = r#"{"jsonrpc": "2.0", "method": "parity_unsubscribe", "params": ["0x43ca64edf03768e1"], "id": 1}"#; let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; assert_eq!(io.handle_request_sync(request, metadata), Some(response.to_owned())); From ae63d72e887a19113894e6c5c1262b71d137203a Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 28 May 2019 18:17:03 +0200 Subject: [PATCH 73/90] [ethcore] remove commented out code --- ethcore/types/src/account_diff.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/ethcore/types/src/account_diff.rs b/ethcore/types/src/account_diff.rs index a2362465b11..90ee73305d2 100644 --- a/ethcore/types/src/account_diff.rs +++ b/ethcore/types/src/account_diff.rs @@ -108,8 +108,6 @@ fn interpreted_hash(u: &H256) -> String { let uint = u.into_uint(); if let Ok(n) = u64::try_from(uint) { format!("{} = {:#x}", n, n) -// } else if u <= &H256::from("0xffffffffffffffffffffffffffffffffffffffff") { -// format!("@{}", Address::from(u)) } else { format!("#{}", u) } From 39a45f2429305f62c62958d4bf5f9b1a7058634e Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:31:29 +0200 Subject: [PATCH 74/90] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Tomasz Drwięga --- ethcore/src/executive.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index 4f0aaee64ab..2d96db0705d 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -859,7 +859,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> { if !schedule.keep_unsigned_nonce || !t.is_unsigned() { self.state.inc_nonce(&sender)?; } - self.state.sub_balance(&sender, &U256::try_from(gas_cost).expect("TODO: why does it fit U256?"), &mut substate.to_cleanup_mode(&schedule))?; + self.state.sub_balance(&sender, &U256::try_from(gas_cost).expect("Total cost (value + gas_cost) is lower than max allowed balance (U256); gas_cost has to fit U256; qed"), &mut substate.to_cleanup_mode(&schedule))?; let (result, output) = match t.action { Action::Create => { From 6c0189a5647b6c69f46a06ad9db3a075f2eaa964 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:35:03 +0200 Subject: [PATCH 75/90] [ethstore] remove unused dev-dependency --- accounts/ethstore/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 29b6e6b54fd..71ff4768408 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -25,6 +25,5 @@ tempdir = "0.3" [dev-dependencies] matches = "0.1" -ethereum-types = "0.6.0" [lib] From 09cb8b71efac5fc929d75c6b2795f2e7961c93b6 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:35:45 +0200 Subject: [PATCH 76/90] [ethcore] remove resolved TODO --- ethcore/src/builtin.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/ethcore/src/builtin.rs b/ethcore/src/builtin.rs index 571208e61bf..b9d79fc3d2b 100644 --- a/ethcore/src/builtin.rs +++ b/ethcore/src/builtin.rs @@ -95,7 +95,6 @@ impl Pricer for ModexpPricer { // read lengths as U256 here for accurate gas calculation. let mut read_len = || { reader.read_exact(&mut buf[..]).expect("reading from zero-extended memory cannot fail; qed"); - // TODO: check byte order U256::from_big_endian(&buf[..]) }; let base_len = read_len(); From 73e4cae711dbf7caa76da4c2e27bf3de571c7ba5 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:36:08 +0200 Subject: [PATCH 77/90] [*] resolve keccak-hash TODO --- miner/stratum/src/lib.rs | 3 +-- updater/hash-fetch/src/client.rs | 5 ++--- util/EIP-712/src/encode.rs | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/miner/stratum/src/lib.rs b/miner/stratum/src/lib.rs index 465d71e71eb..5ee0296dacf 100644 --- a/miner/stratum/src/lib.rs +++ b/miner/stratum/src/lib.rs @@ -163,8 +163,7 @@ impl StratumImpl { params.parse::<(String, String)>().map(|(worker_id, secret)|{ if let Some(valid_secret) = self.secret { let hash = keccak(secret); - // TODO: update keccak-hash dep - if hash.0 != valid_secret.0 { + if hash != valid_secret { return to_value(&false); } } diff --git a/updater/hash-fetch/src/client.rs b/updater/hash-fetch/src/client.rs index 4b8c781e0dc..a3ebdce2688 100644 --- a/updater/hash-fetch/src/client.rs +++ b/updater/hash-fetch/src/client.rs @@ -99,9 +99,8 @@ fn validate_hash(path: PathBuf, hash: H256, body: fetch::BodyReader) -> Result

Result Result { - // TODO: update keccak-hash dep - Ok(H256(keccak(encode_type(message_type, typed_data)?).0)) + Ok(keccak(encode_type(message_type, typed_data)?)) } fn encode_data( From 7ed62daf840fc48a7f3ba74030aaf3fc708f9f21 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:37:53 +0200 Subject: [PATCH 78/90] [*] s/Address::default()/Address::zero() --- accounts/ethkey/src/keypair.rs | 2 +- ethcore/light/src/net/tests/mod.rs | 4 ++-- ethcore/light/src/transaction_queue.rs | 16 ++++++++-------- ethcore/private-tx/src/key_server_keys.rs | 2 +- ethcore/src/client/client.rs | 2 +- ethcore/src/engines/instant_seal.rs | 2 +- .../src/engines/validator_set/safe_contract.rs | 4 ++-- ethcore/src/snapshot/account.rs | 2 +- ethcore/src/spec/spec.rs | 4 ++-- ethcore/src/test_helpers.rs | 2 +- ethcore/src/tests/client.rs | 14 +++++++------- ethcore/src/trace/executive_tracer.rs | 2 +- ethcore/sync/src/tests/consensus.rs | 2 +- ethcore/types/src/header.rs | 2 +- ethcore/vm/src/action_params.rs | 10 +++++----- ethcore/vm/src/env_info.rs | 2 +- evmbin/src/main.rs | 6 +++--- parity/helpers.rs | 2 +- rpc/src/v1/tests/mocked/eth.rs | 8 ++++---- rpc/src/v1/tests/mocked/parity.rs | 2 +- rpc/src/v1/tests/mocked/parity_accounts.rs | 2 +- rpc/src/v1/tests/mocked/signer.rs | 2 +- .../client_sessions/signing_session_schnorr.rs | 2 +- secret-store/src/key_storage.rs | 4 ++-- updater/hash-fetch/src/urlhint.rs | 4 ++-- 25 files changed, 52 insertions(+), 52 deletions(-) diff --git a/accounts/ethkey/src/keypair.rs b/accounts/ethkey/src/keypair.rs index 714e6c85da4..7b350788bb5 100644 --- a/accounts/ethkey/src/keypair.rs +++ b/accounts/ethkey/src/keypair.rs @@ -21,7 +21,7 @@ use parity_crypto::Keccak256 as _; pub fn public_to_address(public: &Public) -> Address { let hash = public.keccak256(); - let mut result = Address::default(); + let mut result = Address::zero(); result.as_bytes_mut().copy_from_slice(&hash[12..]); result } diff --git a/ethcore/light/src/net/tests/mod.rs b/ethcore/light/src/net/tests/mod.rs index d5619bdab2a..70d6bbbd40b 100644 --- a/ethcore/light/src/net/tests/mod.rs +++ b/ethcore/light/src/net/tests/mod.rs @@ -617,8 +617,8 @@ fn proof_of_execution() { let req_id = 112; let mut request = Request::Execution(request::IncompleteExecutionRequest { block_hash: H256::zero().into(), - from: Address::default(), - action: Action::Call(Address::default()), + from: Address::zero(), + action: Action::Call(Address::zero()), gas: 100.into(), gas_price: 0.into(), value: 0.into(), diff --git a/ethcore/light/src/transaction_queue.rs b/ethcore/light/src/transaction_queue.rs index f996a4847a9..2040eabe299 100644 --- a/ethcore/light/src/transaction_queue.rs +++ b/ethcore/light/src/transaction_queue.rs @@ -395,7 +395,7 @@ mod tests { #[test] fn queued_senders() { - let sender = Address::default(); + let sender = Address::zero(); let mut txq = TransactionQueue::default(); let tx = Transaction::default().fake_sign(sender); @@ -411,7 +411,7 @@ mod tests { #[test] fn next_nonce() { - let sender = Address::default(); + let sender = Address::zero(); let mut txq = TransactionQueue::default(); for i in (0..5).chain(10..15) { @@ -442,7 +442,7 @@ mod tests { #[test] fn current_to_future() { - let sender = Address::default(); + let sender = Address::zero(); let mut txq = TransactionQueue::default(); for i in 5..10 { @@ -485,7 +485,7 @@ mod tests { #[test] fn conditional() { let mut txq = TransactionQueue::default(); - let sender = Address::default(); + let sender = Address::zero(); for i in 0..5 { let mut tx = Transaction::default(); @@ -507,7 +507,7 @@ mod tests { #[test] fn cull_from_future() { - let sender = Address::default(); + let sender = Address::zero(); let mut txq = TransactionQueue::default(); for i in (0..1).chain(3..10) { @@ -527,7 +527,7 @@ mod tests { #[test] fn import_old() { - let sender = Address::default(); + let sender = Address::zero(); let mut txq = TransactionQueue::default(); let mut tx_a = Transaction::default(); @@ -544,7 +544,7 @@ mod tests { #[test] fn replace_is_removed() { - let sender = Address::default(); + let sender = Address::zero(); let mut txq = TransactionQueue::default(); let tx_b: PendingTransaction = Transaction::default().fake_sign(sender).into(); @@ -564,7 +564,7 @@ mod tests { #[test] fn future_transactions() { - let sender = Address::default(); + let sender = Address::zero(); let mut txq = TransactionQueue::default(); for i in (0..1).chain(3..10) { diff --git a/ethcore/private-tx/src/key_server_keys.rs b/ethcore/private-tx/src/key_server_keys.rs index 0a5204f9450..50bdb6662f2 100644 --- a/ethcore/private-tx/src/key_server_keys.rs +++ b/ethcore/private-tx/src/key_server_keys.rs @@ -118,7 +118,7 @@ impl Default for StoringKeyProvider { fn default() -> Self { StoringKeyProvider { available_keys: RwLock::new(None), - key_server_account: Some(Address::default()), + key_server_account: Some(Address::zero()), } } } diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 2630b02fd18..d22cff0942d 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -1223,7 +1223,7 @@ impl Client { // transaction for calling contracts from services like engine. // from the null sender, with 50M gas. fn contract_call_tx(&self, block_id: BlockId, address: Address, data: Bytes) -> SignedTransaction { - let from = Address::default(); + let from = Address::zero(); transaction::Transaction { nonce: self.nonce(&from, block_id).unwrap_or_else(|| self.engine.account_start_nonce(0)), action: Action::Call(address), diff --git a/ethcore/src/engines/instant_seal.rs b/ethcore/src/engines/instant_seal.rs index 71ef193c6cb..2daa0aa55ba 100644 --- a/ethcore/src/engines/instant_seal.rs +++ b/ethcore/src/engines/instant_seal.rs @@ -108,7 +108,7 @@ mod tests { let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap(); let genesis_header = spec.genesis_header(); let last_hashes = Arc::new(vec![genesis_header.hash()]); - let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::default(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap(); + let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap(); let b = b.close_and_lock().unwrap(); if let Seal::Regular(seal) = engine.generate_seal(&b, &genesis_header) { assert!(b.try_seal(engine, seal).is_ok()); diff --git a/ethcore/src/engines/validator_set/safe_contract.rs b/ethcore/src/engines/validator_set/safe_contract.rs index 8e1489b9300..c210bcc00d6 100644 --- a/ethcore/src/engines/validator_set/safe_contract.rs +++ b/ethcore/src/engines/validator_set/safe_contract.rs @@ -117,7 +117,7 @@ fn check_first_proof(machine: &EthereumMachine, contract_address: Address, old_h let number = old_header.number(); let (data, decoder) = validator_set::functions::get_validators::call(); - let from = Address::default(); + let from = Address::zero(); let tx = Transaction { nonce: machine.account_start_nonce(number), action: Action::Call(contract_address), @@ -516,7 +516,7 @@ mod tests { nonce: 2.into(), gas_price: 0.into(), gas: 21000.into(), - action: Action::Call(Address::default()), + action: Action::Call(Address::zero()), value: 0.into(), data: Vec::new(), }.sign(&s0, Some(chain_id)); diff --git a/ethcore/src/snapshot/account.rs b/ethcore/src/snapshot/account.rs index ed56e2435b8..d18ecacbc3b 100644 --- a/ethcore/src/snapshot/account.rs +++ b/ethcore/src/snapshot/account.rs @@ -350,6 +350,6 @@ mod tests { #[test] fn encoding_empty_acc() { let mut db = get_temp_state_db(); - assert_eq!(from_fat_rlp(&mut AccountDBMut::new(db.as_hash_db_mut(), &Address::default()), Rlp::new(&::rlp::NULL_RLP), H256::zero()).unwrap(), (ACC_EMPTY, None)); + assert_eq!(from_fat_rlp(&mut AccountDBMut::new(db.as_hash_db_mut(), &Address::zero()), Rlp::new(&::rlp::NULL_RLP), H256::zero()).unwrap(), (ACC_EMPTY, None)); } } diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index e8a7584b3a8..fd00dd56f08 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -658,7 +658,7 @@ impl Spec { gas_limit: U256::max_value(), }; - let from = Address::default(); + let from = Address::zero(); for &(ref address, ref constructor) in self.constructors.iter() { trace!(target: "spec", "run_constructors: Creating a contract at {}.", address); trace!(target: "spec", " .. root before = {}", state.root()); @@ -872,7 +872,7 @@ impl Spec { gas_used: 0.into(), }; - let from = Address::default(); + let from = Address::zero(); let tx = Transaction { nonce: self.engine.account_start_nonce(0), action: Action::Call(a), diff --git a/ethcore/src/test_helpers.rs b/ethcore/src/test_helpers.rs index 2112e58160b..e59a41d34b4 100644 --- a/ethcore/src/test_helpers.rs +++ b/ethcore/src/test_helpers.rs @@ -223,7 +223,7 @@ pub fn push_block_with_transactions(client: &Arc, transactions: &[Signed let test_engine = &*test_spec.engine; let block_number = client.chain_info().best_block_number as u64 + 1; - let mut b = client.prepare_open_block(Address::default(), (0.into(), 5000000.into()), Bytes::new()).unwrap(); + let mut b = client.prepare_open_block(Address::zero(), (0.into(), 5000000.into()), Bytes::new()).unwrap(); b.set_timestamp(block_number * 10); for t in transactions { diff --git a/ethcore/src/tests/client.rs b/ethcore/src/tests/client.rs index 9086d07e08a..6edd16dba9c 100644 --- a/ethcore/src/tests/client.rs +++ b/ethcore/src/tests/client.rs @@ -251,7 +251,7 @@ fn can_mine() { let dummy_blocks = get_good_dummy_block_seq(2); let client = get_test_client_with_blocks(vec![dummy_blocks[0].clone()]); - let b = client.prepare_open_block(Address::default(), (3141562.into(), 31415620.into()), vec![]).unwrap().close().unwrap(); + let b = client.prepare_open_block(Address::zero(), (3141562.into(), 31415620.into()), vec![]).unwrap().close().unwrap(); assert_eq!(*b.header.parent_hash(), view!(BlockView, &dummy_blocks[0]).header_view().hash()); } @@ -274,7 +274,7 @@ fn change_history_size() { ).unwrap(); for _ in 0..20 { - let mut b = client.prepare_open_block(Address::default(), (3141562.into(), 31415620.into()), vec![]).unwrap(); + let mut b = client.prepare_open_block(Address::zero(), (3141562.into(), 31415620.into()), vec![]).unwrap(); b.block_mut().state_mut().add_balance(&address, &5.into(), CleanupMode::NoEmpty).unwrap(); b.block_mut().state_mut().commit().unwrap(); let b = b.close_and_lock().unwrap().seal(&*test_spec.engine, vec![]).unwrap(); @@ -301,7 +301,7 @@ fn does_not_propagate_delayed_transactions() { nonce: 0.into(), gas_price: 0.into(), gas: 21000.into(), - action: Action::Call(Address::default()), + action: Action::Call(Address::zero()), value: 0.into(), data: Vec::new(), }.sign(secret, None), Some(Condition::Number(2))); @@ -309,7 +309,7 @@ fn does_not_propagate_delayed_transactions() { nonce: 1.into(), gas_price: 0.into(), gas: 21000.into(), - action: Action::Call(Address::default()), + action: Action::Call(Address::zero()), value: 0.into(), data: Vec::new(), }.sign(secret, None), None); @@ -333,7 +333,7 @@ fn transaction_proof() { let address = Address::random(); let test_spec = Spec::new_test(); for _ in 0..20 { - let mut b = client.prepare_open_block(Address::default(), (3141562.into(), 31415620.into()), vec![]).unwrap(); + let mut b = client.prepare_open_block(Address::zero(), (3141562.into(), 31415620.into()), vec![]).unwrap(); b.block_mut().state_mut().add_balance(&address, &5.into(), CleanupMode::NoEmpty).unwrap(); b.block_mut().state_mut().commit().unwrap(); let b = b.close_and_lock().unwrap().seal(&*test_spec.engine, vec![]).unwrap(); @@ -344,7 +344,7 @@ fn transaction_proof() { nonce: 0.into(), gas_price: 0.into(), gas: 21000.into(), - action: Action::Call(Address::default()), + action: Action::Call(Address::zero()), value: 5.into(), data: Vec::new(), }.fake_sign(address); @@ -363,7 +363,7 @@ fn transaction_proof() { Executive::new(&mut state, &env_info, &machine, &schedule) .transact(&transaction, TransactOptions::with_no_tracing().dont_check_nonce()).unwrap(); - assert_eq!(state.balance(&Address::default()).unwrap(), 5.into()); + assert_eq!(state.balance(&Address::zero()).unwrap(), 5.into()); assert_eq!(state.balance(&address).unwrap(), 95.into()); } diff --git a/ethcore/src/trace/executive_tracer.rs b/ethcore/src/trace/executive_tracer.rs index 015deaea038..fdd9428b5d2 100644 --- a/ethcore/src/trace/executive_tracer.rs +++ b/ethcore/src/trace/executive_tracer.rs @@ -75,7 +75,7 @@ impl Tracer for ExecutiveTracer { result: Res::Create(CreateResult { gas_used: U256::zero(), code: Vec::new(), - address: Address::default(), + address: Address::zero(), }), }; self.vecindex_stack.push(self.traces.len()); diff --git a/ethcore/sync/src/tests/consensus.rs b/ethcore/sync/src/tests/consensus.rs index 1dc6904ba8f..ca6d4102af3 100644 --- a/ethcore/sync/src/tests/consensus.rs +++ b/ethcore/sync/src/tests/consensus.rs @@ -32,7 +32,7 @@ fn new_tx(secret: &Secret, nonce: U256, chain_id: u64) -> PendingTransaction { nonce: nonce.into(), gas_price: 0.into(), gas: 21000.into(), - action: Action::Call(Address::default()), + action: Action::Call(Address::zero()), value: 0.into(), data: Vec::new(), }.sign(secret, Some(chain_id)); diff --git a/ethcore/types/src/header.rs b/ethcore/types/src/header.rs index bb5b58c20ab..408253bc5f8 100644 --- a/ethcore/types/src/header.rs +++ b/ethcore/types/src/header.rs @@ -118,7 +118,7 @@ impl Default for Header { parent_hash: H256::zero(), timestamp: 0, number: 0, - author: Address::default(), + author: Address::zero(), transactions_root: KECCAK_NULL_RLP, uncles_hash: KECCAK_EMPTY_LIST_RLP, diff --git a/ethcore/vm/src/action_params.rs b/ethcore/vm/src/action_params.rs index 6970147323d..3b974310cd8 100644 --- a/ethcore/vm/src/action_params.rs +++ b/ethcore/vm/src/action_params.rs @@ -96,11 +96,11 @@ impl Default for ActionParams { /// Returns default ActionParams initialized with zeros fn default() -> ActionParams { ActionParams { - code_address: Address::default(), + code_address: Address::zero(), code_hash: Some(KECCAK_EMPTY), - address: Address::default(), - sender: Address::default(), - origin: Address::default(), + address: Address::zero(), + sender: Address::zero(), + origin: Address::zero(), gas: U256::zero(), gas_price: U256::zero(), value: ActionValue::Transfer(U256::zero()), @@ -116,7 +116,7 @@ impl From for ActionParams { fn from(t: ethjson::vm::Transaction) -> Self { let address: Address = t.address.into(); ActionParams { - code_address: Address::default(), + code_address: Address::zero(), code_hash: Some(keccak(&*t.code)), address: address, sender: t.sender.into(), diff --git a/ethcore/vm/src/env_info.rs b/ethcore/vm/src/env_info.rs index e5bd3f64e34..6c602d80fe6 100644 --- a/ethcore/vm/src/env_info.rs +++ b/ethcore/vm/src/env_info.rs @@ -51,7 +51,7 @@ impl Default for EnvInfo { fn default() -> Self { EnvInfo { number: 0, - author: Address::default(), + author: Address::zero(), timestamp: 0, difficulty: 0.into(), gas_limit: 0.into(), diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index d54b75c6cea..ee75f9174d1 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -238,7 +238,7 @@ fn run_call(args: Args, informant: T) { let gas_price = arg(args.gas_price(), "--gas-price"); let data = arg(args.data(), "--input"); - if code.is_none() && to == Address::default() { + if code.is_none() && to == Address::zero() { die("Either --code or --to is required."); } @@ -305,14 +305,14 @@ impl Args { pub fn from(&self) -> Result { match self.flag_from { Some(ref from) => from.parse().map_err(to_string), - None => Ok(Address::default()), + None => Ok(Address::zero()), } } pub fn to(&self) -> Result { match self.flag_to { Some(ref to) => to.parse().map_err(to_string), - None => Ok(Address::default()), + None => Ok(Address::zero()), } } diff --git a/parity/helpers.rs b/parity/helpers.rs index aa2187fb60b..2f0046f228d 100644 --- a/parity/helpers.rs +++ b/parity/helpers.rs @@ -126,7 +126,7 @@ pub fn to_queue_penalization(time: Option) -> Result pub fn to_address(s: Option) -> Result { match s { Some(ref a) => clean_0x(a).parse().map_err(|_| format!("Invalid address: {:?}", a)), - None => Ok(Address::default()) + None => Ok(Address::zero()) } } diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 687735c3417..e9af200f7ed 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -203,7 +203,7 @@ fn rpc_eth_logs() { block_number: 1, block_hash: H256::zero(), entry: LogEntry { - address: Address::default(), + address: Address::zero(), topics: vec![], data: vec![1,2,3], }, @@ -215,7 +215,7 @@ fn rpc_eth_logs() { block_number: 1, block_hash: H256::zero(), entry: LogEntry { - address: Address::default(), + address: Address::zero(), topics: vec![], data: vec![1,2,3], }, @@ -261,7 +261,7 @@ fn rpc_logs_filter() { block_number: 1, block_hash: H256::zero(), entry: LogEntry { - address: Address::default(), + address: Address::zero(), topics: vec![], data: vec![1,2,3], }, @@ -273,7 +273,7 @@ fn rpc_logs_filter() { block_number: 1, block_hash: H256::zero(), entry: LogEntry { - address: Address::default(), + address: Address::zero(), topics: vec![], data: vec![1,2,3], }, diff --git a/rpc/src/v1/tests/mocked/parity.rs b/rpc/src/v1/tests/mocked/parity.rs index 81ae40253d9..913e181e400 100644 --- a/rpc/src/v1/tests/mocked/parity.rs +++ b/rpc/src/v1/tests/mocked/parity.rs @@ -353,7 +353,7 @@ fn rpc_parity_ws_address() { #[test] fn rpc_parity_next_nonce() { let deps = Dependencies::new(); - let address = Address::default(); + let address = Address::zero(); let io1 = deps.default_client(); let deps = Dependencies::new(); deps.miner.increment_nonce(&address); diff --git a/rpc/src/v1/tests/mocked/parity_accounts.rs b/rpc/src/v1/tests/mocked/parity_accounts.rs index e50dd666c00..5d1e191d767 100644 --- a/rpc/src/v1/tests/mocked/parity_accounts.rs +++ b/rpc/src/v1/tests/mocked/parity_accounts.rs @@ -90,7 +90,7 @@ fn rpc_parity_default_account() { let io = tester.io; // Check empty - let address = Address::default(); + let address = Address::zero(); let request = r#"{"jsonrpc": "2.0", "method": "parity_defaultAccount", "params": [], "id": 1}"#; let response = format!("{{\"jsonrpc\":\"2.0\",\"result\":\"0x{:x}\",\"id\":1}}", address); assert_eq!(io.handle_request_sync(request), Some(response)); diff --git a/rpc/src/v1/tests/mocked/signer.rs b/rpc/src/v1/tests/mocked/signer.rs index 78b875d4113..4000f16e575 100644 --- a/rpc/src/v1/tests/mocked/signer.rs +++ b/rpc/src/v1/tests/mocked/signer.rs @@ -377,7 +377,7 @@ fn should_return_error_when_sender_does_not_match() { let address = tester.accounts.new_account(&"test".into()).unwrap(); let recipient = Address::from_str("d46e8dd67c5d32be8058bb8eb970870f07244567").unwrap(); let _confirmation_future = tester.signer.add_request(ConfirmationPayload::SendTransaction(FilledTransactionRequest { - from: Address::default(), + from: Address::zero(), used_default_from: false, to: Some(recipient), gas_price: U256::from(10_000), diff --git a/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs b/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs index 79c540d1a04..b0881dfff07 100644 --- a/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs +++ b/secret-store/src/key_server_cluster/client_sessions/signing_session_schnorr.rs @@ -1005,7 +1005,7 @@ mod tests { session: SessionId::default().into(), session_nonce: 0, origin: None, - author: Address::default().into(), + author: Address::zero().into(), nodes: BTreeMap::new(), is_zero: false, threshold: 1, diff --git a/secret-store/src/key_storage.rs b/secret-store/src/key_storage.rs index b5f2b1f4fe8..183235d1c13 100644 --- a/secret-store/src/key_storage.rs +++ b/secret-store/src/key_storage.rs @@ -193,7 +193,7 @@ fn upgrade_db(db: Arc) -> Result, Error> { let current_key = CurrentSerializableDocumentKeyShare { // author is used in separate generation + encrypt sessions. // in v0 there have been only simultaneous GenEnc sessions. - author: Address::default().into(), // added in v1 + author: Address::zero().into(), // added in v1 threshold: v0_key.threshold, public: Public::default().into(), // addded in v2 common_point: Some(v0_key.common_point), @@ -545,7 +545,7 @@ pub mod tests { // check upgrade assert_eq!(db.get(None, DB_META_KEY_VERSION).unwrap().unwrap()[0], CURRENT_VERSION); let key = serde_json::from_slice::(&db.get(None, &[7]).unwrap().map(|key| key.to_vec()).unwrap()).unwrap(); - assert_eq!(Address::default(), key.author.clone().into()); + assert_eq!(Address::zero(), key.author.clone().into()); assert_eq!(777, key.threshold); assert_eq!(Some("99e82b163b062d55a64085bacfd407bb55f194ba5fb7a1af9c34b84435455520f1372e0e650a4f91aed0058cb823f62146ccb5599c8d13372c300dea866b69fc".parse::().unwrap()), key.common_point.clone().map(Into::into)); assert_eq!(Some("7e05df9dd077ec21ed4bc45c9fe9e0a43d65fa4be540630de615ced5e95cf5c3003035eb713317237d7667feeeb64335525158f5f7411f67aca9645169ea554c".parse::().unwrap()), key.encrypted_point.clone().map(Into::into)); diff --git a/updater/hash-fetch/src/urlhint.rs b/updater/hash-fetch/src/urlhint.rs index 6ac78d193cd..59829d1daf3 100644 --- a/updater/hash-fetch/src/urlhint.rs +++ b/updater/hash-fetch/src/urlhint.rs @@ -126,7 +126,7 @@ fn get_urlhint_content(account_slash_repo: String, owner: Address) -> Content { fn decode_urlhint_output(output: (String, [u8; 20], Address)) -> Option { let (account_slash_repo, commit, owner) = output; - if owner == Address::default() { + if owner == Address::zero() { return None; } @@ -336,7 +336,7 @@ pub mod tests { account: "test".into(), repo: "xyz".into(), commit: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - owner: Address::default(), + owner: Address::zero(), }; // when From a9cca6ea529bee6f900b28e325c93f041d6f1b6e Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:40:12 +0200 Subject: [PATCH 79/90] [rpc] remove Subscribers::new_test --- rpc/src/v1/helpers/subscribers.rs | 9 --------- rpc/src/v1/helpers/subscription_manager.rs | 2 +- rpc/src/v1/impls/eth_pubsub.rs | 8 ++++---- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/rpc/src/v1/helpers/subscribers.rs b/rpc/src/v1/helpers/subscribers.rs index f9fa90ad9a7..157abb58d10 100644 --- a/rpc/src/v1/helpers/subscribers.rs +++ b/rpc/src/v1/helpers/subscribers.rs @@ -77,15 +77,6 @@ impl Default for Subscribers { } impl Subscribers { - /// Create a new Subscribers with given random source. - #[cfg(test)] - pub fn new_test() -> Self { - Subscribers { - rand: random::new(), - subscriptions: HashMap::new(), - } - } - fn next_id(&mut self) -> Id { let data = H64::random_using(&mut self.rand); Id(data) diff --git a/rpc/src/v1/helpers/subscription_manager.rs b/rpc/src/v1/helpers/subscription_manager.rs index 376c3c66a8c..8323060b781 100644 --- a/rpc/src/v1/helpers/subscription_manager.rs +++ b/rpc/src/v1/helpers/subscription_manager.rs @@ -60,7 +60,7 @@ impl> GenericPollManager { #[cfg(test)] pub fn new_test(rpc: MetaIoHandler) -> Self { let mut manager = Self::new(rpc); - manager.subscribers = Subscribers::new_test(); + manager.subscribers = Subscribers::default(); manager } diff --git a/rpc/src/v1/impls/eth_pubsub.rs b/rpc/src/v1/impls/eth_pubsub.rs index 39ae8754dc6..5d0b0658850 100644 --- a/rpc/src/v1/impls/eth_pubsub.rs +++ b/rpc/src/v1/impls/eth_pubsub.rs @@ -108,10 +108,10 @@ impl EthPubSubClient { #[cfg(test)] pub fn new_test(client: Arc, executor: Executor) -> Self { let client = Self::new(client, executor); - *client.heads_subscribers.write() = Subscribers::new_test(); - *client.logs_subscribers.write() = Subscribers::new_test(); - *client.transactions_subscribers.write() = Subscribers::new_test(); - *client.sync_subscribers.write() = Subscribers::new_test(); + *client.heads_subscribers.write() = Subscribers::default(); + *client.logs_subscribers.write() = Subscribers::default(); + *client.transactions_subscribers.write() = Subscribers::default(); + *client.sync_subscribers.write() = Subscribers::default(); client } From d22a47800781958de66e2bdc74613c552b63db02 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:42:36 +0200 Subject: [PATCH 80/90] [rpc] remove EthPubSubClient::new_test --- rpc/src/v1/impls/eth_pubsub.rs | 11 ----------- rpc/src/v1/tests/mocked/eth_pubsub.rs | 8 ++++---- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/rpc/src/v1/impls/eth_pubsub.rs b/rpc/src/v1/impls/eth_pubsub.rs index 5d0b0658850..019cbd39fb5 100644 --- a/rpc/src/v1/impls/eth_pubsub.rs +++ b/rpc/src/v1/impls/eth_pubsub.rs @@ -104,17 +104,6 @@ impl EthPubSubClient { } } - /// Creates new `EthPubSubCient` with deterministic subscription ids. - #[cfg(test)] - pub fn new_test(client: Arc, executor: Executor) -> Self { - let client = Self::new(client, executor); - *client.heads_subscribers.write() = Subscribers::default(); - *client.logs_subscribers.write() = Subscribers::default(); - *client.transactions_subscribers.write() = Subscribers::default(); - *client.sync_subscribers.write() = Subscribers::default(); - client - } - /// Returns a chain notification handler. pub fn handler(&self) -> Weak> { Arc::downgrade(&self.handler) diff --git a/rpc/src/v1/tests/mocked/eth_pubsub.rs b/rpc/src/v1/tests/mocked/eth_pubsub.rs index 02772965a09..071e0eaced3 100644 --- a/rpc/src/v1/tests/mocked/eth_pubsub.rs +++ b/rpc/src/v1/tests/mocked/eth_pubsub.rs @@ -40,7 +40,7 @@ fn should_subscribe_to_new_heads() { let h2 = client.block_hash_delta_minus(2); let h1 = client.block_hash_delta_minus(3); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); + let pubsub = EthPubSubClient::new(Arc::new(client), el.executor()); let handler = pubsub.handler().upgrade().unwrap(); let pubsub = pubsub.to_delegate(); @@ -112,7 +112,7 @@ fn should_subscribe_to_logs() { } ]); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); + let pubsub = EthPubSubClient::new(Arc::new(client), el.executor()); let handler = pubsub.handler().upgrade().unwrap(); let pubsub = pubsub.to_delegate(); @@ -159,7 +159,7 @@ fn should_subscribe_to_pending_transactions() { let el = Runtime::with_thread_count(1); let client = TestBlockChainClient::new(); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); + let pubsub = EthPubSubClient::new(Arc::new(client), el.executor()); let handler = pubsub.handler().upgrade().unwrap(); let pubsub = pubsub.to_delegate(); @@ -205,7 +205,7 @@ fn eth_subscribe_syncing() { // given let el = Runtime::with_thread_count(1); let client = TestBlockChainClient::new(); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); + let pubsub = EthPubSubClient::new(Arc::new(client), el.executor()); let pubsub = pubsub.to_delegate(); let mut io = MetaIoHandler::default(); From 57787b8808564da582dcd9520f9d915eaef71ffc Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 11:52:53 +0200 Subject: [PATCH 81/90] [ethcore] use trie-standardmap from crates.io --- Cargo.lock | 26 +++++++++++++------------- ethcore/Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e27de2214d..a9779e20058 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -911,7 +911,7 @@ dependencies = [ "time-utils 0.1.0", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-standardmap 0.12.3 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", + "trie-standardmap 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", "triehash-ethereum 0.2.0", "unexpected 0.1.0", "using_queue 0.1.0", @@ -1692,12 +1692,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hash-db" version = "0.12.2" -source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hash256-std-hasher" version = "0.12.2" -source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2155,10 +2155,10 @@ dependencies = [ [[package]] name = "keccak-hasher" version = "0.12.2" -source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", - "hash256-std-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", + "hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hash256-std-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4416,10 +4416,10 @@ dependencies = [ [[package]] name = "trie-standardmap" version = "0.12.3" -source = "git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps#0cf3759401a130d12313f0356c9767111d966700" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", - "keccak-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)", + "hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4906,8 +4906,8 @@ dependencies = [ "checksum hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1" "checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd" "checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" -"checksum hash-db 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" -"checksum hash256-std-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" +"checksum hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ba7fb417e5c470acdd61068c79767d0e65962e70836cf6c9dfd2409f06345ce0" +"checksum hash256-std-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b2027c19ec91eb304999abae7307d225cf93be42af53b0039f76e98ed5af86" "checksum heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)" = "" "checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" "checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa" @@ -4949,7 +4949,7 @@ dependencies = [ "checksum jsonrpc-tcp-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c873dac37a601fb88d40ba49eeac3f1aa60953c06b2e99ddbf0569b6f8028478" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" "checksum keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "69e8ee697b9aa6dcc34d7657565fa5052763a1627a5b59e4c3c0ae3ed0d70a65" -"checksum keccak-hasher 0.12.2 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" +"checksum keccak-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "af672553b2abac1c86c29fd62c79880638b6abc91d96db4aa42a5baab2bc1ca9" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" "checksum kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45bcdf5eb083602cff61a6f8438dce2a7900d714e893fc48781c39fb119d37aa" @@ -5156,7 +5156,7 @@ dependencies = [ "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 trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" -"checksum trie-standardmap 0.12.3 (git+https://github.com/paritytech/trie?branch=ao-fix-trie-standardmap-deps)" = "" +"checksum trie-standardmap 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ebaa4b340046196efad8872b2dffe585b5ea330230dc44ee14e399f77da29f51" "checksum triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d26efb4ddf87870fc08dc9a6580dc3061be350d7b9d0eb30aef1c8b4227aa46" "checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index bdcf237feb4..b344f1a5306 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -83,7 +83,7 @@ kvdb-rocksdb = "0.1.3" parity-runtime = { path = "../util/runtime" } rlp_compress = { path = "../util/rlp-compress" } tempdir = "0.3" -trie-standardmap = { git = "https://github.com/paritytech/trie", branch = "ao-fix-trie-standardmap-deps" } +trie-standardmap = "0.12.3" [features] parity = ["work-notify", "price-info", "stratum"] From b7a700df6d99b397ef3229d8967c1ba687607f44 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 12:47:02 +0200 Subject: [PATCH 82/90] [dir] fix db_root_path --- util/dir/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/dir/src/lib.rs b/util/dir/src/lib.rs index 90384777dc3..17572531226 100644 --- a/util/dir/src/lib.rs +++ b/util/dir/src/lib.rs @@ -157,7 +157,7 @@ impl DatabaseDirectories { /// Base DB directory for the given fork. // TODO: remove in 1.7 pub fn legacy_fork_path(&self) -> PathBuf { - let gh = H64::from_slice(&self.genesis_hash.as_bytes()[..8]); + let gh = H64::from_slice(&self.genesis_hash.as_bytes()[20..28]); Path::new(&self.legacy_path).join(format!( "{:x}{}", gh, @@ -177,8 +177,7 @@ impl DatabaseDirectories { /// DB root path, named after genesis hash pub fn db_root_path(&self) -> PathBuf { - // TODO(review): verify - let gh = H64::from_slice(&self.genesis_hash.as_bytes()[..8]); + let gh = H64::from_slice(&self.genesis_hash.as_bytes()[20..28]); self.spec_root_path().join("db").join(format!("{:x}", gh)) } From 8264f90de9247ea65e37ac5647870a67807ac509 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 13:50:13 +0200 Subject: [PATCH 83/90] [ethcore] simplify snapshot::tests::helpers::fill_storage --- ethcore/src/snapshot/tests/helpers.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ethcore/src/snapshot/tests/helpers.rs b/ethcore/src/snapshot/tests/helpers.rs index 0bf926d31d4..a70c7b7e272 100644 --- a/ethcore/src/snapshot/tests/helpers.rs +++ b/ethcore/src/snapshot/tests/helpers.rs @@ -124,9 +124,7 @@ pub fn fill_storage(mut db: AccountDBMut, root: &mut H256, seed: &mut H256) { SecTrieDBMut::from_existing(&mut db, root).unwrap() }; - let mut bytes = [0u8; 32]; - bytes.copy_from_slice(seed.as_bytes()); - for (k, v) in map.make_with(&mut bytes) { + for (k, v) in map.make_with(&mut seed.to_fixed_bytes()) { trie.insert(&k, &v).unwrap(); } } From b349df9662fc4acd723fa6826ed7a835299ac743 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 16:46:22 +0200 Subject: [PATCH 84/90] Apply suggestions from code review Co-Authored-By: David --- Cargo.toml | 1 - util/triehash-ethereum/Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 28d2b4e83a2..5a6c93d6493 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,6 @@ ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-service = { path = "ethcore/service" } ethcore-sync = { path = "ethcore/sync" } ethereum-types = "0.6.0" - ethkey = { path = "accounts/ethkey" } ethstore = { path = "accounts/ethstore" } node-filter = { path = "ethcore/node-filter" } diff --git a/util/triehash-ethereum/Cargo.toml b/util/triehash-ethereum/Cargo.toml index da71831c17c..b1f7b12168a 100644 --- a/util/triehash-ethereum/Cargo.toml +++ b/util/triehash-ethereum/Cargo.toml @@ -6,6 +6,6 @@ description = "Trie-root helpers, ethereum style" license = "GPL-3.0" [dependencies] -triehash = { version = "0.4.0", default-features = false } +triehash = "0.5.0" ethereum-types = "0.6.0" keccak-hasher = { path = "../keccak-hasher" } From 016d682ae23b53de376db4499064a30fa370ec40 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 16:34:46 +0200 Subject: [PATCH 85/90] [ethcore-secretstore] resolve TODO in serialization --- secret-store/src/serialization.rs | 66 +++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/secret-store/src/serialization.rs b/secret-store/src/serialization.rs index 0654fda08ed..c75d0992faa 100644 --- a/secret-store/src/serialization.rs +++ b/secret-store/src/serialization.rs @@ -36,11 +36,16 @@ impl ToHex for Bytes { impl ToHex for Signature { fn to_hex(&self) -> String { - // TODO: verify format!("0x{}", self) } } +impl ToHex for Secret { + fn to_hex(&self) -> String { + format!("0x{}", rustc_hex::ToHex::to_hex(self)) + } +} + macro_rules! impl_to_hex { ($name: ident) => ( impl ToHex for $name { @@ -129,7 +134,6 @@ pub type SerializableAddress = SerializableH160; impl_to_hex!(H256); impl_to_hex!(H160); impl_to_hex!(Public); -impl_to_hex!(Secret); impl_bytes!(SerializableBytes, Bytes, true, (Default)); impl_bytes!(SerializableH256, H256, false, (Default, PartialOrd, Ord)); @@ -183,23 +187,59 @@ impl From for SerializableRequester { #[cfg(test)] mod tests { use serde_json; - use super::{SerializableBytes, SerializablePublic}; + use super::*; + use std::str::FromStr; + + macro_rules! do_test { + ($value: expr, $expected: expr, $expected_type: ident) => ( + let serialized = serde_json::to_string(&$value).unwrap(); + assert_eq!(serialized, $expected); + let deserialized: $expected_type = serde_json::from_str(&serialized).unwrap(); + assert_eq!(deserialized, $value); + ); + } #[test] fn serialize_and_deserialize_bytes() { - let bytes = SerializableBytes(vec![1, 2, 3, 4]); - let bytes_serialized = serde_json::to_string(&bytes).unwrap(); - assert_eq!(&bytes_serialized, r#""0x01020304""#); - let bytes_deserialized: SerializableBytes = serde_json::from_str(&bytes_serialized).unwrap(); - assert_eq!(bytes_deserialized, bytes); + do_test!(SerializableBytes(vec![1, 2, 3, 4]), "\"0x01020304\"".to_owned(), SerializableBytes); + } + + #[test] + fn serialize_and_deserialize_h256() { + let s = "5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae"; + let h256 = SerializableH256(H256::from_str(s).unwrap()); + do_test!(h256, format!("\"0x{}\"", s), SerializableH256); + } + + #[test] + fn serialize_and_deserialize_h160() { + let s = "c6d9d2cd449a754c494264e1809c50e34d64562b"; + let h160 = SerializableH160(H160::from_str(s).unwrap()); + do_test!(h160, format!("\"0x{}\"", s), SerializableH160); } #[test] fn serialize_and_deserialize_public() { - let public = SerializablePublic("cac6c205eb06c8308d65156ff6c862c62b000b8ead121a4455a8ddeff7248128d895692136f240d5d1614dc7cc4147b1bd584bd617e30560bb872064d09ea325".parse().unwrap()); - let public_serialized = serde_json::to_string(&public).unwrap(); - assert_eq!(&public_serialized, r#""0xcac6c205eb06c8308d65156ff6c862c62b000b8ead121a4455a8ddeff7248128d895692136f240d5d1614dc7cc4147b1bd584bd617e30560bb872064d09ea325""#); - let public_deserialized: SerializablePublic = serde_json::from_str(&public_serialized).unwrap(); - assert_eq!(public_deserialized, public); + let s = "cac6c205eb06c8308d65156ff6c862c62b000b8ead121a4455a8ddeff7248128d895692136f240d5d1614dc7cc4147b1bd584bd617e30560bb872064d09ea325"; + let public = SerializablePublic(s.parse().unwrap()); + do_test!(public, format!("\"0x{}\"", s), SerializablePublic); + } + + #[test] + fn serialize_and_deserialize_secret() { + let s = "5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae"; + let secret = SerializableSecret(Secret::from(s)); + do_test!(secret, format!("\"0x{}\"", s), SerializableSecret); + } + + #[test] + fn serialize_and_deserialize_signature() { + let raw_r = "afafafafafafafafafafafbcbcbcbcbcbcbcbcbcbeeeeeeeeeeeeedddddddddd"; + let raw_s = "5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae"; + let r = H256::from_str(raw_r).unwrap(); + let s = H256::from_str(raw_s).unwrap(); + let v = 42u8; + let public = SerializableSignature(Signature::from_rsv(&r, &s, v)); + do_test!(public, format!("\"0x{}{}{:x}\"", raw_r, raw_s, v), SerializableSignature); } } From 4dbba7ebdc805c14a93583ec545af356e01382b5 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 16:40:21 +0200 Subject: [PATCH 86/90] [ethcore-network-devp2p] resolve TODO in save_key --- util/network-devp2p/src/host.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/network-devp2p/src/host.rs b/util/network-devp2p/src/host.rs index 3394008c075..0383aa99349 100644 --- a/util/network-devp2p/src/host.rs +++ b/util/network-devp2p/src/host.rs @@ -33,6 +33,7 @@ use mio::tcp::*; use mio::udp::*; use ethereum_types::H256; use rlp::{RlpStream, Encodable}; +use rustc_hex::ToHex; use session::{Session, SessionData}; use io::*; @@ -1223,8 +1224,7 @@ fn save_key(path: &Path, key: &Secret) { if let Err(e) = restrict_permissions_owner(path, true, false) { warn!(target: "network", "Failed to modify permissions of the file ({})", e); } - // TODO: verify - if let Err(e) = file.write(&format!("{:x}", key).into_bytes()) { + if let Err(e) = file.write(&key.to_hex().into_bytes()) { warn!("Error writing key file: {:?}", e); } } From e4792181dd518d0383650da843ad0a061b3eca07 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 29 May 2019 16:48:34 +0200 Subject: [PATCH 87/90] [Cargo.lock] update triehash --- Cargo.lock | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a9779e20058..a6c7d12dd77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3620,15 +3620,6 @@ dependencies = [ "opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rlp" -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)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rlp" version = "0.4.0" @@ -4424,11 +4415,11 @@ dependencies = [ [[package]] name = "triehash" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4437,7 +4428,7 @@ version = "0.2.0" dependencies = [ "ethereum-types 0.6.0 (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)", + "triehash 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5067,7 +5058,6 @@ dependencies = [ "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" "checksum ripemd160 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a" -"checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" "checksum rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b0d56c1450bfbef1181fdeb78b902dc1d23178de77c23d705317508e03d1b7c" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" "checksum rprompt 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1601f32bc5858aae3cbfa1c645c96c4d820cc5c16be0194f089560c00b6eb625" @@ -5157,7 +5147,7 @@ dependencies = [ "checksum transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb4b191d033a35edfce392a38cdcf9790b6cebcb30fa690c312c29da4dc433e" "checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" "checksum trie-standardmap 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ebaa4b340046196efad8872b2dffe585b5ea330230dc44ee14e399f77da29f51" -"checksum triehash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d26efb4ddf87870fc08dc9a6580dc3061be350d7b9d0eb30aef1c8b4227aa46" +"checksum triehash 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92148b4d8d55eff71bc8c9e3c5f714e266c2a05e724dce5405a10deabbf449a8" "checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" From 9181be77e976a8da2a38b1c5782fe3a629fdcac0 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 3 Jun 2019 15:12:45 +0200 Subject: [PATCH 88/90] [*] use ethabi from crates.io --- Cargo.lock | 64 +++++++++++++++++----------------- ethcore/Cargo.toml | 6 ++-- ethcore/node-filter/Cargo.toml | 6 ++-- ethcore/private-tx/Cargo.toml | 6 ++-- miner/Cargo.toml | 6 ++-- secret-store/Cargo.toml | 6 ++-- updater/Cargo.toml | 6 ++-- updater/hash-fetch/Cargo.toml | 6 ++-- util/EIP-712/Cargo.toml | 2 +- util/registrar/Cargo.toml | 6 ++-- 10 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6c7d12dd77..24070229477 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -711,7 +711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "eip-712" version = "0.1.0" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.6.0 (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)", @@ -784,7 +784,7 @@ dependencies = [ [[package]] name = "ethabi" version = "8.0.0" -source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#db5af6986aa2682a2367856c605d7e3766d4a266" +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.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -798,14 +798,14 @@ dependencies = [ [[package]] name = "ethabi-contract" version = "8.0.0" -source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#db5af6986aa2682a2367856c605d7e3766d4a266" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ethabi-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types#db5af6986aa2682a2367856c605d7e3766d4a266" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.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)", @@ -855,9 +855,9 @@ dependencies = [ "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethcore-accounts 0.1.0", "ethcore-blockchain 0.1.0", @@ -1074,9 +1074,9 @@ dependencies = [ "common-types 0.1.0", "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 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethcore-call-contract 0.1.0", "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1165,9 +1165,9 @@ 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)", - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", @@ -1205,9 +1205,9 @@ dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", @@ -2498,9 +2498,9 @@ dependencies = [ name = "node-filter" version = "1.12.0" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-io 1.12.0", "ethcore-network 1.12.0", @@ -2770,9 +2770,9 @@ dependencies = [ name = "parity-hash-fetch" version = "1.12.0" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "fake-fetch 0.0.1", "fetch 0.1.0", @@ -2974,9 +2974,9 @@ name = "parity-updater" version = "1.12.0" dependencies = [ "common-types 0.1.0", - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-sync 1.12.0", "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3574,9 +3574,9 @@ dependencies = [ name = "registrar" version = "0.0.1" dependencies = [ - "ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", - "ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)", + "ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4867,9 +4867,9 @@ dependencies = [ "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" "checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6)" = "" -"checksum ethabi 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" -"checksum ethabi-contract 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" -"checksum ethabi-derive 8.0.0 (git+https://github.com/paritytech/ethabi?branch=ao-update-ethereum-types)" = "" +"checksum ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b312e5740d6e0369491ebe81a8752f7797b70e495530f28bbb7cc967ded3d77c" +"checksum ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "272b7fcfada8d9b2631d75693385b505efc826752dbc7ae1815e56b35d5a3f9f" +"checksum ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "65cdef3199bf5d1821dc53b5ab992f853a13b2e28d7a63983095d9d61fae58d3" "checksum ethbloom 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3932e82d64d347a045208924002930dc105a138995ccdc1479d0f05f0359f17c" "checksum ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62d1bc682337e2c5ec98930853674dd2b4bd5d0d246933a9e98e5280f7c76c5f" "checksum failsafe 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad3bf1642583ea2f1fa38a1e8546613a7488816941b33e5f0fccceac61879118" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index b344f1a5306..92d3bf3e2c7 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -15,9 +15,9 @@ common-types = { path = "types" } crossbeam = "0.4" derive_more = "0.14.0" env_logger = { version = "0.5", optional = true } -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-contract = "8.0" +ethabi-derive = "8.0" ethash = { path = "../ethash" } ethcore-blockchain = { path = "./blockchain" } ethcore-bloom-journal = { path = "../util/bloom" } diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index 9ae04d8fcdd..4ad60d0dd5b 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -13,9 +13,9 @@ ethcore-network-devp2p = { path = "../../util/network-devp2p" } ethereum-types = "0.6.0" log = "0.4" parking_lot = "0.7" -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-derive = "8.0" +ethabi-contract = "8.0" lru-cache = "0.1" [dev-dependencies] diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 00528277ef5..23cd51cdaa7 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -8,9 +8,9 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../types" } derive_more = "0.14.0" -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-contract = "8.0" +ethabi-derive = "8.0" ethcore = { path = ".." } ethcore-call-contract = { path = "../call-contract" } ethcore-io = { path = "../../util/io" } diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 70de6611322..68de893ec81 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -17,9 +17,9 @@ url = { version = "1", optional = true } ansi_term = "0.10" common-types = { path = "../ethcore/types" } error-chain = "0.12" -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-derive = "8.0" +ethabi-contract = "8.0" ethcore-call-contract = { path = "../ethcore/call-contract" } ethereum-types = "0.6.0" futures = "0.1" diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index 063e8488dca..5139d1b7fae 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -8,9 +8,9 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" common-types = { path = "../ethcore/types" } -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-contract = "8.0" +ethabi-derive = "8.0" ethcore = { path = "../ethcore" } ethcore-accounts = { path = "../accounts", optional = true} ethcore-call-contract = { path = "../ethcore/call-contract" } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index a52be1e1dab..c4996bfd77d 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -7,9 +7,9 @@ authors = ["Parity Technologies "] [dependencies] common-types = { path = "../ethcore/types" } -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-contract = "8.0" +ethabi-derive = "8.0" ethcore = { path = "../ethcore" } ethcore-sync = { path = "../ethcore/sync" } ethereum-types = "0.6.0" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index 6792de7c62c..0c98d3f678e 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -20,9 +20,9 @@ parity-runtime = { path = "../../util/runtime" } keccak-hash = "0.2.0" registrar = { path = "../../util/registrar" } -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-derive = "8.0" +ethabi-contract = "8.0" [dev-dependencies] parking_lot = "0.7" diff --git a/util/EIP-712/Cargo.toml b/util/EIP-712/Cargo.toml index fff13d4f4ef..e5e5e56d197 100644 --- a/util/EIP-712/Cargo.toml +++ b/util/EIP-712/Cargo.toml @@ -14,7 +14,7 @@ edition = "2018" serde_derive = "1.0" serde = "1.0" serde_json = "1.0" -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" keccak-hash = "0.2.0" ethereum-types = "0.6.0" failure = "0.1" diff --git a/util/registrar/Cargo.toml b/util/registrar/Cargo.toml index 710cab0474d..44904028b8f 100644 --- a/util/registrar/Cargo.toml +++ b/util/registrar/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] [dependencies] futures = "0.1" -ethabi = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-derive = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } -ethabi-contract = { git = "https://github.com/paritytech/ethabi", branch = "ao-update-ethereum-types" } +ethabi = "8.0" +ethabi-derive = "8.0" +ethabi-contract = "8.0" keccak-hash = "0.2.0" From 722971b62d9b3fa64b6de7feae7a25227d8a2f08 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 3 Jun 2019 15:13:59 +0200 Subject: [PATCH 89/90] [ethkey] use secp256k1 from master branch --- accounts/ethkey/Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index aacf9c801cf..a6c1a974ba0 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -7,8 +7,7 @@ authors = ["Parity Technologies "] byteorder = "1.0" edit-distance = "2.0" parity-crypto = "0.4.0" -# TODO: use master branch after we switch to rand 0.6 -eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", branch = "rand-0.6" } +eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } ethereum-types = "0.6.0" lazy_static = "1.0" log = "0.4" From 72d9b6e82b96eccd3dd07df27e3e2411c129e231 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 3 Jun 2019 15:16:08 +0200 Subject: [PATCH 90/90] [Cargo.lock] update eth-secp256k1 --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24070229477..c3a00e53ff4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -773,7 +773,7 @@ dependencies = [ [[package]] name = "eth-secp256k1" version = "0.5.7" -source = "git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6#754a66081379e7098076253d664d1dc8f50e5e5e" +source = "git+https://github.com/paritytech/rust-secp256k1#9791e79f21a5309dcb6e0bd254b1ef88fca2f1f4" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1340,7 +1340,7 @@ version = "0.3.0" 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?branch=rand-0.6)", + "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", "ethereum-types 0.6.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)", @@ -4866,7 +4866,7 @@ dependencies = [ "checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" -"checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1?branch=rand-0.6)" = "" +"checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)" = "" "checksum ethabi 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b312e5740d6e0369491ebe81a8752f7797b70e495530f28bbb7cc967ded3d77c" "checksum ethabi-contract 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "272b7fcfada8d9b2631d75693385b505efc826752dbc7ae1815e56b35d5a3f9f" "checksum ethabi-derive 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "65cdef3199bf5d1821dc53b5ab992f853a13b2e28d7a63983095d9d61fae58d3"