diff --git a/Cargo.lock b/Cargo.lock index f969a5115..5c2d079c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,8 +112,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.1.0 (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.1 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -167,7 +165,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "bloomable" version = "0.1.0" dependencies = [ - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", ] @@ -261,9 +259,8 @@ name = "common-types" version = "0.1.0" dependencies = [ "bloomable 0.1.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", @@ -367,7 +364,7 @@ name = "dir" version = "0.1.0" dependencies = [ "app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.1.0", ] @@ -473,14 +470,13 @@ dependencies = [ "common-types 0.1.0", "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bloom-journal 0.1.0", "ethcore-bytes 0.1.0", "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-logger 1.9.0", "ethcore-stratum 1.9.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.0", @@ -531,31 +527,6 @@ dependencies = [ "wasm 0.1.0", ] -[[package]] -name = "ethcore-bigint" -version = "0.2.1" -dependencies = [ - "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", - "plain_hasher 0.1.0", - "rand 0.3.16 (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 = "ethcore-bigint" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", - "plain_hasher 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.16 (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 = "ethcore-bloom-journal" version = "0.1.0" @@ -591,13 +562,13 @@ version = "1.9.0" dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-io 1.9.0", "ethcore-network 1.9.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "evm 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "hashdb 0.1.1", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", @@ -609,6 +580,7 @@ dependencies = [ "memorydb 0.1.1", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.1.0", + "plain_hasher 0.1.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.1", "rlp_derive 0.1.0", @@ -644,12 +616,12 @@ dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-logger 1.9.0", "ethcrypto 0.1.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -677,11 +649,10 @@ version = "1.0.0" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-logger 1.9.0", - "ethcore-util 1.9.0", "ethcrypto 0.1.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethsync 1.9.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -712,8 +683,8 @@ name = "ethcore-stratum" version = "1.9.0" dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-logger 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-tcp-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", @@ -724,37 +695,34 @@ dependencies = [ "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ethcore-util" -version = "1.9.0" -dependencies = [ - "ethcore-bigint 0.2.1", - "ethcore-bytes 0.1.0", - "hashdb 0.1.1", - "keccak-hash 0.1.0", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.1", - "patricia-trie 0.1.0", - "triehash 0.1.0", -] - [[package]] name = "ethcrypto" version = "0.1.0" dependencies = [ "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "subtle 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethereum-types" +version = "0.1.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)", + "fixed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ethjson" version = "0.1.0" dependencies = [ - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -768,7 +736,7 @@ dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "edit-distance 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wordlist 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -798,8 +766,8 @@ name = "ethstore" version = "0.2.0" dependencies = [ "dir 0.1.0", - "ethcore-bigint 0.2.1", "ethcrypto 0.1.0", + "ethereum-types 0.1.3 (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.31 (registry+https://github.com/rust-lang/crates.io-index)", @@ -839,12 +807,11 @@ version = "1.9.0" dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-io 1.9.0", "ethcore-light 1.9.0", "ethcore-network 1.9.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -854,6 +821,7 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "plain_hasher 0.1.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.1", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -867,8 +835,7 @@ name = "evm" version = "0.1.0" dependencies = [ "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "evmjit 1.9.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", @@ -886,9 +853,8 @@ version = "0.1.0" dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -925,6 +891,17 @@ dependencies = [ "reqwest 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fixed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.16 (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 = "flate2" version = "0.2.20" @@ -1015,7 +992,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "hardware-wallet" version = "1.9.0" dependencies = [ - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (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)", @@ -1031,7 +1008,7 @@ name = "hashdb" version = "0.1.1" dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1215,9 +1192,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "journaldb" version = "0.1.0" dependencies = [ - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-logger 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.1.1", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", @@ -1226,6 +1203,7 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.1.1", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "plain_hasher 0.1.0", "rlp 0.2.1", "util-error 0.1.0", ] @@ -1331,7 +1309,7 @@ name = "keccak-hash" version = "0.1.0" dependencies = [ "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1368,7 +1346,7 @@ name = "kvdb-rocksdb" version = "0.1.0" dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1525,10 +1503,11 @@ version = "0.1.1" dependencies = [ "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.1.1", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", + "plain_hasher 0.1.0", "rlp 0.2.1", ] @@ -1671,7 +1650,7 @@ version = "0.1.0" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "native-contract-generator 0.1.0", ] @@ -1705,11 +1684,10 @@ name = "node-filter" version = "1.9.0" dependencies = [ "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-io 1.9.0", "ethcore-network 1.9.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1914,7 +1892,6 @@ dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", @@ -1923,7 +1900,7 @@ dependencies = [ "ethcore-network 1.9.0", "ethcore-secretstore 1.0.0", "ethcore-stratum 1.9.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "ethsync 1.9.0", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1978,10 +1955,9 @@ version = "1.9.0" dependencies = [ "base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-devtools 1.9.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "fetch 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2041,9 +2017,8 @@ name = "parity-hash-fetch" version = "1.9.0" dependencies = [ "ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "fetch 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", @@ -2063,8 +2038,8 @@ version = "1.9.0" dependencies = [ "cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2092,8 +2067,7 @@ dependencies = [ name = "parity-machine" version = "0.1.0" dependencies = [ - "ethcore-bigint 0.2.1", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2112,15 +2086,14 @@ dependencies = [ "cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.9.0", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-light 1.9.0", "ethcore-logger 1.9.0", "ethcore-network 1.9.0", - "ethcore-util 1.9.0", "ethcrypto 0.1.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.3.0", "ethstore 0.2.0", @@ -2245,9 +2218,8 @@ version = "1.9.0" dependencies = [ "ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.9.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethsync 1.9.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2287,9 +2259,9 @@ version = "0.1.0" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-network 1.9.0", "ethcrypto 0.1.0", + "ethereum-types 0.1.3 (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 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", @@ -2350,9 +2322,9 @@ name = "patricia-trie" version = "0.1.0" dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-logger 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.1.1", "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2412,14 +2384,7 @@ name = "plain_hasher" version = "0.1.0" dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "plain_hasher" -version = "0.1.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 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2506,8 +2471,8 @@ name = "pwasm-run-test" version = "0.1.0" dependencies = [ "clap 2.26.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-logger 1.9.0", + "ethereum-types 0.1.3 (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.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2654,7 +2619,7 @@ version = "0.2.1" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2716,7 +2681,6 @@ name = "rpc-cli" version = "1.4.0" dependencies = [ "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-util 1.9.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.9.0", "parity-rpc-client 1.4.0", @@ -3268,7 +3232,7 @@ name = "transaction-pool" version = "1.9.0" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3293,7 +3257,7 @@ dependencies = [ name = "triehash" version = "0.1.0" dependencies = [ - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.0", "rlp 0.2.1", ] @@ -3303,6 +3267,17 @@ name = "typeable" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "uint" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.4.1 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unexpected" version = "0.1.0" @@ -3396,7 +3371,7 @@ name = "util-error" version = "0.1.0" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0", "rlp 0.2.1", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3441,9 +3416,8 @@ version = "0.1.0" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", - "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3461,9 +3435,8 @@ name = "wasm" version = "0.1.0" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", "ethcore-logger 1.9.0", - "ethcore-util 1.9.0", + "ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", @@ -3603,8 +3576,9 @@ dependencies = [ "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)" = "" "checksum ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c819a3adef0413a2519cbd9a19a35dd1c20c7a0110705beaba8aa4aa87eda95f" -"checksum ethcore-bigint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcb5af77e74a8f70e9c3337e069c37bc82178ef1b459c02091f73c4ad5281eb5" +"checksum ethereum-types 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e3e9292c4a0b6e4825315b17c73dffd0e91847b25c1e35c7b658fee50f936182" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" +"checksum fixed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "75f91321a3926b773df3c6e7e953e3c756d9c06f0e9f05d34a0e103b03fcc9a1" "checksum flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "e6234dd4468ae5d1e2dbb06fe2b058696fdc50a339c68a393aefbf00bc81e423" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" @@ -3707,7 +3681,6 @@ dependencies = [ "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum plain_hasher 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83ae80873992f511142c07d0ec6c44de5636628fdb7e204abd655932ea79d995" "checksum podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e5422a1ee1bc57cc47ae717b0137314258138f38fd5f3cea083f43a9725383a0" "checksum pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2412f3332a07c7a2a50168988dcc184f32180a9758ad470390e5f55e089f6b6e" "checksum primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0e31b86efadeaeb1235452171a66689682783149a6249ff334a2c5d8218d00a4" @@ -3802,6 +3775,7 @@ dependencies = [ "checksum transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "715254c8f0811be1a79ad3ea5e6fa3c8eddec2b03d7f5ba78cf093e56d79c24f" "checksum trezor-sys 1.0.0 (git+https://github.com/paritytech/trezor-sys)" = "" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" +"checksum uint 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91ed1e25ded4e37e0967b1f12d5f910b32f979768d4f48e2f6ca7b6e7130b44e" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e01da42520092d0cd2d6ac3ae69eb21a22ad43ff195676b86f8c37f487d6b80" "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 851fedda3..14387aff5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,15 +34,14 @@ ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" } jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } ethsync = { path = "sync" } ethcore = { path = "ethcore" } -ethcore-util = { path = "util" } ethcore-bytes = { path = "util/bytes" } -ethcore-bigint = { path = "util/bigint" } ethcore-io = { path = "util/io" } ethcore-devtools = { path = "devtools" } ethcore-light = { path = "ethcore/light" } ethcore-logger = { path = "logger" } ethcore-stratum = { path = "stratum" } ethcore-network = { path = "util/network" } +ethereum-types = "0.1" node-filter = { path = "ethcore/node_filter" } ethkey = { path = "ethkey" } node-health = { path = "dapps/node-health" } diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index ac9becaa6..0ae6a77db 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -28,9 +28,8 @@ itertools = "0.5" jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } +ethereum-types = "0.1" fetch = { path = "../util/fetch" } node-health = { path = "./node-health" } parity-hash-fetch = { path = "../hash-fetch" } diff --git a/dapps/src/apps/fetcher/installers.rs b/dapps/src/apps/fetcher/installers.rs index 11491f72f..88477cfa2 100644 --- a/dapps/src/apps/fetcher/installers.rs +++ b/dapps/src/apps/fetcher/installers.rs @@ -18,7 +18,7 @@ use zip; use std::{fs, fmt}; use std::io::{self, Read, Write}; use std::path::PathBuf; -use bigint::hash::H256; +use ethereum_types::H256; use fetch::{self, Mime}; use futures_cpupool::CpuPool; use hash::keccak_buffer; diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index 19dd7f70b..bf9ae6ab9 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -32,9 +32,8 @@ extern crate zip; extern crate jsonrpc_http_server; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; +extern crate ethereum_types; extern crate fetch; extern crate node_health; extern crate parity_dapps_glue as parity_dapps; diff --git a/dapps/src/tests/helpers/registrar.rs b/dapps/src/tests/helpers/registrar.rs index 2873c7ae7..2f7a33e1b 100644 --- a/dapps/src/tests/helpers/registrar.rs +++ b/dapps/src/tests/helpers/registrar.rs @@ -18,12 +18,11 @@ use std::str; use std::sync::Arc; use std::collections::HashMap; -use bigint::hash::H256; +use ethereum_types::{H256, Address}; use bytes::{Bytes, ToPretty}; use hash_fetch::urlhint::{ContractClient, BoxFuture}; use parking_lot::Mutex; use rustc_hex::FromHex; -use util::Address; const REGISTRAR: &'static str = "8e4e9b13d4b45cb0befc93c3061b1408f67316b2"; const URLHINT: &'static str = "deadbeefcafe0000000000000000000000000000"; diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 35b2e9bc7..2bf55117a 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -23,8 +23,7 @@ ethcore-devtools = { path = "../devtools" } ethcore-io = { path = "../util/io" } ethcore-logger = { path = "../logger" } ethcore-stratum = { path = "../stratum" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" memory-cache = { path = "../util/memory_cache" } ethjson = { path = "../json" } ethkey = { path = "../ethkey" } diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 76bbae3f0..bf6e6754a 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -5,8 +5,7 @@ authors = ["Parity Technologies "] [dependencies] bit-set = "0.4" -ethcore-util = { path = "../../util" } -ethcore-bigint = { path = "../../util/bigint" } +ethereum-types = "0.1" evmjit = { path = "../../evmjit", optional = true } heapsize = "0.4" lazy_static = "0.2" diff --git a/ethcore/evm/src/evm.rs b/ethcore/evm/src/evm.rs index 9a887d040..16dffe77c 100644 --- a/ethcore/evm/src/evm.rs +++ b/ethcore/evm/src/evm.rs @@ -17,7 +17,7 @@ //! Evm interface. use std::{ops, cmp, fmt}; -use bigint::prelude::{U128, U256, U512}; +use ethereum_types::{U128, U256, U512}; use vm::{Ext, Result, ReturnData, GasLeft, Error}; /// Finalization result. Gas Left: either it is a known value, or it needs to be computed by processing @@ -149,7 +149,7 @@ impl CostType for usize { #[cfg(test)] mod tests { - use bigint::prelude::U256; + use ethereum_types::U256; use super::CostType; #[test] diff --git a/ethcore/evm/src/factory.rs b/ethcore/evm/src/factory.rs index 3e9ee0e37..7db4fd20e 100644 --- a/ethcore/evm/src/factory.rs +++ b/ethcore/evm/src/factory.rs @@ -18,7 +18,7 @@ //! use std::sync::Arc; use vm::Vm; -use bigint::prelude::U256; +use ethereum_types::U256; use super::interpreter::SharedCache; use super::vmtype::VMType; diff --git a/ethcore/evm/src/interpreter/gasometer.rs b/ethcore/evm/src/interpreter/gasometer.rs index a7fe2a331..beb22447f 100644 --- a/ethcore/evm/src/interpreter/gasometer.rs +++ b/ethcore/evm/src/interpreter/gasometer.rs @@ -15,8 +15,7 @@ // along with Parity. If not, see . use std::cmp; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{U256, H256}; use super::u256_to_address; use {evm, vm}; diff --git a/ethcore/evm/src/interpreter/memory.rs b/ethcore/evm/src/interpreter/memory.rs index 0369992cb..f646d0198 100644 --- a/ethcore/evm/src/interpreter/memory.rs +++ b/ethcore/evm/src/interpreter/memory.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; +use ethereum_types::U256; use vm::ReturnData; const MAX_RETURN_WASTE_BYTES: usize = 16384; @@ -134,7 +134,7 @@ impl Memory for Vec { #[cfg(test)] mod tests { - use bigint::prelude::U256; + use ethereum_types::U256; use super::Memory; #[test] diff --git a/ethcore/evm/src/interpreter/mod.rs b/ethcore/evm/src/interpreter/mod.rs index 6ea218ecf..d6b3ff792 100644 --- a/ethcore/evm/src/interpreter/mod.rs +++ b/ethcore/evm/src/interpreter/mod.rs @@ -27,8 +27,7 @@ use std::marker::PhantomData; use std::{cmp, mem}; use std::sync::Arc; use hash::keccak; -use bigint::prelude::{U256, U512}; -use bigint::hash::H256; +use ethereum_types::{U256, U512, H256, Address}; use vm::{ self, ActionParams, ActionValue, CallType, MessageCallResult, @@ -45,8 +44,6 @@ pub use self::shared_cache::SharedCache; use bit_set::BitSet; -use util::*; - type ProgramCounter = usize; const ONE: U256 = U256([1, 0, 0, 0]); diff --git a/ethcore/evm/src/interpreter/shared_cache.rs b/ethcore/evm/src/interpreter/shared_cache.rs index d0386b194..30bc5b677 100644 --- a/ethcore/evm/src/interpreter/shared_cache.rs +++ b/ethcore/evm/src/interpreter/shared_cache.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use hash::KECCAK_EMPTY; use heapsize::HeapSizeOf; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::Mutex; use memory_cache::MemoryLruCache; use bit_set::BitSet; diff --git a/ethcore/evm/src/lib.rs b/ethcore/evm/src/lib.rs index 5c073add6..b61c8aa2a 100644 --- a/ethcore/evm/src/lib.rs +++ b/ethcore/evm/src/lib.rs @@ -17,8 +17,7 @@ //! Ethereum virtual machine. extern crate bit_set; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate parking_lot; extern crate heapsize; extern crate vm; diff --git a/ethcore/evm/src/tests.rs b/ethcore/evm/src/tests.rs index 6e85e1803..1eafb8d0e 100644 --- a/ethcore/evm/src/tests.rs +++ b/ethcore/evm/src/tests.rs @@ -20,9 +20,7 @@ use std::hash::Hash; use std::sync::Arc; use std::collections::{HashMap, HashSet}; use rustc_hex::FromHex; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::*; +use ethereum_types::{U256, H256, Address}; use vm::{self, ActionParams, ActionValue}; use vm::tests::{FakeExt, FakeCall, FakeCallType, test_finalize}; use factory::Factory; diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 8e366289b..50b10d681 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -9,16 +9,17 @@ authors = ["Parity Technologies "] [dependencies] log = "0.3" ethcore = { path = ".."} -ethcore-util = { path = "../../util" } -ethcore-bigint = { path = "../../util/bigint" } ethcore-bytes = { path = "../../util/bytes" } +ethereum-types = "0.1" memorydb = { path = "../../util/memorydb" } patricia-trie = { path = "../../util/patricia_trie" } ethcore-network = { path = "../../util/network" } ethcore-io = { path = "../../util/io" } evm = { path = "../evm" } +hashdb = { path = "../../util/hashdb" } heapsize = "0.4" vm = { path = "../vm" } +plain_hasher = { path = "../../util/plain_hasher" } rlp = { path = "../../util/rlp" } rlp_derive = { path = "../../util/rlp_derive" } time = "0.1" diff --git a/ethcore/light/src/cache.rs b/ethcore/light/src/cache.rs index 8ec6b53af..cf1506c72 100644 --- a/ethcore/light/src/cache.rs +++ b/ethcore/light/src/cache.rs @@ -27,8 +27,7 @@ use ethcore::receipt::Receipt; use stats::Corpus; use time::{SteadyTime, Duration}; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use memory_cache::MemoryLruCache; /// Configuration for how much data to cache. diff --git a/ethcore/light/src/cht.rs b/ethcore/light/src/cht.rs index d8a07fab9..6f5ebf808 100644 --- a/ethcore/light/src/cht.rs +++ b/ethcore/light/src/cht.rs @@ -21,9 +21,9 @@ //! we discarded. use ethcore::ids::BlockId; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::{HashDB, MemoryDB}; +use ethereum_types::{H256, U256}; +use hashdb::HashDB; +use memorydb::MemoryDB; use bytes::Bytes; use trie::{self, TrieMut, TrieDBMut, Trie, TrieDB, Recorder}; use rlp::{RlpStream, UntrustedRlp}; diff --git a/ethcore/light/src/client/fetch.rs b/ethcore/light/src/client/fetch.rs index 3042651ce..86269c695 100644 --- a/ethcore/light/src/client/fetch.rs +++ b/ethcore/light/src/client/fetch.rs @@ -24,7 +24,7 @@ use ethcore::machine::EthereumMachine; use ethcore::header::Header; use ethcore::receipt::Receipt; use futures::future::IntoFuture; -use bigint::hash::H256; +use ethereum_types::H256; /// Provides full chain data. pub trait ChainDataFetcher: Send + Sync + 'static { diff --git a/ethcore/light/src/client/header_chain.rs b/ethcore/light/src/client/header_chain.rs index c406da4c9..1a9249218 100644 --- a/ethcore/light/src/client/header_chain.rs +++ b/ethcore/light/src/client/header_chain.rs @@ -43,8 +43,8 @@ use ethcore::engines::epoch::{ use rlp::{Encodable, Decodable, DecoderError, RlpStream, Rlp, UntrustedRlp}; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::{H256, H256FastMap, H264}; +use ethereum_types::{H256, H264, U256}; +use plain_hasher::H256FastMap; use kvdb::{self, DBTransaction, KeyValueDB}; use cache::Cache; diff --git a/ethcore/light/src/client/mod.rs b/ethcore/light/src/client/mod.rs index a60ad4347..3f8f22b0a 100644 --- a/ethcore/light/src/client/mod.rs +++ b/ethcore/light/src/client/mod.rs @@ -32,8 +32,7 @@ use ethcore::service::ClientIoMessage; use ethcore::encoded; use io::IoChannel; use parking_lot::{Mutex, RwLock}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use futures::{IntoFuture, Future}; use kvdb::{self, KeyValueDB}; diff --git a/ethcore/light/src/lib.rs b/ethcore/light/src/lib.rs index cceb12429..f04788cf4 100644 --- a/ethcore/light/src/lib.rs +++ b/ethcore/light/src/lib.rs @@ -56,16 +56,17 @@ extern crate log; extern crate bincode; extern crate ethcore_io as io; extern crate ethcore_network as network; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; +extern crate ethereum_types; extern crate ethcore; extern crate evm; +extern crate hashdb; extern crate heapsize; extern crate futures; extern crate itertools; extern crate memorydb; extern crate patricia_trie as trie; +extern crate plain_hasher; extern crate rand; extern crate rlp; extern crate parking_lot; diff --git a/ethcore/light/src/net/mod.rs b/ethcore/light/src/net/mod.rs index ee14ad976..ac589b333 100644 --- a/ethcore/light/src/net/mod.rs +++ b/ethcore/light/src/net/mod.rs @@ -23,9 +23,8 @@ use ethcore::transaction::UnverifiedTransaction; use io::TimerToken; use network::{HostInfo, NetworkProtocolHandler, NetworkContext, PeerId}; use rlp::{RlpStream, UntrustedRlp}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::DBValue; +use ethereum_types::{H256, U256}; +use kvdb::DBValue; use parking_lot::{Mutex, RwLock}; use time::{Duration, SteadyTime}; diff --git a/ethcore/light/src/net/request_credits.rs b/ethcore/light/src/net/request_credits.rs index 5007d4d6c..db98115bc 100644 --- a/ethcore/light/src/net/request_credits.rs +++ b/ethcore/light/src/net/request_credits.rs @@ -30,7 +30,7 @@ use request::{self, Request}; use super::error::Error; use rlp::*; -use bigint::prelude::U256; +use ethereum_types::U256; use time::{Duration, SteadyTime}; /// Credits value. diff --git a/ethcore/light/src/net/request_set.rs b/ethcore/light/src/net/request_set.rs index e535d3b5d..f90678640 100644 --- a/ethcore/light/src/net/request_set.rs +++ b/ethcore/light/src/net/request_set.rs @@ -27,7 +27,7 @@ use std::iter::FromIterator; use request::Request; use request::NetworkRequests as Requests; use net::{timeout, ReqId}; -use bigint::prelude::U256; +use ethereum_types::U256; use time::{Duration, SteadyTime}; diff --git a/ethcore/light/src/net/status.rs b/ethcore/light/src/net/status.rs index b83b831da..0f811bbe4 100644 --- a/ethcore/light/src/net/status.rs +++ b/ethcore/light/src/net/status.rs @@ -17,8 +17,7 @@ //! Peer status and capabilities. use rlp::{DecoderError, Encodable, Decodable, RlpStream, UntrustedRlp}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use super::request_credits::FlowParams; @@ -374,8 +373,7 @@ pub fn write_announcement(announcement: &Announcement) -> Vec { mod tests { use super::*; use super::super::request_credits::FlowParams; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{U256, H256}; use rlp::{RlpStream, UntrustedRlp}; #[test] diff --git a/ethcore/light/src/net/tests/mod.rs b/ethcore/light/src/net/tests/mod.rs index 0e344d803..2102fd105 100644 --- a/ethcore/light/src/net/tests/mod.rs +++ b/ethcore/light/src/net/tests/mod.rs @@ -32,9 +32,7 @@ use request; use request::*; use rlp::*; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use std::sync::Arc; diff --git a/ethcore/light/src/on_demand/request.rs b/ethcore/light/src/on_demand/request.rs index 2c0dd4121..0c1ca2a13 100644 --- a/ethcore/light/src/on_demand/request.rs +++ b/ethcore/light/src/on_demand/request.rs @@ -31,10 +31,10 @@ use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY, KECCAK_EMPTY_LIST_RLP, keccak}; use request::{self as net_request, IncompleteRequest, CompleteRequest, Output, OutputKind, Field}; use rlp::{RlpStream, UntrustedRlp}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256, Address}; use parking_lot::Mutex; -use util::{Address, DBValue, HashDB}; +use hashdb::HashDB; +use kvdb::DBValue; use bytes::Bytes; use memorydb::MemoryDB; use trie::{Trie, TrieDB, TrieError}; @@ -941,8 +941,8 @@ impl Signal { #[cfg(test)] mod tests { use super::*; - use bigint::hash::H256; - use util::{MemoryDB, Address}; + use ethereum_types::{H256, Address}; + use memorydb::MemoryDB; use parking_lot::Mutex; use trie::{Trie, TrieMut, SecTrieDB, SecTrieDBMut}; use trie::recorder::Recorder; diff --git a/ethcore/light/src/on_demand/tests.rs b/ethcore/light/src/on_demand/tests.rs index e114a7902..a13550a46 100644 --- a/ethcore/light/src/on_demand/tests.rs +++ b/ethcore/light/src/on_demand/tests.rs @@ -22,7 +22,7 @@ use ethcore::header::{Header, Seal}; use futures::Future; use network::{PeerId, NodeId}; use net::*; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::Mutex; use time::Duration; use ::request::{self as basic_request, Response}; diff --git a/ethcore/light/src/provider.rs b/ethcore/light/src/provider.rs index 2e05157ad..14046d774 100644 --- a/ethcore/light/src/provider.rs +++ b/ethcore/light/src/provider.rs @@ -24,7 +24,7 @@ use ethcore::client::{BlockChainClient, ProvingBlockChainClient}; use ethcore::transaction::PendingTransaction; use ethcore::ids::BlockId; use ethcore::encoded; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::RwLock; use cht::{self, BlockInfo}; diff --git a/ethcore/light/src/transaction_queue.rs b/ethcore/light/src/transaction_queue.rs index 7f67c3718..b3f573772 100644 --- a/ethcore/light/src/transaction_queue.rs +++ b/ethcore/light/src/transaction_queue.rs @@ -28,9 +28,8 @@ use std::collections::hash_map::Entry; use ethcore::error::{TransactionError, TransactionImportResult}; use ethcore::transaction::{Condition, PendingTransaction, SignedTransaction}; -use bigint::prelude::U256; -use bigint::hash::{H256, H256FastMap}; -use util::Address; +use ethereum_types::{H256, U256, Address}; +use plain_hasher::H256FastMap; // Knowledge of an account's current nonce. #[derive(Debug, Clone, PartialEq, Eq)] @@ -331,7 +330,7 @@ impl TransactionQueue { #[cfg(test)] mod tests { use super::TransactionQueue; - use util::Address; + use ethereum_types::Address; use ethcore::transaction::{Transaction, PendingTransaction, Condition}; #[test] diff --git a/ethcore/light/src/types/request/batch.rs b/ethcore/light/src/types/request/batch.rs index df9dad1ad..21f126467 100644 --- a/ethcore/light/src/types/request/batch.rs +++ b/ethcore/light/src/types/request/batch.rs @@ -211,7 +211,7 @@ impl DerefMut for Batch { mod tests { use request::*; use super::Builder; - use bigint::hash::H256; + use ethereum_types::H256; #[test] fn all_scalar() { diff --git a/ethcore/light/src/types/request/mod.rs b/ethcore/light/src/types/request/mod.rs index 2754e37eb..bd19d7e96 100644 --- a/ethcore/light/src/types/request/mod.rs +++ b/ethcore/light/src/types/request/mod.rs @@ -17,7 +17,7 @@ //! Light protocol request types. use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp}; -use bigint::hash::H256; +use ethereum_types::H256; mod batch; @@ -786,8 +786,7 @@ pub mod header { pub mod header_proof { use super::{Field, NoSuchOutput, OutputKind, Output}; use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp}; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; use bytes::Bytes; /// Potentially incomplete header proof request. @@ -882,7 +881,7 @@ pub mod header_proof { /// Request and response for transaction index. pub mod transaction_index { use super::{Field, NoSuchOutput, OutputKind, Output}; - use bigint::hash::H256; + use ethereum_types::H256; /// Potentially incomplete transaction index request. #[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] @@ -960,7 +959,7 @@ pub mod transaction_index { pub mod block_receipts { use super::{Field, NoSuchOutput, OutputKind, Output}; use ethcore::receipt::Receipt; - use bigint::hash::H256; + use ethereum_types::H256; /// Potentially incomplete block receipts request. #[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] @@ -1029,7 +1028,7 @@ pub mod block_body { use super::{Field, NoSuchOutput, OutputKind, Output}; use ethcore::encoded; use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp}; - use bigint::hash::H256; + use ethereum_types::H256; /// Potentially incomplete block body request. #[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] @@ -1117,8 +1116,7 @@ pub mod block_body { /// A request for an account proof. pub mod account { use super::{Field, NoSuchOutput, OutputKind, Output}; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; use bytes::Bytes; /// Potentially incomplete request for an account proof. @@ -1218,7 +1216,7 @@ pub mod account { /// A request for a storage proof. pub mod storage { use super::{Field, NoSuchOutput, OutputKind, Output}; - use bigint::hash::H256; + use ethereum_types::H256; use bytes::Bytes; /// Potentially incomplete request for an storage proof. @@ -1327,7 +1325,7 @@ pub mod storage { /// A request for contract code. pub mod contract_code { use super::{Field, NoSuchOutput, OutputKind, Output}; - use bigint::hash::H256; + use ethereum_types::H256; use bytes::Bytes; /// Potentially incomplete contract code request. @@ -1414,9 +1412,8 @@ pub mod execution { use super::{Field, NoSuchOutput, OutputKind, Output}; use ethcore::transaction::Action; use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp}; - use bigint::prelude::U256; - use bigint::hash::H256; - use util::{Address, DBValue}; + use ethereum_types::{H256, U256, Address}; + use kvdb::DBValue; use bytes::Bytes; /// Potentially incomplete execution proof request. @@ -1540,7 +1537,7 @@ pub mod execution { pub mod epoch_signal { use super::{Field, NoSuchOutput, OutputKind, Output}; use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp}; - use bigint::hash::H256; + use ethereum_types::H256; use bytes::Bytes; /// Potentially incomplete epoch signal request. @@ -1725,7 +1722,7 @@ mod tests { let full_req = Request::TransactionIndex(req.clone()); let res = TransactionIndexResponse { num: 1000, - hash: ::bigint::hash::H256::random(), + hash: ::ethereum_types::H256::random(), index: 4, }; let full_res = Response::TransactionIndex(res.clone()); @@ -1848,7 +1845,7 @@ mod tests { #[test] fn execution_roundtrip() { - use util::DBValue; + use kvdb::DBValue; let req = IncompleteExecutionRequest { block_hash: Field::Scalar(Default::default()), diff --git a/ethcore/native_contracts/Cargo.toml b/ethcore/native_contracts/Cargo.toml index 2cc88fcdc..34460a5cb 100644 --- a/ethcore/native_contracts/Cargo.toml +++ b/ethcore/native_contracts/Cargo.toml @@ -9,7 +9,7 @@ build = "build.rs" ethabi = "4.0" futures = "0.1" byteorder = "1.0" -ethcore-bigint = { path = "../../util/bigint" } +ethereum-types = "0.1" [build-dependencies] native-contract-generator = { path = "generator" } diff --git a/ethcore/native_contracts/generator/src/lib.rs b/ethcore/native_contracts/generator/src/lib.rs index 5986bded4..f8caf0467 100644 --- a/ethcore/native_contracts/generator/src/lib.rs +++ b/ethcore/native_contracts/generator/src/lib.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . //! Rust code contract generator. -//! The code generated will require a dependence on the `ethcore-bigint::prelude`, +//! The code generated will require a dependence on the `ethcore-ethereum_types`, //! `ethabi`, `byteorder`, and `futures` crates. //! This currently isn't hygienic, so compilation of generated code may fail //! due to missing crates or name collisions. This will change when @@ -47,7 +47,7 @@ pub fn generate_module(struct_name: &str, abi: &str) -> Result { use byteorder::{{BigEndian, ByteOrder}}; use futures::{{future, Future, IntoFuture}}; use ethabi::{{Bytes, Contract, Token, Event}}; -use bigint; +use ethereum_types; type BoxFuture = Box + Send>; @@ -56,7 +56,7 @@ type BoxFuture = Box + Send>; pub struct {name} {{ contract: Contract, /// Address to make calls to. - pub address: bigint::prelude::H160, + pub address: ethereum_types::H160, }} const ABI: &'static str = r#"{abi_str}"#; @@ -64,7 +64,7 @@ const ABI: &'static str = r#"{abi_str}"#; impl {name} {{ /// Create a new instance of `{name}` with an address. /// Calls can be made, given a callback for dispatching calls asynchronously. - pub fn new(address: bigint::prelude::H160) -> Self {{ + pub fn new(address: ethereum_types::H160) -> Self {{ let contract = Contract::load(ABI.as_bytes()) .expect("ABI checked at generation-time; qed"); {name} {{ @@ -109,7 +109,7 @@ fn generate_functions(contract: &Contract) -> Result { /// Outputs: {abi_outputs:?} pub fn {snake_name}(&self, call: F, {params}) -> BoxFuture<{output_type}, String> where - F: FnOnce(bigint::prelude::H160, Vec) -> U, + F: FnOnce(ethereum_types::H160, Vec) -> U, U: IntoFuture, Error=String>, U::Future: Send + 'static {{ @@ -231,8 +231,8 @@ fn output_params_codegen(outputs: &[ParamType]) -> Result<(String, String), Para // create code for an argument type from param type. fn rust_type(input: ParamType) -> Result { Ok(match input { - ParamType::Address => "bigint::prelude::H160".into(), - ParamType::FixedBytes(len) if len <= 32 => format!("bigint::prelude::H{}", len * 8), + ParamType::Address => "ethereum_types::H160".into(), + ParamType::FixedBytes(len) if len <= 32 => format!("ethereum_types::H{}", len * 8), ParamType::Bytes | ParamType::FixedBytes(_) => "Vec".into(), ParamType::Int(width) => match width { 8 | 16 | 32 | 64 => format!("i{}", width), @@ -240,7 +240,7 @@ fn rust_type(input: ParamType) -> Result { }, ParamType::Uint(width) => match width { 8 | 16 | 32 | 64 => format!("u{}", width), - 128 | 160 | 256 => format!("bigint::prelude::U{}", width), + 128 | 160 | 256 => format!("ethereum_types::U{}", width), _ => return Err(ParamType::Uint(width)), }, ParamType::Bool => "bool".into(), @@ -273,8 +273,8 @@ fn tokenize(name: &str, input: ParamType) -> (bool, String) { }, ParamType::Uint(width) => format!( "let mut r = [0; 32]; {}.to_big_endian(&mut r); Token::Uint(r)", - if width <= 64 { format!("bigint::prelude::U256::from({} as u64)", name) } - else { format!("bigint::prelude::U256::from({})", name) } + if width <= 64 { format!("ethereum_types::U256::from({} as u64)", name) } + else { format!("ethereum_types::U256::from({})", name) } ), ParamType::Bool => format!("Token::Bool({})", name), ParamType::String => format!("Token::String({})", name), @@ -295,11 +295,11 @@ fn tokenize(name: &str, input: ParamType) -> (bool, String) { // panics on unsupported types. fn detokenize(name: &str, output_type: ParamType) -> String { match output_type { - ParamType::Address => format!("{}.to_address().map(bigint::prelude::H160)", name), + ParamType::Address => format!("{}.to_address().map(ethereum_types::H160)", name), ParamType::Bytes => format!("{}.to_bytes()", name), ParamType::FixedBytes(len) if len <= 32 => { // ensure no panic on slice too small. - let read_hash = format!("b.resize({}, 0); bigint::prelude::H{}::from_slice(&b[..{}])", + let read_hash = format!("b.resize({}, 0); ethereum_types::H{}::from_slice(&b[..{}])", len, len * 8, len); format!("{}.to_fixed_bytes().map(|mut b| {{ {} }})", @@ -318,7 +318,7 @@ fn detokenize(name: &str, output_type: ParamType) -> String { let read_uint = match width { 8 => "u[31] as u8".into(), 16 | 32 | 64 => format!("BigEndian::read_u{}(&u[{}..])", width, 32 - (width / 8)), - _ => format!("bigint::prelude::U{}::from(&u[..])", width), + _ => format!("ethereum_types::U{}::from(&u[..])", width), }; format!("{}.to_uint().map(|u| {})", name, read_uint) @@ -343,30 +343,30 @@ mod tests { #[test] fn input_types() { assert_eq!(::input_params_codegen(&[]).unwrap().0, ""); - assert_eq!(::input_params_codegen(&[ParamType::Address]).unwrap().0, "param_0: bigint::prelude::H160, "); + assert_eq!(::input_params_codegen(&[ParamType::Address]).unwrap().0, "param_0: ethereum_types::H160, "); assert_eq!(::input_params_codegen(&[ParamType::Address, ParamType::Bytes]).unwrap().0, - "param_0: bigint::prelude::H160, param_1: Vec, "); + "param_0: ethereum_types::H160, param_1: Vec, "); } #[test] fn output_types() { assert_eq!(::output_params_codegen(&[]).unwrap().0, "()"); - assert_eq!(::output_params_codegen(&[ParamType::Address]).unwrap().0, "(bigint::prelude::H160)"); + assert_eq!(::output_params_codegen(&[ParamType::Address]).unwrap().0, "(ethereum_types::H160)"); assert_eq!(::output_params_codegen(&[ParamType::Address, ParamType::Array(Box::new(ParamType::Bytes))]).unwrap().0, - "(bigint::prelude::H160, Vec>)"); + "(ethereum_types::H160, Vec>)"); } #[test] fn rust_type() { - assert_eq!(::rust_type(ParamType::FixedBytes(32)).unwrap(), "bigint::prelude::H256"); + assert_eq!(::rust_type(ParamType::FixedBytes(32)).unwrap(), "ethereum_types::H256"); assert_eq!(::rust_type(ParamType::Array(Box::new(ParamType::FixedBytes(32)))).unwrap(), - "Vec"); + "Vec"); assert_eq!(::rust_type(ParamType::Uint(64)).unwrap(), "u64"); assert!(::rust_type(ParamType::Uint(63)).is_err()); assert_eq!(::rust_type(ParamType::Int(32)).unwrap(), "i32"); - assert_eq!(::rust_type(ParamType::Uint(256)).unwrap(), "bigint::prelude::U256"); + assert_eq!(::rust_type(ParamType::Uint(256)).unwrap(), "ethereum_types::U256"); } // codegen tests will need bootstrapping of some kind. diff --git a/ethcore/native_contracts/src/lib.rs b/ethcore/native_contracts/src/lib.rs index 2138c1976..be8b84085 100644 --- a/ethcore/native_contracts/src/lib.rs +++ b/ethcore/native_contracts/src/lib.rs @@ -21,7 +21,7 @@ extern crate futures; extern crate byteorder; extern crate ethabi; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; mod key_server_set; mod registry; diff --git a/ethcore/node_filter/Cargo.toml b/ethcore/node_filter/Cargo.toml index 7879074ff..2cf5a5c54 100644 --- a/ethcore/node_filter/Cargo.toml +++ b/ethcore/node_filter/Cargo.toml @@ -8,10 +8,9 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = ".."} -ethcore-util = { path = "../../util" } -ethcore-bigint = { path = "../../util/bigint" } ethcore-bytes = { path = "../../util/bytes" } ethcore-network = { path = "../../util/network" } +ethereum-types = "0.1" native-contracts = { path = "../native_contracts" } futures = "0.1" log = "0.3" diff --git a/ethcore/node_filter/src/lib.rs b/ethcore/node_filter/src/lib.rs index d2c64cb39..1cc83c6ca 100644 --- a/ethcore/node_filter/src/lib.rs +++ b/ethcore/node_filter/src/lib.rs @@ -17,10 +17,9 @@ //! Smart contract based node filter. extern crate ethcore; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate ethcore_network as network; +extern crate ethereum_types; extern crate native_contracts; extern crate futures; extern crate parking_lot; @@ -38,8 +37,7 @@ use std::collections::HashMap; use native_contracts::PeerSet as Contract; use network::{NodeId, ConnectionFilter, ConnectionDirection}; use ethcore::client::{BlockChainClient, BlockId, ChainNotify}; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use bytes::Bytes; use parking_lot::Mutex; use futures::Future; @@ -129,7 +127,7 @@ mod test { use ethcore::spec::Spec; use ethcore::client::{BlockChainClient, Client, ClientConfig}; use ethcore::miner::Miner; - use util::{Address}; + use ethereum_types::Address; use network::{ConnectionDirection, ConnectionFilter, NodeId}; use io::IoChannel; use super::NodeFilter; diff --git a/ethcore/src/account_db.rs b/ethcore/src/account_db.rs index 5ebf3f47a..4e715766d 100644 --- a/ethcore/src/account_db.rs +++ b/ethcore/src/account_db.rs @@ -17,10 +17,14 @@ //! DB backend wrapper for Account trie use std::collections::HashMap; use hash::{KECCAK_NULL_RLP, keccak}; -use bigint::hash::H256; -use util::*; +use ethereum_types::H256; +use kvdb::DBValue; +use hashdb::HashDB; use rlp::NULL_RLP; +#[cfg(test)] +use ethereum_types::Address; + // combines a key with an address hash to ensure uniqueness. // leaves the first 96 bits untouched in order to support partial key lookup. #[inline] diff --git a/ethcore/src/account_provider/mod.rs b/ethcore/src/account_provider/mod.rs index 0241179a8..d31ded682 100755 --- a/ethcore/src/account_provider/mod.rs +++ b/ethcore/src/account_provider/mod.rs @@ -840,7 +840,7 @@ mod tests { use std::time::Instant; use ethstore::ethkey::{Generator, Random, Address}; use ethstore::{StoreAccountRef, Derivation}; - use bigint::hash::H256; + use ethereum_types::H256; #[test] fn unlock_account_temp() { diff --git a/ethcore/src/basic_types.rs b/ethcore/src/basic_types.rs index e7f372352..59be3a1a0 100644 --- a/ethcore/src/basic_types.rs +++ b/ethcore/src/basic_types.rs @@ -17,10 +17,10 @@ //! Ethcore basic typenames. /// Type for a 2048-bit log-bloom, as used by our blocks. -pub type LogBloom = ::log_entry::LogBloom; +pub use ethereum_types::LogBloom; /// Constant 2048-bit datum for 0. Often used as a default. -pub static ZERO_LOGBLOOM: LogBloom = ::bigint::hash::H2048([0x00; 256]); +pub static ZERO_LOGBLOOM: LogBloom = ::ethereum_types::H2048([0x00; 256]); /// Semantic boolean for when a seal/signature is included. pub enum Seal { diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs index 2925f8d44..58f2d0484 100644 --- a/ethcore/src/block.rs +++ b/ethcore/src/block.rs @@ -23,9 +23,7 @@ use hash::{keccak, KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP}; use triehash::ordered_trie_root; use rlp::{UntrustedRlp, RlpStream, Encodable, Decodable, DecoderError}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use bytes::Bytes; use unexpected::{Mismatch, OutOfBounds}; @@ -723,7 +721,7 @@ mod tests { use factory::Factories; use state_db::StateDB; use views::BlockView; - use util::Address; + use ethereum_types::Address; use std::sync::Arc; use transaction::SignedTransaction; diff --git a/ethcore/src/blockchain/best_block.rs b/ethcore/src/blockchain/best_block.rs index baf8819c5..7c0b62943 100644 --- a/ethcore/src/blockchain/best_block.rs +++ b/ethcore/src/blockchain/best_block.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use bytes::Bytes; use header::BlockNumber; diff --git a/ethcore/src/blockchain/block_info.rs b/ethcore/src/blockchain/block_info.rs index d1e643792..ade08c7d2 100644 --- a/ethcore/src/blockchain/block_info.rs +++ b/ethcore/src/blockchain/block_info.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use header::BlockNumber; /// Brief info about inserted block. diff --git a/ethcore/src/blockchain/blockchain.rs b/ethcore/src/blockchain/blockchain.rs index cdd8f82c3..2594950a6 100644 --- a/ethcore/src/blockchain/blockchain.rs +++ b/ethcore/src/blockchain/blockchain.rs @@ -22,8 +22,7 @@ use std::mem; use itertools::Itertools; use bloomchain as bc; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::{H256, H2048}; +use ethereum_types::{H256, H2048, U256}; use parking_lot::{Mutex, RwLock}; use bytes::Bytes; use rlp::*; @@ -634,7 +633,7 @@ impl BlockChain { return None; } if let Some(extras) = self.db.read(db::COL_EXTRA, &best_block_hash) as Option { - type DetailsKey = Key; + type DetailsKey = Key; batch.delete(db::COL_EXTRA, &(DetailsKey::key(&best_block_hash))); let hash = extras.parent; let range = extras.number as bc::Number .. extras.number as bc::Number; @@ -1479,7 +1478,7 @@ mod tests { use hash::keccak; use kvdb::KeyValueDB; use kvdb_memorydb; - use bigint::hash::*; + use ethereum_types::*; use receipt::{Receipt, TransactionOutcome}; use blockchain::{BlockProvider, BlockChain, Config, ImportRoute}; use tests::helpers::*; diff --git a/ethcore/src/blockchain/extras.rs b/ethcore/src/blockchain/extras.rs index 6184a2f47..d49d5c8d5 100644 --- a/ethcore/src/blockchain/extras.rs +++ b/ethcore/src/blockchain/extras.rs @@ -26,8 +26,7 @@ use header::BlockNumber; use receipt::Receipt; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::{H256, H264}; +use ethereum_types::{H256, H264, U256}; use kvdb::PREFIX_LEN as DB_PREFIX_LEN; /// Represents index of extra data in database diff --git a/ethcore/src/blockchain/generator/block.rs b/ethcore/src/blockchain/generator/block.rs index 4aba039a3..e84896d37 100644 --- a/ethcore/src/blockchain/generator/block.rs +++ b/ethcore/src/blockchain/generator/block.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use rlp::*; -use bigint::hash::{H256, H2048}; +use ethereum_types::{H256, H2048}; use bytes::Bytes; use header::Header; use transaction::SignedTransaction; diff --git a/ethcore/src/blockchain/generator/bloom.rs b/ethcore/src/blockchain/generator/bloom.rs index bb83ff1af..73896655c 100644 --- a/ethcore/src/blockchain/generator/bloom.rs +++ b/ethcore/src/blockchain/generator/bloom.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H2048; +use ethereum_types::H2048; pub trait WithBloom { fn with_bloom(self, bloom: H2048) -> Self where Self: Sized; diff --git a/ethcore/src/blockchain/generator/complete.rs b/ethcore/src/blockchain/generator/complete.rs index 7b9bc572a..160f0f484 100644 --- a/ethcore/src/blockchain/generator/complete.rs +++ b/ethcore/src/blockchain/generator/complete.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; use views::BlockView; diff --git a/ethcore/src/blockchain/generator/generator.rs b/ethcore/src/blockchain/generator/generator.rs index 967fc37fd..8a57d4887 100644 --- a/ethcore/src/blockchain/generator/generator.rs +++ b/ethcore/src/blockchain/generator/generator.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; -use bigint::hash::H2048; +use ethereum_types::{H2048, U256}; use bytes::Bytes; use header::BlockNumber; use transaction::SignedTransaction; @@ -112,7 +111,7 @@ impl Iterator for ChainGenerator { } mod tests { - use bigint::hash::{H256, H2048}; + use ethereum_types::{H256, H2048}; use views::BlockView; use blockchain::generator::{ChainIterator, ChainGenerator, BlockFinalizer}; diff --git a/ethcore/src/blockchain/import_route.rs b/ethcore/src/blockchain/import_route.rs index ebd1454b4..cf5d3ca1e 100644 --- a/ethcore/src/blockchain/import_route.rs +++ b/ethcore/src/blockchain/import_route.rs @@ -16,7 +16,7 @@ //! Import route. -use bigint::hash::H256; +use ethereum_types::H256; use blockchain::block_info::{BlockInfo, BlockLocation}; /// Import route for newly inserted block. @@ -67,8 +67,7 @@ impl From for ImportRoute { #[cfg(test)] mod tests { - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; use blockchain::block_info::{BlockInfo, BlockLocation, BranchBecomingCanonChainData}; use blockchain::ImportRoute; diff --git a/ethcore/src/blockchain/update.rs b/ethcore/src/blockchain/update.rs index 10a6fcd06..a54fed052 100644 --- a/ethcore/src/blockchain/update.rs +++ b/ethcore/src/blockchain/update.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; -use bigint::hash::H256; +use ethereum_types::H256; use header::BlockNumber; use blockchain::block_info::BlockInfo; use blooms::BloomGroup; diff --git a/ethcore/src/builtin.rs b/ethcore/src/builtin.rs index ab3144ce4..c18e1f3cd 100644 --- a/ethcore/src/builtin.rs +++ b/ethcore/src/builtin.rs @@ -24,8 +24,7 @@ use crypto::digest::Digest; use num::{BigUint, Zero, One}; use hash::keccak; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use bytes::BytesRef; use ethkey::{Signature, recover as ec_recover}; use ethjson; @@ -551,7 +550,7 @@ impl Bn128PairingImpl { mod tests { use super::{Builtin, Linear, ethereum_builtin, Pricer, ModexpPricer, modexp as me}; use ethjson; - use bigint::prelude::U256; + use ethereum_types::U256; use bytes::BytesRef; use rustc_hex::FromHex; use num::{BigUint, Zero, One}; diff --git a/ethcore/src/client/chain_notify.rs b/ethcore/src/client/chain_notify.rs index 5dd2861ae..d05c95b8c 100644 --- a/ethcore/src/client/chain_notify.rs +++ b/ethcore/src/client/chain_notify.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; /// Represents what has to be handled by actor listening to chain events diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index ff8df21e5..1b8e084e9 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -26,15 +26,13 @@ use itertools::Itertools; use hash::keccak; use timer::PerfTimer; use bytes::Bytes; -use util::{Address, DBValue}; use journaldb; use util_error::UtilError; use trie::{TrieSpec, TrieFactory, Trie}; -use kvdb::{KeyValueDB, DBTransaction}; +use kvdb::{DBValue, KeyValueDB, DBTransaction}; // other -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, Address, U256}; use basic_types::Seal; use block::*; use blockchain::{BlockChain, BlockProvider, TreeRoute, ImportRoute}; diff --git a/ethcore/src/client/evm_test_client.rs b/ethcore/src/client/evm_test_client.rs index 814e119ba..27cf80d29 100644 --- a/ethcore/src/client/evm_test_client.rs +++ b/ethcore/src/client/evm_test_client.rs @@ -18,8 +18,7 @@ use std::fmt; use std::sync::Arc; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use journaldb; use {trie, kvdb_memorydb, bytes}; use kvdb::{self, KeyValueDB}; diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index 6965e1bd3..62cedfb9d 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -23,11 +23,10 @@ use std::mem; use itertools::Itertools; use rustc_hex::FromHex; use hash::keccak; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256, Address}; use parking_lot::RwLock; use journaldb; -use util::{Address, DBValue}; +use kvdb::DBValue; use kvdb_rocksdb::{Database, DatabaseConfig}; use bytes::Bytes; use rlp::*; diff --git a/ethcore/src/client/trace.rs b/ethcore/src/client/trace.rs index dfe8e30b7..4236aeaf4 100644 --- a/ethcore/src/client/trace.rs +++ b/ethcore/src/client/trace.rs @@ -1,7 +1,7 @@ //! Bridge between Tracedb and Blockchain. -use bigint::hash::H256; +use ethereum_types::H256; use header::BlockNumber; use trace::DatabaseExtras as TraceDatabaseExtras; use blockchain::{BlockChain, BlockProvider}; diff --git a/ethcore/src/client/traits.rs b/ethcore/src/client/traits.rs index e0b3a3e74..52622793d 100644 --- a/ethcore/src/client/traits.rs +++ b/ethcore/src/client/traits.rs @@ -33,9 +33,7 @@ use trace::LocalizedTrace; use transaction::{LocalizedTransaction, PendingTransaction, SignedTransaction}; use verification::queue::QueueInfo as BlockQueueInfo; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use bytes::Bytes; use hashdb::DBValue; diff --git a/ethcore/src/encoded.rs b/ethcore/src/encoded.rs index 27aca1426..82452c467 100644 --- a/ethcore/src/encoded.rs +++ b/ethcore/src/encoded.rs @@ -30,9 +30,7 @@ use views; use hash::keccak; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::{H256, H2048}; -use util::Address; +use ethereum_types::{H256, H2048, U256, Address}; use rlp::Rlp; /// Owning header view. diff --git a/ethcore/src/engines/authority_round/finality.rs b/ethcore/src/engines/authority_round/finality.rs index 72ff5af92..fbfaba0f0 100644 --- a/ethcore/src/engines/authority_round/finality.rs +++ b/ethcore/src/engines/authority_round/finality.rs @@ -19,8 +19,7 @@ use std::collections::{VecDeque}; use std::collections::hash_map::{HashMap, Entry}; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use engines::validator_set::SimpleList; @@ -150,8 +149,7 @@ impl<'a> Iterator for Iter<'a> { #[cfg(test)] mod tests { - use bigint::hash::H256; - use util::Address; + use ethereum_types::{H256, Address}; use super::RollingFinality; #[test] diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index 75df50e43..a7db887f0 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -39,12 +39,10 @@ use ethkey::{verify_address, Signature}; use io::{IoContext, IoHandler, TimerToken, IoService}; use itertools::{self, Itertools}; use rlp::{UntrustedRlp, encode}; -use bigint::prelude::{U256, U128}; -use bigint::hash::{H256, H520}; +use ethereum_types::{H256, H520, Address, U128, U256}; use semantic_version::SemanticVersion; use parking_lot::{Mutex, RwLock}; use unexpected::{Mismatch, OutOfBounds}; -use util::*; use bytes::Bytes; mod finality; @@ -909,8 +907,7 @@ mod tests { use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering}; use hash::keccak; - use bigint::prelude::U256; - use bigint::hash::H520; + use ethereum_types::{H520, U256}; use header::Header; use rlp::encode; use block::*; diff --git a/ethcore/src/engines/basic_authority.rs b/ethcore/src/engines/basic_authority.rs index 8aedbff72..a76c1308e 100644 --- a/ethcore/src/engines/basic_authority.rs +++ b/ethcore/src/engines/basic_authority.rs @@ -17,9 +17,8 @@ //! A blockchain engine that supports a basic, non-BFT proof-of-authority. use std::sync::{Weak, Arc}; -use bigint::hash::{H256, H520}; +use ethereum_types::{H256, H520, Address}; use parking_lot::RwLock; -use util::*; use ethkey::{recover, public_to_address, Signature}; use account_provider::AccountProvider; use block::*; @@ -200,7 +199,7 @@ impl Engine for BasicAuthority { mod tests { use std::sync::Arc; use hash::keccak; - use bigint::hash::H520; + use ethereum_types::H520; use block::*; use tests::helpers::*; use account_provider::AccountProvider; diff --git a/ethcore/src/engines/epoch.rs b/ethcore/src/engines/epoch.rs index c765f727d..dffc822cb 100644 --- a/ethcore/src/engines/epoch.rs +++ b/ethcore/src/engines/epoch.rs @@ -16,7 +16,7 @@ //! Epoch verifiers and transitions. -use bigint::hash::H256; +use ethereum_types::H256; use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp}; diff --git a/ethcore/src/engines/instant_seal.rs b/ethcore/src/engines/instant_seal.rs index 6c6aef415..828d4033f 100644 --- a/ethcore/src/engines/instant_seal.rs +++ b/ethcore/src/engines/instant_seal.rs @@ -55,8 +55,7 @@ impl Engine for InstantSeal #[cfg(test)] mod tests { use std::sync::Arc; - use bigint::hash::H520; - use util::*; + use ethereum_types::{H520, Address}; use tests::helpers::*; use spec::Spec; use header::Header; diff --git a/ethcore/src/engines/mod.rs b/ethcore/src/engines/mod.rs index 88ad68f63..95c9c9ae3 100644 --- a/ethcore/src/engines/mod.rs +++ b/ethcore/src/engines/mod.rs @@ -52,10 +52,8 @@ use transaction::{UnverifiedTransaction, SignedTransaction}; use ethkey::Signature; use parity_machine::{Machine, LocalizedMachine as Localized}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256, Address}; use semantic_version::SemanticVersion; -use util::*; use unexpected::{Mismatch, OutOfBounds}; use bytes::Bytes; @@ -411,7 +409,7 @@ pub mod common { use trace::{Tracer, ExecutiveTracer, RewardType}; use state::CleanupMode; - use bigint::prelude::U256; + use ethereum_types::U256; /// Give reward and trace. pub fn bestow_block_reward(block: &mut ExecutedBlock, reward: U256) -> Result<(), Error> { diff --git a/ethcore/src/engines/null_engine.rs b/ethcore/src/engines/null_engine.rs index cc48a225a..f20a9cdfd 100644 --- a/ethcore/src/engines/null_engine.rs +++ b/ethcore/src/engines/null_engine.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; +use ethereum_types::U256; use engines::Engine; use header::BlockNumber; use parity_machine::{Header, LiveBlock, WithBalances}; diff --git a/ethcore/src/engines/signer.rs b/ethcore/src/engines/signer.rs index ae673cb84..d9e97fee0 100644 --- a/ethcore/src/engines/signer.rs +++ b/ethcore/src/engines/signer.rs @@ -17,8 +17,7 @@ //! A signer used by Engines which need to sign messages. use std::sync::Arc; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use ethkey::Signature; use account_provider::{self, AccountProvider}; diff --git a/ethcore/src/engines/tendermint/message.rs b/ethcore/src/engines/tendermint/message.rs index 5fec4f737..1f71f41bc 100644 --- a/ethcore/src/engines/tendermint/message.rs +++ b/ethcore/src/engines/tendermint/message.rs @@ -18,8 +18,7 @@ use std::cmp; use hash::keccak; -use bigint::hash::{H256, H520}; -use util::*; +use ethereum_types::{H256, H520, Address}; use bytes::Bytes; use super::{Height, View, BlockHash, Step}; use error::Error; diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index af1a5a013..4eb9c5009 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -29,10 +29,8 @@ use std::sync::{Weak, Arc}; use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering}; use std::collections::{HashSet, BTreeMap}; use hash::keccak; -use bigint::prelude::{U128, U256}; -use bigint::hash::{H256, H520}; +use ethereum_types::{H256, H520, U128, U256, Address}; use parking_lot::RwLock; -use util::*; use unexpected::{OutOfBounds, Mismatch}; use client::EngineClient; use bytes::Bytes; @@ -777,7 +775,7 @@ impl Engine for Tendermint { mod tests { use std::str::FromStr; use rustc_hex::FromHex; - use util::*; + use ethereum_types::Address; use bytes::Bytes; use block::*; use error::{Error, BlockError}; diff --git a/ethcore/src/engines/tendermint/params.rs b/ethcore/src/engines/tendermint/params.rs index 9cf1c2a6b..a2f4128d5 100644 --- a/ethcore/src/engines/tendermint/params.rs +++ b/ethcore/src/engines/tendermint/params.rs @@ -18,7 +18,7 @@ use ethjson; use time::Duration; -use bigint::prelude::U256; +use ethereum_types::U256; use super::super::validator_set::{ValidatorSet, new_validator_set}; use super::super::transition::Timeouts; use super::Step; diff --git a/ethcore/src/engines/validator_set/contract.rs b/ethcore/src/engines/validator_set/contract.rs index d156635cc..f3f8ba96c 100644 --- a/ethcore/src/engines/validator_set/contract.rs +++ b/ethcore/src/engines/validator_set/contract.rs @@ -18,9 +18,8 @@ /// It can also report validators for misbehaviour with two levels: `reportMalicious` and `reportBenign`. use std::sync::Weak; -use bigint::hash::H256; +use ethereum_types::{H256, Address}; use parking_lot::RwLock; -use util::*; use bytes::Bytes; use futures::Future; @@ -137,8 +136,7 @@ mod tests { use std::sync::Arc; use rustc_hex::FromHex; use hash::keccak; - use bigint::hash::H520; - use util::*; + use ethereum_types::{H520, Address}; use bytes::ToPretty; use rlp::encode; use spec::Spec; diff --git a/ethcore/src/engines/validator_set/mod.rs b/ethcore/src/engines/validator_set/mod.rs index 8046bcff1..de2164f91 100644 --- a/ethcore/src/engines/validator_set/mod.rs +++ b/ethcore/src/engines/validator_set/mod.rs @@ -25,8 +25,7 @@ mod multi; use std::sync::Weak; use ids::BlockId; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use bytes::Bytes; use ethjson::spec::ValidatorSet as ValidatorSpec; use client::EngineClient; diff --git a/ethcore/src/engines/validator_set/multi.rs b/ethcore/src/engines/validator_set/multi.rs index c46cd2276..b607544cb 100644 --- a/ethcore/src/engines/validator_set/multi.rs +++ b/ethcore/src/engines/validator_set/multi.rs @@ -18,9 +18,8 @@ use std::collections::BTreeMap; use std::sync::Weak; -use bigint::hash::H256; +use ethereum_types::{H256, Address}; use parking_lot::RwLock; -use util::Address; use bytes::Bytes; use ids::BlockId; use header::{BlockNumber, Header}; @@ -158,7 +157,7 @@ mod tests { use spec::Spec; use tests::helpers::{generate_dummy_client_with_spec_and_accounts, generate_dummy_client_with_spec_and_data}; use types::ids::BlockId; - use util::*; + use ethereum_types::Address; use super::Multi; diff --git a/ethcore/src/engines/validator_set/safe_contract.rs b/ethcore/src/engines/validator_set/safe_contract.rs index 3fe9bda6d..f91d6bd94 100644 --- a/ethcore/src/engines/validator_set/safe_contract.rs +++ b/ethcore/src/engines/validator_set/safe_contract.rs @@ -21,15 +21,14 @@ use futures::Future; use native_contracts::ValidatorSet as Provider; use hash::keccak; -use bigint::prelude::U256; -use bigint::hash::{H160, H256}; +use ethereum_types::{H160, H256, U256, Address}; use parking_lot::{Mutex, RwLock}; -use util::*; use bytes::Bytes; use memory_cache::MemoryLruCache; use unexpected::Mismatch; use rlp::{UntrustedRlp, RlpStream}; +use kvdb::DBValue; use basic_types::LogBloom; use client::EngineClient; @@ -471,7 +470,7 @@ mod tests { use std::sync::Arc; use rustc_hex::FromHex; use hash::keccak; - use util::*; + use ethereum_types::Address; use types::ids::BlockId; use spec::Spec; use account_provider::AccountProvider; diff --git a/ethcore/src/engines/validator_set/simple_list.rs b/ethcore/src/engines/validator_set/simple_list.rs index 21ea871b9..bb67c9778 100644 --- a/ethcore/src/engines/validator_set/simple_list.rs +++ b/ethcore/src/engines/validator_set/simple_list.rs @@ -17,8 +17,7 @@ /// Preconfigured validator list. use heapsize::HeapSizeOf; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use machine::{AuxiliaryData, Call, EthereumMachine}; use header::{BlockNumber, Header}; @@ -108,7 +107,7 @@ impl ValidatorSet for SimpleList { #[cfg(test)] mod tests { use std::str::FromStr; - use util::Address; + use ethereum_types::Address; use super::super::ValidatorSet; use super::SimpleList; diff --git a/ethcore/src/engines/validator_set/test.rs b/ethcore/src/engines/validator_set/test.rs index 2e7cbe958..a6b893045 100644 --- a/ethcore/src/engines/validator_set/test.rs +++ b/ethcore/src/engines/validator_set/test.rs @@ -20,8 +20,7 @@ use std::str::FromStr; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering}; use heapsize::HeapSizeOf; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use bytes::Bytes; use machine::{AuxiliaryData, Call, EthereumMachine}; diff --git a/ethcore/src/engines/vote_collector.rs b/ethcore/src/engines/vote_collector.rs index 413d75389..6a4fee3d5 100644 --- a/ethcore/src/engines/vote_collector.rs +++ b/ethcore/src/engines/vote_collector.rs @@ -19,9 +19,8 @@ use std::fmt::Debug; use std::collections::{BTreeMap, HashSet, HashMap}; use std::hash::Hash; -use bigint::hash::{H256, H520}; +use ethereum_types::{H256, H520, Address}; use parking_lot:: RwLock; -use util::*; use bytes::Bytes; use rlp::{Encodable, RlpStream}; @@ -210,8 +209,7 @@ impl VoteCollector { #[cfg(test)] mod tests { use hash::keccak; - use bigint::hash::H160; - use util::*; + use ethereum_types::{H160, H256}; use rlp::*; use super::*; diff --git a/ethcore/src/error.rs b/ethcore/src/error.rs index 6c7dbfa19..33e282447 100644 --- a/ethcore/src/error.rs +++ b/ethcore/src/error.rs @@ -18,9 +18,7 @@ use std::fmt; use kvdb; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::*; +use ethereum_types::{H256, U256, Address}; use util_error::UtilError; use snappy::InvalidInput; use unexpected::{Mismatch, OutOfBounds}; diff --git a/ethcore/src/ethereum/denominations.rs b/ethcore/src/ethereum/denominations.rs index 4364b0296..4892770df 100644 --- a/ethcore/src/ethereum/denominations.rs +++ b/ethcore/src/ethereum/denominations.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; +use ethereum_types::U256; #[inline] /// 1 Ether in Wei diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index 52b4fc108..39b8e5fbc 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -20,9 +20,7 @@ use std::collections::BTreeMap; use std::sync::Arc; use hash::{KECCAK_EMPTY_LIST_RLP}; use ethash::{quick_get_difficulty, slow_hash_block_number, EthashManager, OptimizeFor}; -use bigint::prelude::U256; -use bigint::hash::{H256, H64}; -use util::Address; +use ethereum_types::{H256, H64, U256, Address}; use unexpected::{OutOfBounds, Mismatch}; use block::*; use error::{BlockError, Error}; @@ -472,9 +470,7 @@ fn ecip1017_eras_block_reward(era_rounds: u64, mut reward: U256, block_number:u6 mod tests { use std::str::FromStr; use std::sync::Arc; - use bigint::prelude::U256; - use bigint::hash::{H64, H256}; - use util::*; + use ethereum_types::{H64, H256, U256, Address}; use block::*; use tests::helpers::*; use error::{BlockError, Error}; diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index 2ecef4941..01e812017 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -143,7 +143,7 @@ pub fn new_mcip3_test_machine() -> EthereumMachine { load_machine(include_bytes! #[cfg(test)] mod tests { - use bigint::prelude::U256; + use ethereum_types::U256; use state::*; use super::*; use tests::helpers::*; diff --git a/ethcore/src/executed.rs b/ethcore/src/executed.rs index 5035e5eb8..a78720932 100644 --- a/ethcore/src/executed.rs +++ b/ethcore/src/executed.rs @@ -16,8 +16,7 @@ //! Transaction execution format module. -use bigint::prelude::{U256, U512}; -use util::Address; +use ethereum_types::{U256, U512, Address}; use bytes::Bytes; use trie; use vm; diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index 2c01772b2..b44297c2b 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -18,9 +18,7 @@ use std::cmp; use std::sync::Arc; use hash::keccak; -use bigint::prelude::{U256, U512}; -use bigint::hash::H256; -use util::*; +use ethereum_types::{H256, U256, U512, Address}; use bytes::{Bytes, BytesRef}; use state::{Backend as StateBackend, State, Substate, CleanupMode}; use machine::EthereumMachine as Machine; @@ -702,9 +700,7 @@ mod tests { use rustc_hex::FromHex; use ethkey::{Generator, Random}; use super::*; - use bigint::prelude::{U256, U512}; - use bigint::hash::H256; - use util::Address; + use ethereum_types::{H256, U256, U512, Address}; use bytes::BytesRef; use vm::{ActionParams, ActionValue, CallType, EnvInfo, CreateContractAddress}; use evm::{Factory, VMType}; diff --git a/ethcore/src/externalities.rs b/ethcore/src/externalities.rs index a88eae85f..64d902b53 100644 --- a/ethcore/src/externalities.rs +++ b/ethcore/src/externalities.rs @@ -17,9 +17,7 @@ //! Transaction Execution environment. use std::cmp; use std::sync::Arc; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::*; +use ethereum_types::{H256, U256, Address}; use bytes::{Bytes, BytesRef}; use state::{Backend as StateBackend, State, Substate, CleanupMode}; use machine::EthereumMachine as Machine; @@ -413,7 +411,7 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for Externalities<'a, T, V, B> #[cfg(test)] mod tests { - use util::*; + use ethereum_types::{U256, Address}; use evm::{EnvInfo, Ext, CallType}; use state::{State, Substate}; use tests::helpers::*; diff --git a/ethcore/src/header.rs b/ethcore/src/header.rs index 71c6e6bd3..22efb0617 100644 --- a/ethcore/src/header.rs +++ b/ethcore/src/header.rs @@ -20,9 +20,7 @@ use std::cmp; use std::cell::RefCell; use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP, keccak}; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::*; +use ethereum_types::{H256, U256, Address}; use bytes::Bytes; use basic_types::{LogBloom, ZERO_LOGBLOOM}; use time::get_time; diff --git a/ethcore/src/json_tests/difficulty.rs b/ethcore/src/json_tests/difficulty.rs index eb599ab83..0385764b3 100644 --- a/ethcore/src/json_tests/difficulty.rs +++ b/ethcore/src/json_tests/difficulty.rs @@ -16,7 +16,7 @@ use ethjson; use header::Header; -use bigint::prelude::U256; +use ethereum_types::U256; use spec::Spec; pub fn json_difficulty_test(json_data: &[u8], spec: Spec) -> Vec { diff --git a/ethcore/src/json_tests/test_common.rs b/ethcore/src/json_tests/test_common.rs index 383b52c18..83f6b5527 100644 --- a/ethcore/src/json_tests/test_common.rs +++ b/ethcore/src/json_tests/test_common.rs @@ -14,14 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -pub use bigint::prelude::U256; -pub use bigint::hash::H256; -pub use util::*; use std::collections::HashSet; use std::io::Read; use std::fs::{File, read_dir}; use std::path::Path; use std::ffi::OsString; +pub use ethereum_types::{H256, U256, Address}; pub fn run_test_path(p: &Path, skip: &[&'static str], runner: fn (json_data: &[u8]) -> Vec) { let path = Path::new(p); diff --git a/ethcore/src/json_tests/trie.rs b/ethcore/src/json_tests/trie.rs index f7989bc09..f5803d2d3 100644 --- a/ethcore/src/json_tests/trie.rs +++ b/ethcore/src/json_tests/trie.rs @@ -16,7 +16,7 @@ use ethjson; use trie::{TrieFactory, TrieSpec}; -use bigint::hash::H256; +use ethereum_types::H256; use memorydb::MemoryDB; fn test_trie(json: &[u8], trie: TrieSpec) -> Vec { diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index fdbd35e95..861ffe0a2 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -64,10 +64,10 @@ extern crate ethash; extern crate ethcore_bloom_journal as bloom_journal; extern crate ethcore_devtools as devtools; extern crate ethcore_io as io; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate ethcore_logger; extern crate ethcore_stratum; +extern crate ethereum_types; extern crate ethjson; extern crate ethkey; extern crate futures; @@ -112,7 +112,6 @@ extern crate table; extern crate bloomable; extern crate vm; extern crate wasm; -extern crate ethcore_util as util; extern crate memory_cache; extern crate journaldb; diff --git a/ethcore/src/machine.rs b/ethcore/src/machine.rs index e583cd592..1feb5d547 100644 --- a/ethcore/src/machine.rs +++ b/ethcore/src/machine.rs @@ -32,9 +32,8 @@ use trace::{NoopTracer, NoopVMTracer, Tracer, ExecutiveTracer, RewardType}; use transaction::{SYSTEM_ADDRESS, UnverifiedTransaction, SignedTransaction}; use tx_filter::TransactionFilter; -use bigint::prelude::U256; +use ethereum_types::{U256, Address}; use bytes::BytesRef; -use util::Address; use vm::{CallType, ActionParams, ActionValue, ParamsType}; use vm::{EnvInfo, Schedule, CreateContractAddress}; @@ -489,7 +488,7 @@ mod tests { #[test] fn ethash_gas_limit_is_multiple_of_determinant() { - use bigint::prelude::U256; + use ethereum_types::U256; let spec = ::ethereum::new_homestead_test(); let ethparams = ::tests::helpers::get_default_ethash_extensions(); diff --git a/ethcore/src/migrations/state/v7.rs b/ethcore/src/migrations/state/v7.rs index b7c9211ff..f43ccd0af 100644 --- a/ethcore/src/migrations/state/v7.rs +++ b/ethcore/src/migrations/state/v7.rs @@ -19,8 +19,7 @@ use std::collections::HashMap; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use bytes::Bytes; use kvdb_rocksdb::Database; use migration::{Batch, Config, Error, ErrorKind, Migration, SimpleMigration, Progress}; diff --git a/ethcore/src/migrations/v10.rs b/ethcore/src/migrations/v10.rs index e9317d4a6..8b7ad0e68 100644 --- a/ethcore/src/migrations/v10.rs +++ b/ethcore/src/migrations/v10.rs @@ -24,7 +24,7 @@ use views::HeaderView; use bloom_journal::Bloom; use migration::{Error, Migration, Progress, Batch, Config, ErrorKind}; use journaldb; -use bigint::hash::H256; +use ethereum_types::H256; use trie::Trie; use kvdb::{DBTransaction, ResultExt}; use kvdb_rocksdb::Database; diff --git a/ethcore/src/miner/banning_queue.rs b/ethcore/src/miner/banning_queue.rs index d89c30b86..2f7a49b78 100644 --- a/ethcore/src/miner/banning_queue.rs +++ b/ethcore/src/miner/banning_queue.rs @@ -24,9 +24,7 @@ use transient_hashmap::TransientHashMap; use miner::{TransactionQueue, TransactionQueueDetailsProvider, TransactionImportResult, TransactionOrigin}; use miner::transaction_queue::QueuingInstant; use error::{Error, TransactionError}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use hash::keccak; type Count = u16; @@ -220,8 +218,7 @@ mod tests { use error::{Error, TransactionError}; use client::TransactionImportResult; use miner::{TransactionQueue, TransactionOrigin}; - use bigint::prelude::U256; - use util::Address; + use ethereum_types::{U256, Address}; use miner::transaction_queue::test::DummyTransactionDetailsProvider; fn queue() -> BanningTransactionQueue { diff --git a/ethcore/src/miner/external.rs b/ethcore/src/miner/external.rs index 3ca7a9cc0..601a49447 100644 --- a/ethcore/src/miner/external.rs +++ b/ethcore/src/miner/external.rs @@ -17,8 +17,7 @@ use std::collections::HashMap; use std::sync::Arc; use std::time::{Instant, Duration}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use parking_lot::Mutex; /// External miner interface. @@ -72,8 +71,7 @@ mod tests { use super::*; use std::thread::sleep; use std::time::Duration; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; fn miner() -> ExternalMiner { ExternalMiner::default() diff --git a/ethcore/src/miner/local_transactions.rs b/ethcore/src/miner/local_transactions.rs index 12e14294a..8b9d6e13c 100644 --- a/ethcore/src/miner/local_transactions.rs +++ b/ethcore/src/miner/local_transactions.rs @@ -19,8 +19,7 @@ use linked_hash_map::LinkedHashMap; use transaction::{SignedTransaction, PendingTransaction}; use error::TransactionError; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; /// Status of local transaction. /// Can indicate that the transaction is currently part of the queue (`Pending/Future`) @@ -153,7 +152,7 @@ impl LocalTransactionsList { #[cfg(test)] mod tests { - use bigint::prelude::U256; + use ethereum_types::U256; use ethkey::{Random, Generator}; use transaction::{Action, Transaction, SignedTransaction}; use super::{LocalTransactionsList, Status}; diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index 16d3e94d4..aa91cce44 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -18,10 +18,8 @@ use std::time::{Instant, Duration}; use std::collections::{BTreeMap, HashSet}; use std::sync::Arc; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256, Address}; use parking_lot::{Mutex, RwLock}; -use util::*; use bytes::Bytes; use timer::PerfTimer; use using_queue::{UsingQueue, GetAction}; @@ -1273,7 +1271,7 @@ mod tests { use super::super::{MinerService, PrioritizationStrategy}; use super::*; use block::IsBlock; - use bigint::prelude::U256; + use ethereum_types::U256; use ethkey::{Generator, Random}; use client::{BlockChainClient, TestBlockChainClient, EachBlockWith, TransactionImportResult}; use header::BlockNumber; diff --git a/ethcore/src/miner/mod.rs b/ethcore/src/miner/mod.rs index e82591cf1..a26f03a06 100644 --- a/ethcore/src/miner/mod.rs +++ b/ethcore/src/miner/mod.rs @@ -22,7 +22,6 @@ //! Usage example: //! //! ```rust -//! extern crate ethcore_util as util; //! extern crate ethcore; //! use std::env; //! use ethcore::ethereum; @@ -59,9 +58,7 @@ pub use self::work_notify::NotifyWork; pub use self::stratum::{Stratum, Error as StratumError, Options as StratumOptions}; use std::collections::BTreeMap; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use bytes::Bytes; use client::{MiningBlockChainClient}; use block::ClosedBlock; diff --git a/ethcore/src/miner/service_transaction_checker.rs b/ethcore/src/miner/service_transaction_checker.rs index 2416a63d0..2d20227df 100644 --- a/ethcore/src/miner/service_transaction_checker.rs +++ b/ethcore/src/miner/service_transaction_checker.rs @@ -20,7 +20,7 @@ use types::ids::BlockId; use futures::{future, Future}; use native_contracts::ServiceTransactionChecker as Contract; -use bigint::prelude::U256; +use ethereum_types::U256; use parking_lot::Mutex; const SERVICE_TRANSACTION_CONTRACT_REGISTRY_NAME: &'static str = "service_transaction_checker"; diff --git a/ethcore/src/miner/stratum.rs b/ethcore/src/miner/stratum.rs index 2e353e807..5b9e306b5 100644 --- a/ethcore/src/miner/stratum.rs +++ b/ethcore/src/miner/stratum.rs @@ -25,8 +25,7 @@ use std::sync::{Arc, Weak}; use std::net::{SocketAddr, AddrParseError}; use std::fmt; -use bigint::prelude::U256; -use bigint::hash::{H64, H256, clean_0x}; +use ethereum_types::{H64, H256, clean_0x, U256}; use ethereum::ethash::Ethash; use ethash::SeedHashCompute; use parking_lot::Mutex; diff --git a/ethcore/src/miner/transaction_queue.rs b/ethcore/src/miner/transaction_queue.rs index efc2b4f03..0d7395716 100644 --- a/ethcore/src/miner/transaction_queue.rs +++ b/ethcore/src/miner/transaction_queue.rs @@ -24,14 +24,12 @@ //! # Usage Example //! //! ```rust -//! extern crate ethcore_util as util; -//! extern crate ethcore_bigint as bigint; +//! extern crate ethereum_types; //! extern crate ethcore; //! extern crate ethkey; //! extern crate rustc_hex; //! -//! use bigint::prelude::U256; -//! use util::Address; +//! use ethereum_types::{U256, Address}; //! use ethkey::{Random, Generator}; //! use ethcore::miner::{TransactionQueue, RemovalReason, TransactionQueueDetailsProvider, AccountDetails, TransactionOrigin}; //! use ethcore::transaction::*; @@ -108,9 +106,7 @@ use std::cmp; use std::collections::{HashSet, HashMap, BTreeSet, BTreeMap}; use linked_hash_map::LinkedHashMap; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use table::Table; use transaction::*; use error::{Error, TransactionError}; @@ -1444,7 +1440,7 @@ fn check_if_removed(sender: &Address, nonce: &U256, dropped: Option Bytes { diff --git a/ethcore/src/snapshot/consensus/authority.rs b/ethcore/src/snapshot/consensus/authority.rs index ce15fed95..a6e6ac834 100644 --- a/ethcore/src/snapshot/consensus/authority.rs +++ b/ethcore/src/snapshot/consensus/authority.rs @@ -34,7 +34,7 @@ use snapshot::{Error, ManifestData}; use itertools::{Position, Itertools}; use rlp::{RlpStream, UntrustedRlp}; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use kvdb::KeyValueDB; use bytes::Bytes; @@ -335,7 +335,7 @@ impl Rebuilder for ChunkRebuilder { } } - let parent_td: ::bigint::prelude::U256 = last_rlp.val_at(4)?; + let parent_td: U256 = last_rlp.val_at(4)?; let mut batch = self.db.transaction(); self.chain.insert_unordered_block(&mut batch, &block_data, receipts, Some(parent_td), true, false); diff --git a/ethcore/src/snapshot/consensus/mod.rs b/ethcore/src/snapshot/consensus/mod.rs index bb2f5a5cc..712c245ff 100644 --- a/ethcore/src/snapshot/consensus/mod.rs +++ b/ethcore/src/snapshot/consensus/mod.rs @@ -24,7 +24,7 @@ use blockchain::BlockChain; use engines::EthEngine; use snapshot::{Error, ManifestData}; -use bigint::hash::H256; +use ethereum_types::H256; use kvdb::KeyValueDB; mod authority; diff --git a/ethcore/src/snapshot/consensus/work.rs b/ethcore/src/snapshot/consensus/work.rs index eea2a5cce..f905b9036 100644 --- a/ethcore/src/snapshot/consensus/work.rs +++ b/ethcore/src/snapshot/consensus/work.rs @@ -30,7 +30,7 @@ use blockchain::{BlockChain, BlockProvider}; use engines::EthEngine; use snapshot::{Error, ManifestData}; use snapshot::block::AbridgedBlock; -use bigint::hash::H256; +use ethereum_types::H256; use kvdb::KeyValueDB; use bytes::Bytes; use rlp::{RlpStream, UntrustedRlp}; @@ -223,7 +223,7 @@ impl Rebuilder for PowRebuilder { use basic_types::Seal::With; use views::BlockView; use snapshot::verify_old_block; - use bigint::prelude::U256; + use ethereum_types::U256; use triehash::ordered_trie_root; let rlp = UntrustedRlp::new(chunk); diff --git a/ethcore/src/snapshot/error.rs b/ethcore/src/snapshot/error.rs index bd0cb227b..e149d2120 100644 --- a/ethcore/src/snapshot/error.rs +++ b/ethcore/src/snapshot/error.rs @@ -20,7 +20,7 @@ use std::fmt; use ids::BlockId; -use bigint::hash::H256; +use ethereum_types::H256; use trie::TrieError; use rlp::DecoderError; diff --git a/ethcore/src/snapshot/io.rs b/ethcore/src/snapshot/io.rs index 3f2622296..ff3902942 100644 --- a/ethcore/src/snapshot/io.rs +++ b/ethcore/src/snapshot/io.rs @@ -26,7 +26,7 @@ use std::fs::{self, File}; use std::path::{Path, PathBuf}; use bytes::Bytes; -use bigint::hash::H256; +use ethereum_types::H256; use rlp::{RlpStream, UntrustedRlp}; use super::ManifestData; diff --git a/ethcore/src/snapshot/mod.rs b/ethcore/src/snapshot/mod.rs index 02adb2c16..d3675fe7a 100644 --- a/ethcore/src/snapshot/mod.rs +++ b/ethcore/src/snapshot/mod.rs @@ -30,9 +30,9 @@ use engines::EthEngine; use header::Header; use ids::BlockId; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::{HashDB, DBValue}; +use ethereum_types::{H256, U256}; +use hashdb::HashDB; +use kvdb::DBValue; use snappy; use bytes::Bytes; use parking_lot::Mutex; diff --git a/ethcore/src/snapshot/service.rs b/ethcore/src/snapshot/service.rs index 21e7a6752..0c145b16c 100644 --- a/ethcore/src/snapshot/service.rs +++ b/ethcore/src/snapshot/service.rs @@ -35,7 +35,7 @@ use service::ClientIoMessage; use io::IoChannel; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::{Mutex, RwLock, RwLockReadGuard}; use util_error::UtilError; use bytes::Bytes; @@ -681,7 +681,7 @@ mod tests { #[test] fn cannot_finish_with_invalid_chunks() { - use bigint::hash::H256; + use ethereum_types::H256; use kvdb_rocksdb::DatabaseConfig; let spec = get_test_spec(); diff --git a/ethcore/src/snapshot/tests/helpers.rs b/ethcore/src/snapshot/tests/helpers.rs index ee1238252..6c77c4fd2 100644 --- a/ethcore/src/snapshot/tests/helpers.rs +++ b/ethcore/src/snapshot/tests/helpers.rs @@ -31,9 +31,8 @@ use snapshot::io::{SnapshotReader, PackedWriter, PackedReader}; use devtools::{RandomTempPath, GuardedTempResult}; use rand::Rng; -use util::DBValue; -use kvdb::KeyValueDB; -use bigint::hash::H256; +use kvdb::{KeyValueDB, DBValue}; +use ethereum_types::H256; use hashdb::HashDB; use journaldb; use trie::{Alphabet, StandardMap, SecTrieDBMut, TrieMut, ValueMode}; diff --git a/ethcore/src/snapshot/tests/proof_of_authority.rs b/ethcore/src/snapshot/tests/proof_of_authority.rs index f15954ce8..0bd50505f 100644 --- a/ethcore/src/snapshot/tests/proof_of_authority.rs +++ b/ethcore/src/snapshot/tests/proof_of_authority.rs @@ -30,7 +30,7 @@ use spec::Spec; use tests::helpers; use transaction::{Transaction, Action, SignedTransaction}; -use util::Address; +use ethereum_types::Address; use kvdb_memorydb; const PASS: &'static str = ""; diff --git a/ethcore/src/snapshot/tests/proof_of_work.rs b/ethcore/src/snapshot/tests/proof_of_work.rs index d4df7bb10..bf999d28a 100644 --- a/ethcore/src/snapshot/tests/proof_of_work.rs +++ b/ethcore/src/snapshot/tests/proof_of_work.rs @@ -110,7 +110,7 @@ fn chunk_and_restore_40k() { chunk_and_restore(40000) } #[test] fn checks_flag() { use rlp::RlpStream; - use bigint::hash::H256; + use ethereum_types::H256; let mut stream = RlpStream::new_list(5); diff --git a/ethcore/src/snapshot/tests/state.rs b/ethcore/src/snapshot/tests/state.rs index 213053a68..5f76dfcec 100644 --- a/ethcore/src/snapshot/tests/state.rs +++ b/ethcore/src/snapshot/tests/state.rs @@ -25,7 +25,7 @@ use super::helpers::{compare_dbs, StateProducer}; use error::Error; use rand::{XorShiftRng, SeedableRng}; -use bigint::hash::H256; +use ethereum_types::H256; use journaldb::{self, Algorithm}; use kvdb_rocksdb::{Database, DatabaseConfig}; use memorydb::MemoryDB; @@ -97,8 +97,7 @@ fn snap_and_restore() { fn get_code_from_prev_chunk() { use std::collections::HashSet; use rlp::RlpStream; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; use hashdb::HashDB; use account_db::{AccountDBMut, AccountDB}; diff --git a/ethcore/src/snapshot/traits.rs b/ethcore/src/snapshot/traits.rs index 632a36afa..a81c14f08 100644 --- a/ethcore/src/snapshot/traits.rs +++ b/ethcore/src/snapshot/traits.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use super::{ManifestData, RestorationStatus}; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; /// The interface for a snapshot network service. diff --git a/ethcore/src/snapshot/watcher.rs b/ethcore/src/snapshot/watcher.rs index 6c34cf39d..b3291af7e 100644 --- a/ethcore/src/snapshot/watcher.rs +++ b/ethcore/src/snapshot/watcher.rs @@ -22,7 +22,7 @@ use ids::BlockId; use service::ClientIoMessage; use io::IoChannel; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; use std::sync::Arc; @@ -134,8 +134,7 @@ mod tests { use client::ChainNotify; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; use std::collections::HashMap; diff --git a/ethcore/src/spec/genesis.rs b/ethcore/src/spec/genesis.rs index 0e810f29c..41d9ceb33 100644 --- a/ethcore/src/spec/genesis.rs +++ b/ethcore/src/spec/genesis.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use hash::KECCAK_NULL_RLP; use ethjson; use super::seal::Seal; diff --git a/ethcore/src/spec/seal.rs b/ethcore/src/spec/seal.rs index 7dac32983..32a4d3b83 100644 --- a/ethcore/src/spec/seal.rs +++ b/ethcore/src/spec/seal.rs @@ -17,7 +17,7 @@ //! Spec seal. use rlp::*; -use bigint::hash::{H64, H256, H520}; +use ethereum_types::{H64, H256, H520}; use ethjson; /// Classic ethereum seal. diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index 6f94713ad..97868c79b 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -21,15 +21,14 @@ use std::collections::BTreeMap; use std::path::Path; use std::sync::Arc; -use bigint::hash::{H256, H2048}; -use bigint::prelude::U256; +use ethereum_types::{H256, H2048, U256, Address}; +use memorydb::MemoryDB; use bytes::Bytes; use ethjson; use hash::{KECCAK_NULL_RLP, keccak}; use parking_lot::RwLock; use rlp::{Rlp, RlpStream}; use rustc_hex::FromHex; -use util::*; use vm::{EnvInfo, CallType, ActionValue, ActionParams, ParamsType}; use super::genesis::Genesis; diff --git a/ethcore/src/state/account.rs b/ethcore/src/state/account.rs index f4b6f0b4b..63f14322d 100644 --- a/ethcore/src/state/account.rs +++ b/ethcore/src/state/account.rs @@ -20,9 +20,9 @@ use std::fmt; use std::sync::Arc; use std::collections::HashMap; use hash::{KECCAK_EMPTY, KECCAK_NULL_RLP, keccak}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::*; +use ethereum_types::{H256, U256, Address}; +use hashdb::HashDB; +use kvdb::DBValue; use bytes::{Bytes, ToPretty}; use trie; use trie::{SecTrieDB, Trie, TrieFactory, TrieError}; @@ -486,7 +486,8 @@ impl fmt::Debug for Account { #[cfg(test)] mod tests { use rlp::{UntrustedRlp, RlpType, Compressible}; - use util::*; + use ethereum_types::{H256, U256, Address}; + use memorydb::MemoryDB; use bytes::Bytes; use super::*; use account_db::*; diff --git a/ethcore/src/state/backend.rs b/ethcore/src/state/backend.rs index 968d0cfd7..1e761506d 100644 --- a/ethcore/src/state/backend.rs +++ b/ethcore/src/state/backend.rs @@ -25,9 +25,9 @@ use std::collections::{HashSet, HashMap}; use std::sync::Arc; use state::Account; -use bigint::hash::H256; use parking_lot::Mutex; -use util::{Address, MemoryDB}; +use ethereum_types::{Address, H256}; +use memorydb::MemoryDB; use hashdb::{AsHashDB, HashDB, DBValue}; /// State backend. See module docs for more details. diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index 532094a4f..c2ea43e9f 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -42,9 +42,9 @@ use transaction::SignedTransaction; use state_db::StateDB; use evm::{Factory as EvmFactory}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::*; +use ethereum_types::{H256, U256, Address}; +use hashdb::{HashDB, AsHashDB}; +use kvdb::DBValue; use bytes::Bytes; use trie; @@ -193,7 +193,7 @@ impl AccountEntry { /// `Err(ExecutionError::Internal)` indicates failure, everything else indicates /// a successful proof (as the transaction itself may be poorly chosen). pub fn check_proof( - proof: &[::util::DBValue], + proof: &[DBValue], root: H256, transaction: &SignedTransaction, machine: &Machine, @@ -1065,9 +1065,7 @@ mod tests { use hash::keccak; use super::*; use ethkey::Secret; - use bigint::prelude::U256; - use bigint::hash::H256; - use util::Address; + use ethereum_types::{H256, U256, Address}; use tests::helpers::*; use machine::EthereumMachine; use vm::EnvInfo; diff --git a/ethcore/src/state/substate.rs b/ethcore/src/state/substate.rs index 5d385089f..e70178a36 100644 --- a/ethcore/src/state/substate.rs +++ b/ethcore/src/state/substate.rs @@ -16,8 +16,7 @@ //! Execution environment substate. use std::collections::HashSet; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use log_entry::LogEntry; use evm::{Schedule, CleanDustMode}; use super::CleanupMode; diff --git a/ethcore/src/state_db.rs b/ethcore/src/state_db.rs index dfb8ef3cb..99ee5ed6e 100644 --- a/ethcore/src/state_db.rs +++ b/ethcore/src/state_db.rs @@ -20,13 +20,12 @@ use lru_cache::LruCache; use memory_cache::MemoryLruCache; use journaldb::JournalDB; use kvdb::{KeyValueDB, DBTransaction}; -use bigint::hash::H256; +use ethereum_types::{H256, Address}; use hashdb::HashDB; use state::{self, Account}; use header::BlockNumber; use hash::keccak; use parking_lot::Mutex; -use util::Address; use util_error::UtilError; use bloom_journal::{Bloom, BloomJournal}; use db::COL_ACCOUNT_BLOOM; @@ -466,9 +465,7 @@ unsafe impl Sync for SyncAccount {} #[cfg(test)] mod tests { - use bigint::prelude::U256; - use bigint::hash::H256; - use util::Address; + use ethereum_types::{H256, U256, Address}; use kvdb::DBTransaction; use tests::helpers::*; use state::{Account, Backend}; diff --git a/ethcore/src/tests/client.rs b/ethcore/src/tests/client.rs index b75f0863a..6dbd98e13 100644 --- a/ethcore/src/tests/client.rs +++ b/ethcore/src/tests/client.rs @@ -25,8 +25,7 @@ use ethereum; use block::IsBlock; use tests::helpers::*; use types::filter::Filter; -use bigint::prelude::U256; -use util::*; +use ethereum_types::{U256, Address}; use kvdb_rocksdb::{Database, DatabaseConfig}; use devtools::*; use miner::Miner; diff --git a/ethcore/src/tests/evm.rs b/ethcore/src/tests/evm.rs index 830fcb5d7..a020b7aa3 100644 --- a/ethcore/src/tests/evm.rs +++ b/ethcore/src/tests/evm.rs @@ -12,8 +12,7 @@ use transaction::SYSTEM_ADDRESS; use rustc_hex::FromHex; -use bigint::hash::H256; -use util::*; +use ethereum_types::{H256, Address}; use bytes::BytesRef; evm_test!{test_blockhash_eip210: test_blockhash_eip210_jit, test_blockhash_eip210_int} diff --git a/ethcore/src/tests/helpers.rs b/ethcore/src/tests/helpers.rs index ead7755e0..626aa8349 100644 --- a/ethcore/src/tests/helpers.rs +++ b/ethcore/src/tests/helpers.rs @@ -15,8 +15,7 @@ // along with Parity. If not, see . use account_provider::AccountProvider; -use bigint::hash::H256; -use bigint::prelude::U256; +use ethereum_types::{H256, U256}; use block::{OpenBlock, Drain}; use blockchain::{BlockChain, Config as BlockChainConfig}; use bytes::Bytes; diff --git a/ethcore/src/tests/trace.rs b/ethcore/src/tests/trace.rs index 57a745a1a..bcfcce55c 100644 --- a/ethcore/src/tests/trace.rs +++ b/ethcore/src/tests/trace.rs @@ -19,8 +19,7 @@ use ethkey::KeyPair; use hash::keccak; use block::*; -use bigint::prelude::U256; -use util::*; +use ethereum_types::{U256, Address}; use io::*; use spec::*; use client::*; diff --git a/ethcore/src/trace/db.rs b/ethcore/src/trace/db.rs index e90eedc4b..321c4daa4 100644 --- a/ethcore/src/trace/db.rs +++ b/ethcore/src/trace/db.rs @@ -21,7 +21,7 @@ use std::sync::Arc; use bloomchain::{Number, Config as BloomConfig}; use bloomchain::group::{BloomGroupDatabase, BloomGroupChain, GroupPosition, BloomGroup}; use heapsize::HeapSizeOf; -use bigint::hash::{H256, H264}; +use ethereum_types::{H256, H264}; use kvdb::{KeyValueDB, DBTransaction}; use parking_lot::RwLock; use header::BlockNumber; @@ -412,9 +412,7 @@ impl TraceDatabase for TraceDB where T: DatabaseExtras { mod tests { use std::collections::HashMap; use std::sync::Arc; - use bigint::prelude::U256; - use bigint::hash::H256; - use util::Address; + use ethereum_types::{H256, U256, Address}; use kvdb::{DBTransaction, KeyValueDB}; use kvdb_memorydb; use header::BlockNumber; diff --git a/ethcore/src/trace/executive_tracer.rs b/ethcore/src/trace/executive_tracer.rs index 2137d679d..70ed981d7 100644 --- a/ethcore/src/trace/executive_tracer.rs +++ b/ethcore/src/trace/executive_tracer.rs @@ -16,8 +16,7 @@ //! Simple executive tracer. -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use bytes::Bytes; use vm::ActionParams; use trace::trace::{Call, Create, Action, Res, CreateResult, CallResult, VMTrace, VMOperation, VMExecutedOperation, MemoryDiff, StorageDiff, Suicide, Reward, RewardType}; diff --git a/ethcore/src/trace/import.rs b/ethcore/src/trace/import.rs index e74e03eea..fb72e220e 100644 --- a/ethcore/src/trace/import.rs +++ b/ethcore/src/trace/import.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . //! Traces import request. -use bigint::hash::H256; +use ethereum_types::H256; use header::BlockNumber; use trace::FlatBlockTraces; diff --git a/ethcore/src/trace/mod.rs b/ethcore/src/trace/mod.rs index 991e434fc..cf9da13d0 100644 --- a/ethcore/src/trace/mod.rs +++ b/ethcore/src/trace/mod.rs @@ -37,9 +37,7 @@ pub use self::types::trace::{VMTrace, VMOperation, VMExecutedOperation, MemoryDi pub use self::types::flat::{FlatTrace, FlatTransactionTraces, FlatBlockTraces}; pub use self::types::filter::{Filter, AddressesFilter}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use kvdb::DBTransaction; use bytes::Bytes; use self::trace::{Call, Create}; diff --git a/ethcore/src/trace/noop_tracer.rs b/ethcore/src/trace/noop_tracer.rs index bff8b9d44..fa9e4ae41 100644 --- a/ethcore/src/trace/noop_tracer.rs +++ b/ethcore/src/trace/noop_tracer.rs @@ -16,8 +16,7 @@ //! Nonoperative tracer. -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use bytes::Bytes; use vm::ActionParams; use trace::{Tracer, VMTracer, FlatTrace, TraceError}; diff --git a/ethcore/src/trace/types/filter.rs b/ethcore/src/trace/types/filter.rs index f7e2d2140..0143ebcf2 100644 --- a/ethcore/src/trace/types/filter.rs +++ b/ethcore/src/trace/types/filter.rs @@ -19,7 +19,7 @@ use std::ops::Range; use bloomchain::{Filter as BloomFilter, Bloom, Number}; use hash::keccak; -use util::Address; +use ethereum_types::Address; use bloomable::Bloomable; use basic_types::LogBloom; use trace::flat::FlatTrace; @@ -138,7 +138,7 @@ impl Filter { #[cfg(test)] mod tests { - use util::Address; + use ethereum_types::Address; use hash::keccak; use bloomable::Bloomable; use trace::trace::{Action, Call, Res, Create, CreateResult, Suicide, Reward}; diff --git a/ethcore/src/trace/types/localized.rs b/ethcore/src/trace/types/localized.rs index f82d710c1..f649e1699 100644 --- a/ethcore/src/trace/types/localized.rs +++ b/ethcore/src/trace/types/localized.rs @@ -16,7 +16,7 @@ //! Localized traces type definitions -use bigint::hash::H256; +use ethereum_types::H256; use super::trace::{Action, Res}; use header::BlockNumber; diff --git a/ethcore/src/trace/types/trace.rs b/ethcore/src/trace/types/trace.rs index efe9ecfa2..d397c9b73 100644 --- a/ethcore/src/trace/types/trace.rs +++ b/ethcore/src/trace/types/trace.rs @@ -16,8 +16,7 @@ //! Tracing datatypes. -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use bytes::Bytes; use hash::keccak; use bloomable::Bloomable; diff --git a/ethcore/src/transaction.rs b/ethcore/src/transaction.rs index 3596f6c21..20f850efc 100644 --- a/ethcore/src/transaction.rs +++ b/ethcore/src/transaction.rs @@ -20,9 +20,7 @@ use std::ops::Deref; use rlp::*; use hash::keccak; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, H160, Address, U256}; use bytes::Bytes; use ethkey::{Signature, Secret, Public, recover, public_to_address, Error as EthkeyError}; use error::*; @@ -31,10 +29,10 @@ use header::BlockNumber; use ethjson; /// Fake address for unsigned transactions as defined by EIP-86. -pub const UNSIGNED_SENDER: Address = ::bigint::hash::H160([0xff; 20]); +pub const UNSIGNED_SENDER: Address = H160([0xff; 20]); /// System sender address for internal state updates. -pub const SYSTEM_ADDRESS: Address = ::bigint::hash::H160([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xfe]); +pub const SYSTEM_ADDRESS: Address = H160([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xfe]); /// Transaction action type. #[derive(Debug, Clone, PartialEq, Eq)] @@ -553,7 +551,7 @@ impl From for PendingTransaction { #[cfg(test)] mod tests { use super::*; - use bigint::prelude::U256; + use ethereum_types::U256; use hash::keccak; #[test] diff --git a/ethcore/src/tx_filter.rs b/ethcore/src/tx_filter.rs index d0bff8dff..a23139898 100644 --- a/ethcore/src/tx_filter.rs +++ b/ethcore/src/tx_filter.rs @@ -18,10 +18,9 @@ use std::collections::HashMap; use std::collections::hash_map::Entry; -use bigint::hash::H256; +use ethereum_types::{H256, Address}; use native_contracts::TransactAcl as Contract; use client::{BlockChainClient, BlockId, ChainNotify}; -use util::Address; use bytes::Bytes; use parking_lot::Mutex; use futures::{self, Future}; @@ -122,7 +121,7 @@ mod test { use spec::Spec; use client::{BlockChainClient, Client, ClientConfig, BlockId}; use miner::Miner; - use util::{Address}; + use ethereum_types::Address; use io::IoChannel; use ethkey::{Secret, KeyPair}; use super::TransactionFilter; diff --git a/ethcore/src/verification/queue/kind.rs b/ethcore/src/verification/queue/kind.rs index c5be79d94..b437dba7a 100644 --- a/ethcore/src/verification/queue/kind.rs +++ b/ethcore/src/verification/queue/kind.rs @@ -20,8 +20,7 @@ use engines::EthEngine; use error::Error; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; pub use self::blocks::Blocks; pub use self::headers::Headers; @@ -75,8 +74,7 @@ pub mod blocks { use verification::{PreverifiedBlock, verify_block_basic, verify_block_unordered}; use heapsize::HeapSizeOf; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; use bytes::Bytes; /// A mode for verifying blocks. @@ -172,8 +170,7 @@ pub mod headers { use header::Header; use verification::verify_header_params; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256}; impl BlockLike for Header { fn hash(&self) -> H256 { self.hash() } diff --git a/ethcore/src/verification/queue/mod.rs b/ethcore/src/verification/queue/mod.rs index 52aca3c4d..ae87ae0b1 100644 --- a/ethcore/src/verification/queue/mod.rs +++ b/ethcore/src/verification/queue/mod.rs @@ -23,8 +23,7 @@ use std::sync::{Condvar as SCondvar, Mutex as SMutex, Arc}; use std::cmp; use std::collections::{VecDeque, HashSet, HashMap}; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use parking_lot::{Condvar, Mutex, RwLock}; use io::*; use error::*; diff --git a/ethcore/src/verification/verification.rs b/ethcore/src/verification/verification.rs index fb9a2b6c0..7ceddad3d 100644 --- a/ethcore/src/verification/verification.rs +++ b/ethcore/src/verification/verification.rs @@ -31,8 +31,7 @@ use header::{BlockNumber, Header}; use transaction::SignedTransaction; use views::BlockView; -use bigint::hash::H256; -use bigint::prelude::U256; +use ethereum_types::{H256, U256}; use bytes::Bytes; use hash::keccak; use heapsize::HeapSizeOf; @@ -335,8 +334,7 @@ fn verify_block_integrity(block: &[u8], transactions_root: &H256, uncles_hash: & mod tests { use std::collections::{BTreeMap, HashMap}; use hash::keccak; - use bigint::prelude::U256; - use bigint::hash::{H256, H2048}; + use ethereum_types::{H256, H2048, U256}; use triehash::ordered_trie_root; use unexpected::{Mismatch, OutOfBounds}; use bytes::Bytes; diff --git a/ethcore/src/views/block.rs b/ethcore/src/views/block.rs index 450b8bafd..abc1f5031 100644 --- a/ethcore/src/views/block.rs +++ b/ethcore/src/views/block.rs @@ -17,7 +17,7 @@ //! View onto block rlp. use hash::keccak; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; use header::*; use transaction::*; @@ -160,7 +160,7 @@ impl<'a> BlockView<'a> { mod tests { use std::str::FromStr; use rustc_hex::FromHex; - use bigint::hash::H256; + use ethereum_types::H256; use super::BlockView; #[test] diff --git a/ethcore/src/views/body.rs b/ethcore/src/views/body.rs index 092732d8a..519b9944f 100644 --- a/ethcore/src/views/body.rs +++ b/ethcore/src/views/body.rs @@ -17,7 +17,7 @@ //! View onto block body rlp. use hash::keccak; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; use header::*; use transaction::*; diff --git a/ethcore/src/views/header.rs b/ethcore/src/views/header.rs index 181a73a5d..8162d4e45 100644 --- a/ethcore/src/views/header.rs +++ b/ethcore/src/views/header.rs @@ -17,9 +17,7 @@ //! View onto block header rlp use hash::keccak; -use bigint::prelude::U256; -use bigint::hash::{H256, H2048}; -use util::Address; +use ethereum_types::{H256, H2048, U256, Address}; use bytes::Bytes; use rlp::{self, Rlp}; use header::BlockNumber; @@ -113,9 +111,7 @@ impl<'a> HeaderView<'a> { mod tests { use std::str::FromStr; use rustc_hex::FromHex; - use bigint::prelude::U256; - use bigint::hash::{H256, H2048}; - use util::Address; + use ethereum_types::{H256, H2048, U256, Address}; use super::HeaderView; #[test] diff --git a/ethcore/src/views/transaction.rs b/ethcore/src/views/transaction.rs index 60bcec90e..52049c1fa 100644 --- a/ethcore/src/views/transaction.rs +++ b/ethcore/src/views/transaction.rs @@ -15,8 +15,7 @@ // along with Parity. If not, see . //! View onto transaction rlp -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use bytes::Bytes; use hash::keccak; use rlp::Rlp; @@ -80,7 +79,7 @@ impl<'a> TransactionView<'a> { mod tests { use std::str::FromStr; use rustc_hex::FromHex; - use bigint::prelude::U256; + use ethereum_types::U256; use super::TransactionView; #[test] diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index 5e037c2a4..e132f4d5d 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -8,8 +8,7 @@ authors = ["Parity Technologies "] rlp = { path = "../../util/rlp" } rlp_derive = { path = "../../util/rlp_derive" } ethcore-bytes = { path = "../../util/bytes" } -ethcore-util = { path = "../../util" } -ethcore-bigint = { path = "../../util/bigint" } +ethereum-types = "0.1" ethjson = { path = "../../json" } bloomable = { path = "../../util/bloomable" } keccak-hash = { path = "../../util/hash" } diff --git a/ethcore/types/src/account_diff.rs b/ethcore/types/src/account_diff.rs index ae1cf3e98..c3edb1fb1 100644 --- a/ethcore/types/src/account_diff.rs +++ b/ethcore/types/src/account_diff.rs @@ -19,8 +19,7 @@ use std::cmp::*; use std::fmt; use std::collections::BTreeMap; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use bytes::Bytes; #[derive(Debug, PartialEq, Eq, Clone)] diff --git a/ethcore/types/src/basic_account.rs b/ethcore/types/src/basic_account.rs index 0e9040fc3..79e75dfc0 100644 --- a/ethcore/types/src/basic_account.rs +++ b/ethcore/types/src/basic_account.rs @@ -16,8 +16,7 @@ //! Basic account type -- the decoded RLP from the state trie. -use bigint::prelude::U256; -use bigint::prelude::H256; +use ethereum_types::{U256, H256}; /// Basic account type. #[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] diff --git a/ethcore/types/src/blockchain_info.rs b/ethcore/types/src/blockchain_info.rs index 87c581508..836ee7618 100644 --- a/ethcore/types/src/blockchain_info.rs +++ b/ethcore/types/src/blockchain_info.rs @@ -18,8 +18,7 @@ use std::fmt; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{U256, H256}; use security_level::SecurityLevel; use {BlockNumber}; diff --git a/ethcore/types/src/filter.rs b/ethcore/types/src/filter.rs index 807ea92cd..b403f638a 100644 --- a/ethcore/types/src/filter.rs +++ b/ethcore/types/src/filter.rs @@ -16,8 +16,7 @@ //! Blockchain filter -use util::Address; -use bigint::hash::{H256, H2048}; +use ethereum_types::{H256, H2048, Address}; use bloomable::Bloomable; use ids::BlockId; use log_entry::LogEntry; diff --git a/ethcore/types/src/ids.rs b/ethcore/types/src/ids.rs index 150bb77b1..ad60b3b38 100644 --- a/ethcore/types/src/ids.rs +++ b/ethcore/types/src/ids.rs @@ -16,7 +16,7 @@ //! Unique identifiers. -use bigint::hash::H256; +use ethereum_types::H256; use {BlockNumber}; /// Uniquely identifies block. diff --git a/ethcore/types/src/lib.rs b/ethcore/types/src/lib.rs index 51e2890d4..cfdbc4643 100644 --- a/ethcore/types/src/lib.rs +++ b/ethcore/types/src/lib.rs @@ -16,8 +16,7 @@ //! Types used in the public API -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate ethcore_bytes as bytes; extern crate ethjson; extern crate rlp; diff --git a/ethcore/types/src/log_entry.rs b/ethcore/types/src/log_entry.rs index ca56107b1..9caa7ff69 100644 --- a/ethcore/types/src/log_entry.rs +++ b/ethcore/types/src/log_entry.rs @@ -19,16 +19,13 @@ use std::ops::Deref; use hash::keccak; use heapsize::HeapSizeOf; -use util::Address; use bytes::Bytes; -use bigint::hash::H256; +use ethereum_types::{H256, Address, LogBloom}; use bloomable::Bloomable; use {BlockNumber}; use ethjson; -pub type LogBloom = ::bigint::hash::H2048; - /// A record of execution for a `LOG` operation. #[derive(Default, Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] pub struct LogEntry { @@ -92,12 +89,12 @@ impl Deref for LocalizedLogEntry { #[cfg(test)] mod tests { - use util::*; + use ethereum_types::{LogBloom, Address}; use super::LogEntry; #[test] fn test_empty_log_bloom() { - let bloom = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".parse::<::bigint::hash::H2048>().unwrap(); + let bloom = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".parse::().unwrap(); let address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse::
().unwrap(); let log = LogEntry { address: address, diff --git a/ethcore/types/src/receipt.rs b/ethcore/types/src/receipt.rs index 76c5fca23..58f4de6e1 100644 --- a/ethcore/types/src/receipt.rs +++ b/ethcore/types/src/receipt.rs @@ -16,14 +16,12 @@ //! Receipt -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address, LogBloom}; use heapsize::HeapSizeOf; use rlp::*; use {BlockNumber}; -use log_entry::{LogBloom, LogEntry, LocalizedLogEntry}; +use log_entry::{LogEntry, LocalizedLogEntry}; /// Transaction outcome store in the receipt. #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/ethcore/types/src/snapshot_manifest.rs b/ethcore/types/src/snapshot_manifest.rs index 9e5f9f646..72f83afeb 100644 --- a/ethcore/types/src/snapshot_manifest.rs +++ b/ethcore/types/src/snapshot_manifest.rs @@ -16,7 +16,7 @@ //! Snapshot manifest type definition -use bigint::hash::H256; +use ethereum_types::H256; use rlp::*; use bytes::Bytes; diff --git a/ethcore/types/src/state_diff.rs b/ethcore/types/src/state_diff.rs index af28f550f..dd976eb36 100644 --- a/ethcore/types/src/state_diff.rs +++ b/ethcore/types/src/state_diff.rs @@ -19,7 +19,7 @@ use std::fmt; use std::ops::*; use std::collections::BTreeMap; -use util::Address; +use ethereum_types::Address; use account_diff::*; /// Expression for the delta between two system states. Encoded the diff --git a/ethcore/types/src/trace_filter.rs b/ethcore/types/src/trace_filter.rs index 5ec6fab10..2afa752cc 100644 --- a/ethcore/types/src/trace_filter.rs +++ b/ethcore/types/src/trace_filter.rs @@ -17,7 +17,7 @@ //! Trace filter related types use std::ops::Range; -use util::{Address}; +use ethereum_types::Address; use ids::BlockId; /// Easy to use trace filter. diff --git a/ethcore/types/src/tree_route.rs b/ethcore/types/src/tree_route.rs index f21e089a5..b3fe431ab 100644 --- a/ethcore/types/src/tree_route.rs +++ b/ethcore/types/src/tree_route.rs @@ -16,7 +16,7 @@ //! Tree route info type definition -use bigint::hash::H256; +use ethereum_types::H256; /// Represents a tree route between `from` block and `to` block: #[derive(Debug)] diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 24e75be2e..7ab98afc7 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -5,9 +5,8 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethcore-util = { path = "../../util" } ethcore-bytes = { path = "../../util/bytes" } -ethcore-bigint = { path = "../../util/bigint" } +ethereum-types = "0.1" patricia-trie = { path = "../../util/patricia_trie" } log = "0.3" common-types = { path = "../types" } diff --git a/ethcore/vm/src/action_params.rs b/ethcore/vm/src/action_params.rs index cf914126f..9e9a35528 100644 --- a/ethcore/vm/src/action_params.rs +++ b/ethcore/vm/src/action_params.rs @@ -15,9 +15,7 @@ // along with Parity. If not, see . //! Evm input params. -use bigint::prelude::U256; -use bigint::hash::{H256}; -use util::Address; +use ethereum_types::{U256, H256, Address}; use bytes::Bytes; use hash::{keccak, KECCAK_EMPTY}; use ethjson; diff --git a/ethcore/vm/src/env_info.rs b/ethcore/vm/src/env_info.rs index cb8ff2241..71bb48eeb 100644 --- a/ethcore/vm/src/env_info.rs +++ b/ethcore/vm/src/env_info.rs @@ -19,9 +19,7 @@ use std::cmp; use std::sync::Arc; use hash::keccak; -use bigint::hash::H256; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, H256, Address}; use types::BlockNumber; use ethjson; @@ -81,8 +79,7 @@ impl From for EnvInfo { mod tests { use std::str::FromStr; use super::*; - use bigint::prelude::U256; - use util::Address; + use ethereum_types::{U256, Address}; use ethjson; #[test] diff --git a/ethcore/vm/src/ext.rs b/ethcore/vm/src/ext.rs index daf00e074..c1e12e600 100644 --- a/ethcore/vm/src/ext.rs +++ b/ethcore/vm/src/ext.rs @@ -17,9 +17,7 @@ //! Interface for Evm externalities. use std::sync::Arc; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::*; +use ethereum_types::{U256, H256, Address}; use bytes::Bytes; use call_type::CallType; use env_info::EnvInfo; diff --git a/ethcore/vm/src/lib.rs b/ethcore/vm/src/lib.rs index 08f0aa639..368bcdedc 100644 --- a/ethcore/vm/src/lib.rs +++ b/ethcore/vm/src/lib.rs @@ -16,8 +16,7 @@ //! Virtual machines support library -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate ethcore_bytes as bytes; extern crate common_types as types; extern crate ethjson; diff --git a/ethcore/vm/src/return_data.rs b/ethcore/vm/src/return_data.rs index c7d5f39dc..067a26e35 100644 --- a/ethcore/vm/src/return_data.rs +++ b/ethcore/vm/src/return_data.rs @@ -14,7 +14,7 @@ //! Return data structures -use bigint::prelude::U256; +use ethereum_types::U256; /// Return data buffer. Holds memory from a previous call and a slice into that memory. #[derive(Debug)] diff --git a/ethcore/vm/src/tests.rs b/ethcore/vm/src/tests.rs index 222578afd..ef7ad2015 100644 --- a/ethcore/vm/src/tests.rs +++ b/ethcore/vm/src/tests.rs @@ -17,9 +17,7 @@ use std::sync::Arc; use std::collections::{HashMap, HashSet}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{U256, H256, Address}; use bytes::Bytes; use { CallType, Schedule, EnvInfo, diff --git a/ethcore/wasm/Cargo.toml b/ethcore/wasm/Cargo.toml index 380ffdfcf..19f6ebc0d 100644 --- a/ethcore/wasm/Cargo.toml +++ b/ethcore/wasm/Cargo.toml @@ -5,8 +5,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" -ethcore-util = { path = "../../util" } -ethcore-bigint = { path = "../../util/bigint" } +ethereum-types = "0.1" log = "0.3" parity-wasm = "0.15" wasm-utils = { git = "https://github.com/paritytech/wasm-utils" } diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml index a739d72e2..a56025f62 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" -ethcore-bigint = { path = "../../../util/bigint" } +ethereum-types = "0.1" ethjson = { path = "../../../json" } vm = { path = "../../vm" } wasm = { path = "../" } @@ -16,4 +16,4 @@ ethcore-logger = { path = "../../../logger" } rustc-hex = "1" [features] -default = ["ethcore-bigint/std"] \ No newline at end of file +default = ["ethereum-types/std"] diff --git a/ethcore/wasm/run/src/main.rs b/ethcore/wasm/run/src/main.rs index 1cb38cdf9..ab8ac631d 100644 --- a/ethcore/wasm/run/src/main.rs +++ b/ethcore/wasm/run/src/main.rs @@ -1,7 +1,7 @@ extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; -extern crate ethcore_bigint; +extern crate ethereum_types; extern crate ethjson; extern crate wasm; extern crate vm; @@ -43,4 +43,4 @@ fn main() { } std::process::exit(exit_code); -} \ No newline at end of file +} diff --git a/ethcore/wasm/run/src/runner.rs b/ethcore/wasm/run/src/runner.rs index 06a6b0469..10e713df1 100644 --- a/ethcore/wasm/run/src/runner.rs +++ b/ethcore/wasm/run/src/runner.rs @@ -5,7 +5,7 @@ use vm::tests::FakeExt; use std::io::{self, Read}; use std::{fs, path, fmt}; use std::sync::Arc; -use ethcore_bigint::prelude::{U256, H256, H160}; +use ethereum_types::{U256, H256, H160}; use rustc_hex::ToHex; fn load_code>(p: P) -> io::Result> { @@ -258,4 +258,4 @@ pub fn run_fixture(fixture: &Fixture) -> Vec { } } fails -} \ No newline at end of file +} diff --git a/ethcore/wasm/src/lib.rs b/ethcore/wasm/src/lib.rs index 5b4e59fcb..bd56dd298 100644 --- a/ethcore/wasm/src/lib.rs +++ b/ethcore/wasm/src/lib.rs @@ -17,8 +17,7 @@ //! Wasm Interpreter extern crate vm; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; #[macro_use] extern crate log; extern crate ethcore_logger; extern crate byteorder; diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index 700233951..7071f9944 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -24,9 +24,7 @@ use vm; use panic_payload; use parity_wasm::interpreter; use wasm_utils::rules; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{U256, H256, Address}; use vm::CallType; use super::ptr::{WasmPtr, Error as PtrError}; diff --git a/ethcore/wasm/src/tests.rs b/ethcore/wasm/src/tests.rs index 115199aeb..981078305 100644 --- a/ethcore/wasm/src/tests.rs +++ b/ethcore/wasm/src/tests.rs @@ -17,9 +17,7 @@ use std::sync::Arc; use std::collections::HashMap; use byteorder::{LittleEndian, ByteOrder}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use super::WasmInterpreter; use vm::{self, Vm, GasLeft, ActionParams, ActionValue}; diff --git a/ethcrypto/Cargo.toml b/ethcrypto/Cargo.toml index a84032f26..ee6566785 100644 --- a/ethcrypto/Cargo.toml +++ b/ethcrypto/Cargo.toml @@ -8,5 +8,5 @@ rust-crypto = "0.2.36" tiny-keccak = "1.3" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } ethkey = { path = "../ethkey" } -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" subtle = "0.1" diff --git a/ethcrypto/src/lib.rs b/ethcrypto/src/lib.rs index 15b8640ee..6ba8b5400 100644 --- a/ethcrypto/src/lib.rs +++ b/ethcrypto/src/lib.rs @@ -17,7 +17,7 @@ //! Crypto utils used ethstore and network. extern crate crypto as rcrypto; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate ethkey; extern crate secp256k1; extern crate subtle; @@ -203,7 +203,7 @@ pub mod ecies { use rcrypto::sha2::Sha256; use rcrypto::hmac::Hmac; use rcrypto::mac::Mac; - use bigint::hash::H128; + use ethereum_types::H128; use ethkey::{Random, Generator, Public, Secret}; use {Error, ecdh, aes, Keccak256}; diff --git a/ethkey/Cargo.toml b/ethkey/Cargo.toml index 7307fe0e9..581971a7f 100644 --- a/ethkey/Cargo.toml +++ b/ethkey/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] byteorder = "1.0" edit-distance = "2.0" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" lazy_static = "0.2" log = "0.3" parity-wordlist = "1.2" diff --git a/ethkey/src/extended.rs b/ethkey/src/extended.rs index c545cd3e4..5a8ede0a4 100644 --- a/ethkey/src/extended.rs +++ b/ethkey/src/extended.rs @@ -18,7 +18,7 @@ use secret::Secret; use Public; -use bigint::hash::H256; +use ethereum_types::H256; pub use self::derivation::Error as DerivationError; /// Represents label that can be stored as a part of key derivation @@ -211,8 +211,7 @@ mod derivation { use rcrypto::hmac::Hmac; use rcrypto::mac::Mac; use rcrypto::sha2::Sha512; - use bigint::hash::{H512, H256}; - use bigint::prelude::{U256, U512}; + use ethereum_types::{U256, U512, H512, H256}; use secp256k1::key::{SecretKey, PublicKey}; use SECP256K1; use keccak; @@ -388,7 +387,7 @@ mod tests { use super::{ExtendedSecret, ExtendedPublic, ExtendedKeyPair}; use secret::Secret; use std::str::FromStr; - use bigint::hash::{H128, H256}; + use ethereum_types::{H128, H256}; use super::{derivation, Derivation}; fn master_chain_basic() -> (H256, H256) { diff --git a/ethkey/src/lib.rs b/ethkey/src/lib.rs index 8753c0177..09a100b74 100644 --- a/ethkey/src/lib.rs +++ b/ethkey/src/lib.rs @@ -19,7 +19,7 @@ extern crate byteorder; extern crate crypto as rcrypto; extern crate edit_distance; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate parity_wordlist; extern crate rand; extern crate rustc_hex; @@ -57,7 +57,10 @@ pub use self::signature::{sign, verify_public, verify_address, recover, Signatur pub use self::secret::Secret; pub use self::extended::{ExtendedPublic, ExtendedSecret, ExtendedKeyPair, DerivationError, Derivation}; -use bigint::hash::{H160, H256, H512}; +use ethereum_types::H256; + +pub use ethereum_types::{Address, Public}; +pub type Message = H256; lazy_static! { pub static ref SECP256K1: secp256k1::Secp256k1 = secp256k1::Secp256k1::new(); @@ -74,7 +77,3 @@ pub trait Generator { /// Should be called to generate new keypair. fn generate(&mut self) -> Result; } - -pub type Address = H160; -pub type Message = H256; -pub type Public = H512; diff --git a/ethkey/src/math.rs b/ethkey/src/math.rs index 4c875bd8f..e2426b4fb 100644 --- a/ethkey/src/math.rs +++ b/ethkey/src/math.rs @@ -17,8 +17,7 @@ use super::{SECP256K1, Public, Secret, Error}; use secp256k1::key; use secp256k1::constants::{GENERATOR_X, GENERATOR_Y, CURVE_ORDER}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{U256, H256}; /// Whether the public key is valid. pub fn public_is_valid(public: &Public) -> bool { diff --git a/ethkey/src/secret.rs b/ethkey/src/secret.rs index 433d8c68e..569f58d49 100644 --- a/ethkey/src/secret.rs +++ b/ethkey/src/secret.rs @@ -19,7 +19,7 @@ use std::ops::Deref; use std::str::FromStr; use rustc_hex::ToHex; use secp256k1::key; -use bigint::hash::H256; +use ethereum_types::H256; use {Error, SECP256K1}; #[derive(Clone, PartialEq, Eq)] diff --git a/ethkey/src/signature.rs b/ethkey/src/signature.rs index 67115c98b..ec225ec01 100644 --- a/ethkey/src/signature.rs +++ b/ethkey/src/signature.rs @@ -22,7 +22,7 @@ use std::hash::{Hash, Hasher}; use secp256k1::{Message as SecpMessage, RecoverableSignature, RecoveryId, Error as SecpError}; use secp256k1::key::{SecretKey, PublicKey}; use rustc_hex::{ToHex, FromHex}; -use bigint::hash::{H520, H256}; +use ethereum_types::{H520, H256}; use {Secret, Public, SECP256K1, Error, Message, public_to_address, Address}; /// Signature encoded as RSV components diff --git a/ethstore/Cargo.toml b/ethstore/Cargo.toml index 1adea2c70..0e59aad40 100755 --- a/ethstore/Cargo.toml +++ b/ethstore/Cargo.toml @@ -18,7 +18,7 @@ time = "0.1.34" itertools = "0.5" parking_lot = "0.4" ethcrypto = { path = "../ethcrypto" } -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" dir = { path = "../util/dir" } smallvec = "0.4" parity-wordlist = "1.0" diff --git a/ethstore/src/ethstore.rs b/ethstore/src/ethstore.rs index 3e1953421..4c6309a11 100755 --- a/ethstore/src/ethstore.rs +++ b/ethstore/src/ethstore.rs @@ -689,7 +689,7 @@ mod tests { use secret_store::{SimpleSecretStore, SecretStore, SecretVaultRef, StoreAccountRef, Derivation}; use super::{EthStore, EthMultiStore}; use self::tempdir::TempDir; - use bigint::hash::H256; + use ethereum_types::H256; fn keypair() -> KeyPair { Random.generate().unwrap() diff --git a/ethstore/src/lib.rs b/ethstore/src/lib.rs index 39ec857dc..0f6094ce3 100755 --- a/ethstore/src/lib.rs +++ b/ethstore/src/lib.rs @@ -32,8 +32,8 @@ extern crate time; extern crate tiny_keccak; extern crate tempdir; -extern crate ethcore_bigint as bigint; extern crate ethcrypto as crypto; +extern crate ethereum_types; extern crate ethkey as _ethkey; extern crate parity_wordlist; @@ -42,7 +42,7 @@ extern crate log; #[macro_use] extern crate serde_derive; -pub mod accounts_dir; +pub mod accounts_dir; pub mod ethkey; mod account; diff --git a/ethstore/src/secret_store.rs b/ethstore/src/secret_store.rs index c71db3fe2..b46e6f2d8 100755 --- a/ethstore/src/secret_store.rs +++ b/ethstore/src/secret_store.rs @@ -20,7 +20,7 @@ use std::cmp::Ordering; use ethkey::{Address, Message, Signature, Secret, Public}; use Error; use json::{Uuid, OpaqueKeyFile}; -use bigint::hash::H256; +use ethereum_types::H256; use OpaqueSecret; /// Key directory reference diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index 200e5a735..84486f370 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -15,9 +15,8 @@ serde = "1.0" serde_derive = "1.0" ethcore = { path = "../ethcore" } ethjson = { path = "../json" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } +ethereum-types = "0.1" evm = { path = "../ethcore/evm" } vm = { path = "../ethcore/vm" } panic_hook = { path = "../panic_hook" } diff --git a/evmbin/src/display/json.rs b/evmbin/src/display/json.rs index badd16d2a..fa5f4ffe0 100644 --- a/evmbin/src/display/json.rs +++ b/evmbin/src/display/json.rs @@ -19,8 +19,7 @@ use std::collections::HashMap; use std::mem; -use bigint::hash::H256; -use bigint::prelude::U256; +use ethereum_types::{U256, H256}; use bytes::ToPretty; use ethcore::trace; diff --git a/evmbin/src/display/mod.rs b/evmbin/src/display/mod.rs index 50acac20c..633e9e2e1 100644 --- a/evmbin/src/display/mod.rs +++ b/evmbin/src/display/mod.rs @@ -17,7 +17,7 @@ //! VM Output display utils. use std::time::Duration; -use bigint::prelude::U256; +use ethereum_types::U256; pub mod json; pub mod simple; diff --git a/evmbin/src/info.rs b/evmbin/src/info.rs index 218a3c419..e3b5f3d23 100644 --- a/evmbin/src/info.rs +++ b/evmbin/src/info.rs @@ -17,8 +17,7 @@ //! VM runner. use std::time::{Instant, Duration}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use ethcore::{trace, spec, transaction, pod_state}; use ethcore::client::{self, EvmTestClient, EvmTestError, TransactResult}; use ethjson; diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index a32af49e0..f1dc91fc4 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -25,9 +25,8 @@ extern crate serde; #[macro_use] extern crate serde_derive; extern crate docopt; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; +extern crate ethereum_types; extern crate vm; extern crate evm; extern crate panic_hook; @@ -41,8 +40,7 @@ use std::{fmt, fs}; use std::path::PathBuf; use docopt::Docopt; use rustc_hex::FromHex; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use bytes::Bytes; use ethcore::spec; use vm::{ActionParams, CallType}; diff --git a/hash-fetch/Cargo.toml b/hash-fetch/Cargo.toml index 312aa028c..5b8a4e771 100644 --- a/hash-fetch/Cargo.toml +++ b/hash-fetch/Cargo.toml @@ -14,9 +14,8 @@ mime_guess = "2.0.0-alpha.2" rand = "0.3" rustc-hex = "1.0" fetch = { path = "../util/fetch" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } +ethereum-types = "0.1" parity-reactor = { path = "../util/reactor" } native-contracts = { path = "../ethcore/native_contracts" } keccak-hash = { path = "../util/hash" } diff --git a/hash-fetch/src/client.rs b/hash-fetch/src/client.rs index 65b9d0d22..d4a5c3208 100644 --- a/hash-fetch/src/client.rs +++ b/hash-fetch/src/client.rs @@ -26,7 +26,7 @@ use fetch::{Fetch, Response, Error as FetchError, Client as FetchClient}; use futures::Future; use parity_reactor::Remote; use urlhint::{ContractClient, URLHintContract, URLHint, URLHintResult}; -use bigint::hash::H256; +use ethereum_types::H256; /// API for fetching by hash. pub trait HashFetch: Send + Sync + 'static { diff --git a/hash-fetch/src/lib.rs b/hash-fetch/src/lib.rs index 0610459ee..2165b5a39 100644 --- a/hash-fetch/src/lib.rs +++ b/hash-fetch/src/lib.rs @@ -21,9 +21,8 @@ #[macro_use] extern crate log; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; +extern crate ethereum_types; extern crate futures; extern crate keccak_hash as hash; extern crate mime; diff --git a/hash-fetch/src/urlhint.rs b/hash-fetch/src/urlhint.rs index c629cd8da..3f958d1db 100644 --- a/hash-fetch/src/urlhint.rs +++ b/hash-fetch/src/urlhint.rs @@ -24,7 +24,7 @@ use hash::keccak; use futures::{future, Future}; use native_contracts::{Registry, Urlhint}; -use util::Address; +use ethereum_types::{H160, H256, Address}; use bytes::Bytes; /// Boxed future that can be shared between threads. @@ -137,7 +137,7 @@ fn get_urlhint_content(account_slash_repo: String, owner: Address) -> Content { } } -fn decode_urlhint_output(output: (String, ::bigint::hash::H160, Address)) -> Option { +fn decode_urlhint_output(output: (String, H160, Address)) -> Option { let (account_slash_repo, commit, owner) = output; if owner == Address::default() { @@ -199,7 +199,7 @@ impl URLHint for URLHintContract { None => Either::A(future::ok(None)), Some(address) => { let do_call = move |_, data| client.call(address, data); - Either::B(urlhint.entries(do_call, ::bigint::hash::H256(fixed_id)).map(decode_urlhint_output)) + Either::B(urlhint.entries(do_call, H256(fixed_id)).map(decode_urlhint_output)) } } })) @@ -240,7 +240,7 @@ pub mod tests { use super::*; use super::guess_mime_type; use parking_lot::Mutex; - use util::Address; + use ethereum_types::Address; use bytes::{Bytes, ToPretty}; pub struct FakeRegistrar { diff --git a/hw/Cargo.toml b/hw/Cargo.toml index c1bf057b0..df4a12b44 100644 --- a/hw/Cargo.toml +++ b/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" } -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" [dev-dependencies] rustc-hex = "1.0" diff --git a/hw/src/ledger.rs b/hw/src/ledger.rs index 6b4c87a0a..f2c2c0ec5 100644 --- a/hw/src/ledger.rs +++ b/hw/src/ledger.rs @@ -17,19 +17,19 @@ //! Ledger hardware wallet module. Supports Ledger Blue and Nano S. /// See https://github.com/LedgerHQ/blue-app-eth/blob/master/doc/ethapp.asc for protocol details. -use super::{WalletInfo, KeyPath}; - -use bigint::hash::H256; -use ethkey::{Address, Signature}; -use hidapi; -use parking_lot::{Mutex, RwLock}; - use std::cmp::min; use std::fmt; use std::str::FromStr; use std::sync::Arc; use std::time::Duration; +use ethereum_types::{H256, Address}; +use ethkey::Signature; +use hidapi; +use parking_lot::{Mutex, RwLock}; + +use super::{WalletInfo, KeyPath}; + const LEDGER_VID: u16 = 0x2c97; const LEDGER_PIDS: [u16; 2] = [0x0000, 0x0001]; // Nano S and Blue const ETH_DERIVATION_PATH_BE: [u8; 17] = [4, 0x80, 0, 0, 44, 0x80, 0, 0, 60, 0x80, 0, 0, 0, 0, 0, 0, 0]; // 44'/60'/0'/0 diff --git a/hw/src/lib.rs b/hw/src/lib.rs index ef58f2d52..a1e90ea3e 100644 --- a/hw/src/lib.rs +++ b/hw/src/lib.rs @@ -16,7 +16,7 @@ //! Hardware wallet management. -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate ethkey; extern crate hidapi; extern crate libusb; @@ -38,7 +38,7 @@ use std::sync::atomic; use std::sync::atomic::AtomicBool; use std::thread; use std::time::Duration; -use bigint::prelude::uint::U256; +use ethereum_types::U256; /// Hardware wallet error. #[derive(Debug)] diff --git a/hw/src/trezor.rs b/hw/src/trezor.rs index a77d7233c..1cde53402 100644 --- a/hw/src/trezor.rs +++ b/hw/src/trezor.rs @@ -21,17 +21,18 @@ use super::{WalletInfo, TransactionInfo, KeyPath}; -use bigint::hash::H256; -use ethkey::{Address, Signature}; -use hidapi; -use parking_lot::{Mutex, RwLock}; -use protobuf; -use protobuf::{Message, ProtobufEnum}; use std::cmp::{min, max}; use std::fmt; use std::sync::Arc; use std::time::Duration; -use bigint::prelude::uint::U256; + +use ethereum_types::{U256, H256, Address}; + +use ethkey::Signature; +use hidapi; +use parking_lot::{Mutex, RwLock}; +use protobuf; +use protobuf::{Message, ProtobufEnum}; use trezor_sys::messages::{EthereumAddress, PinMatrixAck, MessageType, EthereumTxRequest, EthereumSignTx, EthereumGetAddress, EthereumTxAck, ButtonAck}; @@ -411,8 +412,7 @@ impl Manager { /// 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 bigint::prelude::uint::U256; - use bigint::hash::{H160, H256}; + use ethereum_types::{H160, H256, U256}; let hidapi = Arc::new(Mutex::new(hidapi::HidApi::new().unwrap())); let manager = Manager::new(hidapi.clone()); diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index da3b48eef..5b763b991 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -7,8 +7,8 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } -ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } +ethereum-types = "0.1" jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } rlp = { path = "../util/rlp" } diff --git a/ipfs/src/lib.rs b/ipfs/src/lib.rs index b92108b52..bb7d0c389 100644 --- a/ipfs/src/lib.rs +++ b/ipfs/src/lib.rs @@ -20,8 +20,8 @@ extern crate unicase; extern crate rlp; extern crate ethcore; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; +extern crate ethereum_types; extern crate jsonrpc_core as core; extern crate jsonrpc_http_server as http; diff --git a/ipfs/src/route.rs b/ipfs/src/route.rs index 37e34f69e..2beb4ccc3 100644 --- a/ipfs/src/route.rs +++ b/ipfs/src/route.rs @@ -19,7 +19,7 @@ use error::{Error, Result}; use cid::{ToCid, Codec}; use multihash::Hash; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; use ethcore::client::{BlockId, TransactionId}; diff --git a/json/Cargo.toml b/json/Cargo.toml index 5d468a14f..49371a6d9 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" rustc-hex = "1.0" serde = "1.0" serde_json = "1.0" diff --git a/json/src/hash.rs b/json/src/hash.rs index 32c707d5b..ccf01c993 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -21,7 +21,7 @@ use std::fmt; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::{Error, Visitor}; use rustc_hex::ToHex; -use bigint::hash::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, H2048 as Hash2048}; +use ethereum_types::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, H2048 as Hash2048}; macro_rules! impl_hash { @@ -99,7 +99,7 @@ impl_hash!(Bloom, Hash2048); mod test { use std::str::FromStr; use serde_json; - use bigint::hash; + use ethereum_types; use hash::H256; #[test] @@ -107,13 +107,13 @@ mod test { let s = r#"["", "5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae"]"#; let deserialized: Vec = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, vec![ - H256(hash::H256::from(0)), - H256(hash::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap()) + H256(ethereum_types::H256::from(0)), + H256(ethereum_types::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap()) ]); } #[test] fn hash_into() { - assert_eq!(hash::H256::from(0), H256(hash::H256::from(0)).into()); + assert_eq!(ethereum_types::H256::from(0), H256(ethereum_types::H256::from(0)).into()); } } diff --git a/json/src/lib.rs b/json/src/lib.rs index fffeb0824..3cb1e49f5 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -17,7 +17,7 @@ extern crate rustc_hex; extern crate serde; extern crate serde_json; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; #[macro_use] extern crate serde_derive; pub mod hash; diff --git a/json/src/maybe.rs b/json/src/maybe.rs index b799b7ef6..8b74b22c4 100644 --- a/json/src/maybe.rs +++ b/json/src/maybe.rs @@ -68,7 +68,7 @@ impl Into> for MaybeEmpty { mod tests { use std::str::FromStr; use serde_json; - use bigint::hash; + use ethereum_types; use hash::H256; use maybe::MaybeEmpty; @@ -78,7 +78,7 @@ mod tests { let deserialized: Vec> = serde_json::from_str(s).unwrap(); assert_eq!(deserialized, vec![ MaybeEmpty::None, - MaybeEmpty::Some(H256(hash::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap())) + MaybeEmpty::Some(H256(ethereum_types::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap())) ]); } diff --git a/json/src/spec/account.rs b/json/src/spec/account.rs index 32d5ec42d..fb41137aa 100644 --- a/json/src/spec/account.rs +++ b/json/src/spec/account.rs @@ -50,7 +50,7 @@ mod tests { use std::collections::BTreeMap; use serde_json; use spec::account::Account; - use bigint::prelude::U256; + use ethereum_types::U256; use uint::Uint; use bytes::Bytes; diff --git a/json/src/spec/authority_round.rs b/json/src/spec/authority_round.rs index 57e354c72..f84d51201 100644 --- a/json/src/spec/authority_round.rs +++ b/json/src/spec/authority_round.rs @@ -60,7 +60,7 @@ pub struct AuthorityRound { #[cfg(test)] mod tests { - use bigint::prelude::{U256, H160}; + use ethereum_types::{U256, H160}; use uint::Uint; use serde_json; use hash::Address; diff --git a/json/src/spec/basic_authority.rs b/json/src/spec/basic_authority.rs index d8182a990..0a257f134 100644 --- a/json/src/spec/basic_authority.rs +++ b/json/src/spec/basic_authority.rs @@ -40,7 +40,7 @@ pub struct BasicAuthority { mod tests { use serde_json; use uint::Uint; - use bigint::prelude::{U256, H160}; + use ethereum_types::{U256, H160}; use hash::Address; use spec::basic_authority::BasicAuthority; use spec::validator_set::ValidatorSet; diff --git a/json/src/spec/ethash.rs b/json/src/spec/ethash.rs index 283e24ba0..03f6f6175 100644 --- a/json/src/spec/ethash.rs +++ b/json/src/spec/ethash.rs @@ -146,7 +146,7 @@ pub struct Ethash { mod tests { use serde_json; use uint::Uint; - use bigint::prelude::{H160, U256}; + use ethereum_types::{H160, U256}; use hash::Address; use spec::ethash::{Ethash, EthashParams}; diff --git a/json/src/spec/genesis.rs b/json/src/spec/genesis.rs index 98bc75c69..984053e77 100644 --- a/json/src/spec/genesis.rs +++ b/json/src/spec/genesis.rs @@ -60,7 +60,7 @@ mod tests { use serde_json; use bytes::Bytes; use uint::Uint; - use bigint::prelude::{U256, H160, H64 as Eth64, H256 as Eth256}; + use ethereum_types::{U256, H160, H64 as Eth64, H256 as Eth256}; use hash::{H64, H256, Address}; use spec::genesis::Genesis; use spec::{Ethereum, Seal}; diff --git a/json/src/spec/null_engine.rs b/json/src/spec/null_engine.rs index fb6281baf..cfd3d6ce6 100644 --- a/json/src/spec/null_engine.rs +++ b/json/src/spec/null_engine.rs @@ -37,7 +37,7 @@ pub struct NullEngine { mod tests { use serde_json; use uint::Uint; - use bigint::prelude::U256; + use ethereum_types::U256; use super::*; #[test] diff --git a/json/src/spec/params.rs b/json/src/spec/params.rs index f62626899..3768d59c9 100644 --- a/json/src/spec/params.rs +++ b/json/src/spec/params.rs @@ -123,7 +123,7 @@ pub struct Params { mod tests { use serde_json; use uint::Uint; - use bigint::prelude::U256; + use ethereum_types::U256; use spec::params::Params; #[test] diff --git a/json/src/spec/seal.rs b/json/src/spec/seal.rs index a428a0957..6654a309a 100644 --- a/json/src/spec/seal.rs +++ b/json/src/spec/seal.rs @@ -73,7 +73,7 @@ mod tests { use hash::*; use bytes::Bytes; use uint::Uint; - use bigint::prelude::{U256, H64 as Eth64, H256 as Eth256, H520 as Eth520}; + use ethereum_types::{U256, H64 as Eth64, H256 as Eth256, H520 as Eth520}; use spec::{Ethereum, AuthorityRoundSeal, TendermintSeal, Seal}; #[test] diff --git a/json/src/spec/tendermint.rs b/json/src/spec/tendermint.rs index 1375b94c4..8f3d4c224 100644 --- a/json/src/spec/tendermint.rs +++ b/json/src/spec/tendermint.rs @@ -51,7 +51,7 @@ pub struct Tendermint { #[cfg(test)] mod tests { use serde_json; - use bigint::prelude::H160; + use ethereum_types::H160; use hash::Address; use spec::tendermint::Tendermint; use spec::validator_set::ValidatorSet; diff --git a/json/src/spec/validator_set.rs b/json/src/spec/validator_set.rs index 3526bed93..9c6b4e79a 100644 --- a/json/src/spec/validator_set.rs +++ b/json/src/spec/validator_set.rs @@ -41,7 +41,7 @@ pub enum ValidatorSet { mod tests { use serde_json; use uint::Uint; - use bigint::prelude::{H160, U256}; + use ethereum_types::{H160, U256}; use hash::Address; use spec::validator_set::ValidatorSet; diff --git a/json/src/uint.rs b/json/src/uint.rs index b6962c762..81fa36a63 100644 --- a/json/src/uint.rs +++ b/json/src/uint.rs @@ -20,7 +20,7 @@ use std::fmt; use std::str::FromStr; use serde::{Deserialize, Deserializer}; use serde::de::{Error, Visitor}; -use bigint::prelude::U256; +use ethereum_types::U256; /// Lenient uint json deserialization for test json files. #[derive(Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] @@ -93,7 +93,7 @@ impl<'a> Visitor<'a> for UintVisitor { #[cfg(test)] mod test { use serde_json; - use bigint::prelude::U256; + use ethereum_types::U256; use uint::Uint; #[test] diff --git a/json/src/vm/call.rs b/json/src/vm/call.rs index 14e067f5f..39d5a828e 100644 --- a/json/src/vm/call.rs +++ b/json/src/vm/call.rs @@ -39,7 +39,7 @@ pub struct Call { mod tests { use serde_json; use vm::Call; - use bigint::prelude::{U256, H160 as Hash160}; + use ethereum_types::{U256, H160 as Hash160}; use uint::Uint; use hash::Address; use maybe::MaybeEmpty; diff --git a/machine/Cargo.toml b/machine/Cargo.toml index 9deaa296e..7e3b23e67 100644 --- a/machine/Cargo.toml +++ b/machine/Cargo.toml @@ -5,5 +5,4 @@ description = "Generalization of a state machine for consensus engines" authors = ["Parity Technologies "] [dependencies] -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" diff --git a/machine/src/lib.rs b/machine/src/lib.rs index 4b4305d0d..3a45c38d2 100644 --- a/machine/src/lib.rs +++ b/machine/src/lib.rs @@ -17,12 +17,9 @@ //! Generalization of a state machine for a consensus engine. //! This will define traits for the header, block, and state of a blockchain. -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; -use bigint::hash::H256; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{H256, U256, Address}; /// A header. This contains important metadata about the block, as well as a /// "seal" that indicates validity to a consensus engine. diff --git a/parity/blockchain.rs b/parity/blockchain.rs index 84a610ef3..3baf97f61 100644 --- a/parity/blockchain.rs +++ b/parity/blockchain.rs @@ -22,9 +22,7 @@ use std::thread::sleep; use std::sync::Arc; use rustc_hex::FromHex; use hash::{keccak, KECCAK_NULL_RLP}; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{U256, H256, Address}; use bytes::ToPretty; use rlp::PayloadInfo; use ethcore::service::ClientService; diff --git a/parity/configuration.rs b/parity/configuration.rs index fa0b602ef..a525e8043 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -23,9 +23,7 @@ use std::cmp::max; use std::str::FromStr; use cli::{Args, ArgsError}; use hash::keccak; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{U256, H256, Address}; use parity_version::{version_data, version}; use bytes::Bytes; use ansi_term::Colour; diff --git a/parity/dapps.rs b/parity/dapps.rs index 6f82a6ada..ac20fb304 100644 --- a/parity/dapps.rs +++ b/parity/dapps.rs @@ -30,7 +30,7 @@ use light::on_demand::{self, OnDemand}; use node_health::{SyncStatus, NodeHealth}; use rpc; use rpc_apis::SignerService; -use util::Address; +use ethereum_types::Address; use bytes::Bytes; #[derive(Debug, PartialEq, Clone)] diff --git a/parity/helpers.rs b/parity/helpers.rs index 4cca58877..86bbf083d 100644 --- a/parity/helpers.rs +++ b/parity/helpers.rs @@ -18,9 +18,7 @@ use std::io; use std::io::{Write, BufReader, BufRead}; use std::time::Duration; use std::fs::File; -use bigint::prelude::U256; -use bigint::hash::clean_0x; -use util::Address; +use ethereum_types::{U256, clean_0x, Address}; use kvdb_rocksdb::CompactionProfile; use journaldb::Algorithm; use ethcore::client::{Mode, BlockId, VMType, DatabaseCompactionProfile, ClientConfig, VerifierType}; @@ -330,7 +328,7 @@ mod tests { use std::fs::File; use std::io::Write; use devtools::RandomTempPath; - use bigint::prelude::U256; + use ethereum_types::U256; use ethcore::client::{Mode, BlockId}; use ethcore::miner::PendingSet; use super::{to_duration, to_mode, to_block_id, to_u256, to_pending_set, to_address, to_addresses, to_price, geth_ipc_path, to_bootnodes, password_from_file}; diff --git a/parity/informant.rs b/parity/informant.rs index cd2205382..018b4b99e 100644 --- a/parity/informant.rs +++ b/parity/informant.rs @@ -35,7 +35,7 @@ use light::client::LightChainClient; use number_prefix::{binary_prefix, Standalone, Prefixed}; use parity_rpc::{is_major_importing}; use parity_rpc::informant::RpcStats; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; use parking_lot::{RwLock, Mutex}; diff --git a/parity/light_helpers/epoch_fetch.rs b/parity/light_helpers/epoch_fetch.rs index 77a623016..ff384c131 100644 --- a/parity/light_helpers/epoch_fetch.rs +++ b/parity/light_helpers/epoch_fetch.rs @@ -30,7 +30,7 @@ use light::client::fetch::ChainDataFetcher; use light::on_demand::{request, OnDemand}; use parking_lot::RwLock; -use bigint::hash::H256; +use ethereum_types::H256; const ALL_VALID_BACKREFS: &str = "no back-references, therefore all back-references valid; qed"; diff --git a/parity/main.rs b/parity/main.rs index 54c56ff8d..e539467ad 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -51,10 +51,9 @@ extern crate ethcore_devtools as devtools; extern crate ethcore_io as io; extern crate ethcore_light as light; extern crate ethcore_logger; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate ethcore_network as network; +extern crate ethereum_types; extern crate migration as migr; extern crate kvdb; extern crate kvdb_rocksdb; diff --git a/parity/params.rs b/parity/params.rs index 2d5cb8a7d..c9c9cc030 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -16,8 +16,7 @@ use std::{str, fs, fmt}; use std::time::Duration; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use parity_version::version_data; use journaldb::Algorithm; use ethcore::spec::{Spec, SpecParams}; diff --git a/parity/secretstore.rs b/parity/secretstore.rs index 48e6e5c1c..c71f2c14d 100644 --- a/parity/secretstore.rs +++ b/parity/secretstore.rs @@ -22,7 +22,7 @@ use ethcore::account_provider::AccountProvider; use ethcore::client::Client; use ethkey::{Secret, Public}; use ethsync::SyncProvider; -use util::Address; +use ethereum_types::Address; /// This node secret key. #[derive(Debug, PartialEq, Clone)] diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 17ac43bd4..3fbe7610b 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -37,9 +37,8 @@ jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = " jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } ethcore-io = { path = "../util/io" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } +ethereum-types = "0.1" ethcore = { path = "../ethcore" } ethcrypto = { path = "../ethcrypto" } ethkey = { path = "../ethkey" } diff --git a/rpc/src/authcodes.rs b/rpc/src/authcodes.rs index b0bb02fdf..fb5475fde 100644 --- a/rpc/src/authcodes.rs +++ b/rpc/src/authcodes.rs @@ -22,7 +22,7 @@ use itertools::Itertools; use rand::Rng; use rand::os::OsRng; use hash::keccak; -use bigint::hash::H256; +use ethereum_types::H256; /// Providing current time in seconds pub trait TimeProvider { @@ -232,7 +232,7 @@ mod tests { use std::cell::Cell; use hash::keccak; - use bigint::hash::H256; + use ethereum_types::H256; use super::*; fn generate_hash(val: &str, time: u64) -> H256 { diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index f326cb381..bc3964a9f 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -46,13 +46,12 @@ extern crate jsonrpc_pubsub; extern crate ethash; extern crate ethcore; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate ethcore_devtools as devtools; extern crate ethcore_io as io; extern crate ethcore_light as light; -extern crate ethcore_util as util; extern crate ethcrypto as crypto; +extern crate ethereum_types; extern crate ethkey; extern crate ethstore; extern crate ethsync; diff --git a/rpc/src/v1/extractors.rs b/rpc/src/v1/extractors.rs index 1c0fb1322..b679ff8b2 100644 --- a/rpc/src/v1/extractors.rs +++ b/rpc/src/v1/extractors.rs @@ -25,7 +25,7 @@ use ipc; use jsonrpc_core as core; use jsonrpc_pubsub::Session; use ws; -use bigint::hash::H256; +use ethereum_types::H256; use v1::{Metadata, Origin}; use v1::informant::RpcStats; diff --git a/rpc/src/v1/helpers/dispatch.rs b/rpc/src/v1/helpers/dispatch.rs index bd5137c2e..f6df58a41 100644 --- a/rpc/src/v1/helpers/dispatch.rs +++ b/rpc/src/v1/helpers/dispatch.rs @@ -26,9 +26,7 @@ use light::on_demand::{request, OnDemand}; use light::TransactionQueue as LightTransactionQueue; use rlp; use hash::keccak; -use bigint::prelude::U256; -use bigint::hash::{H256, H520}; -use util::Address; +use ethereum_types::{H256, H520, Address, U256}; use bytes::Bytes; use parking_lot::{Mutex, RwLock}; use stats::Corpus; diff --git a/rpc/src/v1/helpers/fake_sign.rs b/rpc/src/v1/helpers/fake_sign.rs index 1f3a09474..c2010f4b0 100644 --- a/rpc/src/v1/helpers/fake_sign.rs +++ b/rpc/src/v1/helpers/fake_sign.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use ethcore::transaction::{Transaction, SignedTransaction, Action}; -use bigint::prelude::U256; +use ethereum_types::U256; use jsonrpc_core::Error; use v1::helpers::CallRequest; diff --git a/rpc/src/v1/helpers/light_fetch.rs b/rpc/src/v1/helpers/light_fetch.rs index d7436d8cd..c32414b79 100644 --- a/rpc/src/v1/helpers/light_fetch.rs +++ b/rpc/src/v1/helpers/light_fetch.rs @@ -38,9 +38,8 @@ use light::on_demand::{request, OnDemand, HeaderRef, Request as OnDemandRequest, use light::request::Field; use ethsync::LightSync; -use bigint::prelude::U256; +use ethereum_types::{U256, Address}; use hash::H256; -use util::Address; use parking_lot::Mutex; use v1::helpers::{CallRequest as CallRequestHelper, errors, dispatch}; diff --git a/rpc/src/v1/helpers/nonce.rs b/rpc/src/v1/helpers/nonce.rs index 30ad15211..06f38a858 100644 --- a/rpc/src/v1/helpers/nonce.rs +++ b/rpc/src/v1/helpers/nonce.rs @@ -19,12 +19,11 @@ use std::collections::HashMap; use std::sync::{atomic, Arc}; use std::sync::atomic::{AtomicBool, AtomicUsize}; -use bigint::prelude::U256; +use ethereum_types::{U256, Address}; use futures::{Future, future, Poll, Async}; use futures::future::Either; use futures::sync::oneshot; use futures_cpupool::CpuPool; -use util::Address; /// Manages currently reserved and prospective nonces /// for multiple senders. diff --git a/rpc/src/v1/helpers/poll_filter.rs b/rpc/src/v1/helpers/poll_filter.rs index ba769ee4e..7ef8db0f1 100644 --- a/rpc/src/v1/helpers/poll_filter.rs +++ b/rpc/src/v1/helpers/poll_filter.rs @@ -1,7 +1,7 @@ //! Helper type with all filter state data. use std::collections::HashSet; -use bigint::hash::H256; +use ethereum_types::H256; use v1::types::{Filter, Log}; pub type BlockNumber = u64; diff --git a/rpc/src/v1/helpers/requests.rs b/rpc/src/v1/helpers/requests.rs index b7d558033..13bfbb1b3 100644 --- a/rpc/src/v1/helpers/requests.rs +++ b/rpc/src/v1/helpers/requests.rs @@ -14,9 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::prelude::U256; +use ethereum_types::{U256, Address}; use bytes::Bytes; -use util::Address; use v1::types::{Origin, TransactionCondition}; diff --git a/rpc/src/v1/helpers/signing_queue.rs b/rpc/src/v1/helpers/signing_queue.rs index e61f192ea..b73535ba4 100644 --- a/rpc/src/v1/helpers/signing_queue.rs +++ b/rpc/src/v1/helpers/signing_queue.rs @@ -15,8 +15,7 @@ // along with Parity. If not, see . use std::collections::BTreeMap; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use parking_lot::{Mutex, RwLock}; use ethcore::account_provider::DappId; use v1::helpers::{ConfirmationRequest, ConfirmationPayload, oneshot, errors}; @@ -232,8 +231,7 @@ impl SigningQueue for ConfirmationsQueue { #[cfg(test)] mod test { use std::sync::Arc; - use bigint::prelude::U256; - use util::Address; + use ethereum_types::{U256, Address}; use parking_lot::Mutex; use jsonrpc_core::futures::Future; use v1::helpers::{ diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index dc450afcc..4281c482a 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -22,9 +22,7 @@ use std::sync::Arc; use rlp::{self, UntrustedRlp}; use time::get_time; -use bigint::prelude::U256; -use bigint::hash::{H64, H160, H256}; -use util::Address; +use ethereum_types::{U256, H64, H160, H256, Address}; use parking_lot::Mutex; use ethash::SeedHashCompute; diff --git a/rpc/src/v1/impls/eth_filter.rs b/rpc/src/v1/impls/eth_filter.rs index f90a969da..4803c2541 100644 --- a/rpc/src/v1/impls/eth_filter.rs +++ b/rpc/src/v1/impls/eth_filter.rs @@ -22,7 +22,7 @@ use std::collections::HashSet; use ethcore::miner::MinerService; use ethcore::filter::Filter as EthcoreFilter; use ethcore::client::{BlockChainClient, BlockId}; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::Mutex; use jsonrpc_core::{BoxFuture, Result}; diff --git a/rpc/src/v1/impls/eth_pubsub.rs b/rpc/src/v1/impls/eth_pubsub.rs index e9919335c..938562a12 100644 --- a/rpc/src/v1/impls/eth_pubsub.rs +++ b/rpc/src/v1/impls/eth_pubsub.rs @@ -39,7 +39,7 @@ use light::cache::Cache; use light::on_demand::OnDemand; use light::client::{LightChainClient, LightChainNotify}; use parity_reactor::Remote; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; use parking_lot::{RwLock, Mutex}; diff --git a/rpc/src/v1/impls/light/eth.rs b/rpc/src/v1/impls/light/eth.rs index 1929b1cb7..51229cb79 100644 --- a/rpc/src/v1/impls/light/eth.rs +++ b/rpc/src/v1/impls/light/eth.rs @@ -36,7 +36,7 @@ use ethcore::transaction::SignedTransaction; use ethsync::LightSync; use rlp::UntrustedRlp; use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP}; -use bigint::prelude::U256; +use ethereum_types::U256; use parking_lot::{RwLock, Mutex}; use v1::impls::eth_filter::Filterable; @@ -517,7 +517,7 @@ impl Filterable for EthClient { self.client.block_hash(id).map(Into::into) } - fn pending_transactions_hashes(&self, _block_number: u64) -> Vec<::bigint::hash::H256> { + fn pending_transactions_hashes(&self, _block_number: u64) -> Vec<::ethereum_types::H256> { Vec::new() } diff --git a/rpc/src/v1/impls/parity.rs b/rpc/src/v1/impls/parity.rs index 4cb02f9cb..b822bfd56 100644 --- a/rpc/src/v1/impls/parity.rs +++ b/rpc/src/v1/impls/parity.rs @@ -19,7 +19,7 @@ use std::sync::Arc; use std::str::FromStr; use std::collections::{BTreeMap, HashSet}; -use util::Address; +use ethereum_types::Address; use version::version_data; use crypto::{DEFAULT_MAC, ecies}; diff --git a/rpc/src/v1/impls/parity_accounts.rs b/rpc/src/v1/impls/parity_accounts.rs index 4aa1232f3..128415bbd 100644 --- a/rpc/src/v1/impls/parity_accounts.rs +++ b/rpc/src/v1/impls/parity_accounts.rs @@ -17,7 +17,7 @@ //! Account management (personal) rpc implementation use std::sync::Arc; use std::collections::btree_map::{BTreeMap, Entry}; -use util::Address; +use ethereum_types::Address; use ethkey::{Brain, Generator, Secret}; use ethstore::KeyFile; diff --git a/rpc/src/v1/impls/personal.rs b/rpc/src/v1/impls/personal.rs index 849cb1413..f6315581d 100644 --- a/rpc/src/v1/impls/personal.rs +++ b/rpc/src/v1/impls/personal.rs @@ -20,8 +20,7 @@ use std::sync::Arc; use ethcore::account_provider::AccountProvider; use ethcore::transaction::PendingTransaction; -use bigint::prelude::U128; -use util::Address; +use ethereum_types::{U128, Address}; use bytes::ToPretty; use jsonrpc_core::{BoxFuture, Result}; diff --git a/rpc/src/v1/impls/signing.rs b/rpc/src/v1/impls/signing.rs index dd6507c42..d8a27e952 100644 --- a/rpc/src/v1/impls/signing.rs +++ b/rpc/src/v1/impls/signing.rs @@ -18,7 +18,7 @@ use std::sync::Arc; use transient_hashmap::TransientHashMap; -use bigint::prelude::U256; +use ethereum_types::U256; use parking_lot::Mutex; use ethcore::account_provider::AccountProvider; diff --git a/rpc/src/v1/tests/eth.rs b/rpc/src/v1/tests/eth.rs index bd39ccf06..620035d8e 100644 --- a/rpc/src/v1/tests/eth.rs +++ b/rpc/src/v1/tests/eth.rs @@ -19,8 +19,7 @@ use std::env; use std::sync::Arc; use std::time::Duration; -use bigint::hash::H256; -use bigint::prelude::U256; +use ethereum_types::{U256, H256, Address}; use ethcore::account_provider::AccountProvider; use ethcore::block::Block; use ethcore::client::{BlockChainClient, Client, ClientConfig}; @@ -34,7 +33,6 @@ use ethjson::state::test::ForkSpec; use io::IoChannel; use kvdb_memorydb; use parking_lot::Mutex; -use util::Address; use jsonrpc_core::IoHandler; use v1::helpers::dispatch::FullDispatcher; diff --git a/rpc/src/v1/tests/helpers/miner_service.rs b/rpc/src/v1/tests/helpers/miner_service.rs index 5314ba64f..ed68c3789 100644 --- a/rpc/src/v1/tests/helpers/miner_service.rs +++ b/rpc/src/v1/tests/helpers/miner_service.rs @@ -18,9 +18,7 @@ use std::collections::{BTreeMap, HashMap}; use std::collections::hash_map::Entry; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use bytes::Bytes; use parking_lot::{RwLock, Mutex}; use ethcore::error::Error; diff --git a/rpc/src/v1/tests/helpers/snapshot_service.rs b/rpc/src/v1/tests/helpers/snapshot_service.rs index 84202c7f8..25abab578 100644 --- a/rpc/src/v1/tests/helpers/snapshot_service.rs +++ b/rpc/src/v1/tests/helpers/snapshot_service.rs @@ -17,7 +17,7 @@ use ethcore::snapshot::{ManifestData, RestorationStatus, SnapshotService}; use bytes::Bytes; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::Mutex; /// Mocked snapshot service (used for sync info extensions). diff --git a/rpc/src/v1/tests/helpers/sync_provider.rs b/rpc/src/v1/tests/helpers/sync_provider.rs index 88962f09c..cbe665423 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 bigint::hash::H256; +use ethereum_types::H256; use parking_lot::RwLock; use ethsync::{SyncProvider, EthProtocolInfo, SyncStatus, SyncState, PeerInfo, TransactionStats}; diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 504cef43a..dabfd99a5 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -22,9 +22,7 @@ use rustc_hex::{FromHex, ToHex}; use time::get_time; use rlp; -use bigint::prelude::U256; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, U256, Address}; use parking_lot::Mutex; use ethkey::Secret; use ethcore::account_provider::AccountProvider; @@ -539,7 +537,7 @@ fn rpc_eth_transaction_count_by_number_pending() { #[test] fn rpc_eth_pending_transaction_by_hash() { - use bigint::hash::H256; + use ethereum_types::H256; use rlp; use ethcore::transaction::SignedTransaction; diff --git a/rpc/src/v1/tests/mocked/parity.rs b/rpc/src/v1/tests/mocked/parity.rs index e25f3e4d3..34d712b8c 100644 --- a/rpc/src/v1/tests/mocked/parity.rs +++ b/rpc/src/v1/tests/mocked/parity.rs @@ -23,7 +23,7 @@ use ethstore::ethkey::{Generator, Random}; use ethsync::ManageNetwork; use node_health::{self, NodeHealth}; use parity_reactor; -use util::Address; +use ethereum_types::{Address, U256, H256}; use jsonrpc_core::IoHandler; use v1::{Parity, ParityClient}; @@ -497,9 +497,6 @@ fn rpc_parity_local_transactions() { #[test] fn rpc_parity_chain_status() { - use bigint::prelude::U256; - use bigint::hash::H256; - let deps = Dependencies::new(); let io = deps.default_client(); @@ -536,8 +533,6 @@ fn rpc_parity_cid() { #[test] fn rpc_parity_call() { - use bigint::prelude::U256; - let deps = Dependencies::new(); deps.client.set_execution_result(Ok(Executed { exception: None, diff --git a/rpc/src/v1/tests/mocked/parity_set.rs b/rpc/src/v1/tests/mocked/parity_set.rs index f571feeeb..cb5c046d1 100644 --- a/rpc/src/v1/tests/mocked/parity_set.rs +++ b/rpc/src/v1/tests/mocked/parity_set.rs @@ -17,8 +17,7 @@ use std::sync::Arc; use std::str::FromStr; use rustc_hex::FromHex; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use ethcore::miner::MinerService; use ethcore::client::TestBlockChainClient; diff --git a/rpc/src/v1/tests/mocked/personal.rs b/rpc/src/v1/tests/mocked/personal.rs index fd0825f28..2e1a54297 100644 --- a/rpc/src/v1/tests/mocked/personal.rs +++ b/rpc/src/v1/tests/mocked/personal.rs @@ -17,13 +17,12 @@ use std::sync::Arc; use std::str::FromStr; -use bigint::prelude::U256; +use ethereum_types::{U256, Address}; use ethcore::account_provider::AccountProvider; use ethcore::client::TestBlockChainClient; use ethcore::transaction::{Action, Transaction}; use jsonrpc_core::IoHandler; use parking_lot::Mutex; -use util::Address; use v1::{PersonalClient, Personal, Metadata}; use v1::helpers::nonce; diff --git a/rpc/src/v1/tests/mocked/signer.rs b/rpc/src/v1/tests/mocked/signer.rs index b21a06e2d..ee07622d7 100644 --- a/rpc/src/v1/tests/mocked/signer.rs +++ b/rpc/src/v1/tests/mocked/signer.rs @@ -16,8 +16,7 @@ use std::sync::Arc; use std::str::FromStr; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use bytes::ToPretty; use ethcore::account_provider::AccountProvider; diff --git a/rpc/src/v1/tests/mocked/signing.rs b/rpc/src/v1/tests/mocked/signing.rs index 81dd1f90f..ff8017806 100644 --- a/rpc/src/v1/tests/mocked/signing.rs +++ b/rpc/src/v1/tests/mocked/signing.rs @@ -30,8 +30,7 @@ use v1::types::{ConfirmationResponse, RichRawTransaction}; use v1::tests::helpers::TestMinerService; use v1::tests::mocked::parity; -use bigint::prelude::U256; -use util::Address; +use ethereum_types::{U256, Address}; use bytes::ToPretty; use ethkey::Secret; use ethcore::account_provider::AccountProvider; diff --git a/rpc/src/v1/types/filter.rs b/rpc/src/v1/types/filter.rs index f552212b0..82cd5db30 100644 --- a/rpc/src/v1/types/filter.rs +++ b/rpc/src/v1/types/filter.rs @@ -124,7 +124,7 @@ impl Serialize for FilterChanges { mod tests { use serde_json; use std::str::FromStr; - use bigint::hash::H256; + use ethereum_types::H256; use super::{VariadicValue, Topic, Filter}; use v1::types::BlockNumber; use ethcore::filter::Filter as EthFilter; diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs index bf381f3b6..35cbad07c 100644 --- a/rpc/src/v1/types/hash.rs +++ b/rpc/src/v1/types/hash.rs @@ -20,7 +20,7 @@ use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use serde; use rustc_hex::{ToHex, FromHex}; -use bigint::hash::{H64 as Eth64, H160 as Eth160, H256 as Eth256, H520 as Eth520, H512 as Eth512, H2048 as Eth2048}; +use ethereum_types::{H64 as Eth64, H160 as Eth160, H256 as Eth256, H520 as Eth520, H512 as Eth512, H2048 as Eth2048}; macro_rules! impl_hash { ($name: ident, $other: ident, $size: expr) => { diff --git a/rpc/src/v1/types/histogram.rs b/rpc/src/v1/types/histogram.rs index 2f7d210af..26bbc7d2d 100644 --- a/rpc/src/v1/types/histogram.rs +++ b/rpc/src/v1/types/histogram.rs @@ -29,8 +29,8 @@ pub struct Histogram { pub counts: Vec, } -impl From<::stats::Histogram<::bigint::prelude::U256>> for Histogram { - fn from(h: ::stats::Histogram<::bigint::prelude::U256>) -> Self { +impl From<::stats::Histogram<::ethereum_types::U256>> for Histogram { + fn from(h: ::stats::Histogram<::ethereum_types::U256>) -> Self { Histogram { bucket_bounds: h.bucket_bounds.into_iter().map(Into::into).collect(), counts: h.counts diff --git a/rpc/src/v1/types/trace_filter.rs b/rpc/src/v1/types/trace_filter.rs index 5aa1eda1e..abd873c59 100644 --- a/rpc/src/v1/types/trace_filter.rs +++ b/rpc/src/v1/types/trace_filter.rs @@ -59,7 +59,7 @@ impl Into for TraceFilter { #[cfg(test)] mod tests { use serde_json; - use util::Address; + use ethereum_types::Address; use v1::types::{BlockNumber, TraceFilter}; #[test] diff --git a/rpc/src/v1/types/uint.rs b/rpc/src/v1/types/uint.rs index 6c08370c5..1333d22fd 100644 --- a/rpc/src/v1/types/uint.rs +++ b/rpc/src/v1/types/uint.rs @@ -17,7 +17,7 @@ use std::str::FromStr; use std::fmt; use serde; -use bigint::prelude::{U256 as EthU256, U128 as EthU128}; +use ethereum_types::{U256 as EthU256, U128 as EthU128}; macro_rules! impl_uint { ($name: ident, $other: ident, $size: expr) => { diff --git a/rpc_cli/Cargo.toml b/rpc_cli/Cargo.toml index 652e9be13..0bda94ab6 100644 --- a/rpc_cli/Cargo.toml +++ b/rpc_cli/Cargo.toml @@ -12,4 +12,3 @@ rpassword = "1.0" bigint = "4.0" parity-rpc = { path = "../rpc" } parity-rpc-client = { path = "../rpc_client" } -ethcore-util = { path = "../util" } diff --git a/rpc_cli/src/lib.rs b/rpc_cli/src/lib.rs index 14bb5c706..f322129d1 100644 --- a/rpc_cli/src/lib.rs +++ b/rpc_cli/src/lib.rs @@ -1,9 +1,6 @@ extern crate futures; extern crate rpassword; -extern crate ethcore_util as util; -extern crate bigint; - extern crate parity_rpc as rpc; extern crate parity_rpc_client as client; diff --git a/secret_store/Cargo.toml b/secret_store/Cargo.toml index 7374396d5..19366142d 100644 --- a/secret_store/Cargo.toml +++ b/secret_store/Cargo.toml @@ -24,8 +24,7 @@ tokio-proto = "0.1" url = "1.0" ethcore = { path = "../ethcore" } ethcore-bytes = { path = "../util/bytes" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" ethsync = { path = "../sync" } kvdb = { path = "../util/kvdb" } kvdb-rocksdb = { path = "../util/kvdb-rocksdb" } diff --git a/secret_store/src/acl_storage.rs b/secret_store/src/acl_storage.rs index e5637f81c..5f8a0d268 100644 --- a/secret_store/src/acl_storage.rs +++ b/secret_store/src/acl_storage.rs @@ -21,8 +21,7 @@ use parking_lot::{Mutex, RwLock}; use ethkey::public_to_address; use ethcore::client::{BlockChainClient, BlockId, ChainNotify}; use native_contracts::SecretStoreAclStorage; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use bytes::Bytes; use trusted_client::TrustedClient; use types::all::{Error, ServerKeyId, Public}; diff --git a/secret_store/src/key_server.rs b/secret_store/src/key_server.rs index 51f96302b..32d1da79f 100644 --- a/secret_store/src/key_server.rs +++ b/secret_store/src/key_server.rs @@ -215,7 +215,7 @@ pub mod tests { use node_key_pair::PlainNodeKeyPair; use key_server_set::tests::MapKeyServerSet; use key_server_cluster::math; - use bigint::hash::H256; + use ethereum_types::H256; use types::all::{Error, Public, ClusterConfiguration, NodeAddress, RequestSignature, ServerKeyId, EncryptedDocumentKey, EncryptedDocumentKeyShadow, MessageHash, EncryptedMessageSignature, NodeId}; use traits::{AdminSessionsServer, ServerKeyGenerator, DocumentKeyServer, MessageSigner, KeyServer}; 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 3b931a45b..19fef08bc 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 @@ -16,7 +16,7 @@ use std::sync::Arc; use std::collections::{BTreeSet, BTreeMap}; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::Secret; use parking_lot::{Mutex, Condvar}; use key_server_cluster::{Error, SessionId, NodeId, DocumentKeyShare}; diff --git a/secret_store/src/key_server_cluster/admin_sessions/servers_set_change_session.rs b/secret_store/src/key_server_cluster/admin_sessions/servers_set_change_session.rs index e81259c94..c14e34daa 100644 --- a/secret_store/src/key_server_cluster/admin_sessions/servers_set_change_session.rs +++ b/secret_store/src/key_server_cluster/admin_sessions/servers_set_change_session.rs @@ -18,7 +18,7 @@ use std::sync::Arc; use std::collections::{BTreeSet, BTreeMap}; use std::collections::btree_map::Entry; use parking_lot::{Mutex, Condvar}; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{Public, Signature}; use key_server_cluster::{Error, NodeId, SessionId, KeyStorage}; use key_server_cluster::math; diff --git a/secret_store/src/key_server_cluster/admin_sessions/share_add_session.rs b/secret_store/src/key_server_cluster/admin_sessions/share_add_session.rs index 4cb70228a..44e823d6c 100644 --- a/secret_store/src/key_server_cluster/admin_sessions/share_add_session.rs +++ b/secret_store/src/key_server_cluster/admin_sessions/share_add_session.rs @@ -16,7 +16,7 @@ use std::sync::Arc; use std::collections::{BTreeSet, BTreeMap}; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{Public, Secret, Signature}; use parking_lot::{Mutex, Condvar}; use key_server_cluster::{Error, SessionId, NodeId, DocumentKeyShare, DocumentKeyShareVersion, KeyStorage}; @@ -853,7 +853,7 @@ pub mod tests { use std::sync::Arc; use std::collections::{VecDeque, BTreeMap, BTreeSet}; use ethkey::{Random, Generator, Public, KeyPair, Signature, sign}; - use bigint::hash::H256; + use ethereum_types::H256; use key_server_cluster::{NodeId, SessionId, Error, KeyStorage, DummyKeyStorage}; use key_server_cluster::cluster::Cluster; use key_server_cluster::cluster::tests::DummyCluster; diff --git a/secret_store/src/key_server_cluster/admin_sessions/share_change_session.rs b/secret_store/src/key_server_cluster/admin_sessions/share_change_session.rs index bd045c188..228d7ba98 100644 --- a/secret_store/src/key_server_cluster/admin_sessions/share_change_session.rs +++ b/secret_store/src/key_server_cluster/admin_sessions/share_change_session.rs @@ -16,7 +16,7 @@ use std::sync::Arc; use std::collections::{BTreeSet, BTreeMap}; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::Secret; use key_server_cluster::{Error, NodeId, SessionId, KeyStorage}; use key_server_cluster::cluster::Cluster; 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 da2048ccf..d9277261d 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 @@ -17,7 +17,7 @@ use std::collections::BTreeSet; use std::sync::Arc; use parking_lot::{Mutex, Condvar}; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{Secret, Signature}; use key_server_cluster::{Error, AclStorage, DocumentKeyShare, NodeId, SessionId, EncryptedDocumentKeyShadow, SessionMeta}; use key_server_cluster::cluster::Cluster; diff --git a/secret_store/src/key_server_cluster/client_sessions/generation_session.rs b/secret_store/src/key_server_cluster/client_sessions/generation_session.rs index 92dee3709..18e831ef0 100644 --- a/secret_store/src/key_server_cluster/client_sessions/generation_session.rs +++ b/secret_store/src/key_server_cluster/client_sessions/generation_session.rs @@ -301,7 +301,7 @@ impl SessionImpl { self.on_session_error(sender, Error::Io(message.error.clone().into())); Ok(()) }, - &GenerationMessage::SessionCompleted(ref message) => + &GenerationMessage::SessionCompleted(ref message) => self.on_session_completed(sender.clone(), message), } } @@ -526,7 +526,7 @@ impl SessionImpl { data.secret_share.as_ref().expect("secret_share is filled in KG phase; we are at the end of KG phase; qed").clone(), )], }; - + if let Some(ref key_storage) = self.key_storage { key_storage.insert(self.id.clone(), encrypted_data.clone()) .map_err(|e| Error::KeyStorage(e.into()))?; @@ -626,7 +626,7 @@ impl SessionImpl { /// Keys verification (KV) phase fn verify_keys(&self) -> Result<(), Error> { let mut data = self.data.lock(); - + // key verification (KV) phase: check that other nodes have passed correct secrets let threshold = data.threshold.expect("threshold is filled in initialization phase; KV phase follows initialization phase; qed"); let derived_point = data.derived_point.clone().expect("derived point generated on initialization phase; KV phase follows initialization phase; qed"); @@ -674,7 +674,7 @@ impl SessionImpl { /// Complete generation fn complete_generation(&self) -> Result<(), Error> { let mut data = self.data.lock(); - + // calculate joint public key let joint_public = { let public_shares = data.nodes.values().map(|n| n.public_share.as_ref().expect("keys received on KD phase; KG phase follows KD phase; qed")); @@ -1305,8 +1305,6 @@ pub mod tests { #[test] fn encryption_session_works_over_network() { - //::util::log::init_log(); - let test_cases = [(1, 3)]; for &(threshold, num_nodes) in &test_cases { let mut core = Core::new().unwrap(); diff --git a/secret_store/src/key_server_cluster/client_sessions/signing_session.rs b/secret_store/src/key_server_cluster/client_sessions/signing_session.rs index cd72cc8e7..fe8ecf2fa 100644 --- a/secret_store/src/key_server_cluster/client_sessions/signing_session.rs +++ b/secret_store/src/key_server_cluster/client_sessions/signing_session.rs @@ -18,7 +18,7 @@ use std::collections::BTreeSet; use std::sync::Arc; use parking_lot::{Mutex, Condvar}; use ethkey::{Public, Secret, Signature}; -use bigint::hash::H256; +use ethereum_types::H256; use key_server_cluster::{Error, NodeId, SessionId, SessionMeta, AclStorage, DocumentKeyShare}; use key_server_cluster::cluster::{Cluster}; use key_server_cluster::cluster_sessions::{SessionIdWithSubSession, ClusterSession}; @@ -799,7 +799,7 @@ mod tests { use std::sync::Arc; use std::str::FromStr; use std::collections::{BTreeMap, VecDeque}; - use bigint::hash::H256; + use ethereum_types::H256; use ethkey::{self, Random, Generator, Public, Secret, KeyPair}; use acl_storage::DummyAclStorage; use key_server_cluster::{NodeId, DummyKeyStorage, DocumentKeyShare, DocumentKeyShareVersion, SessionId, SessionMeta, Error, KeyStorage}; diff --git a/secret_store/src/key_server_cluster/cluster.rs b/secret_store/src/key_server_cluster/cluster.rs index c32097c82..913c13bbf 100644 --- a/secret_store/src/key_server_cluster/cluster.rs +++ b/secret_store/src/key_server_cluster/cluster.rs @@ -27,7 +27,7 @@ use tokio_io::IoFuture; use tokio_core::reactor::{Handle, Remote, Interval}; use tokio_core::net::{TcpListener, TcpStream}; use ethkey::{Public, KeyPair, Signature, Random, Generator}; -use bigint::hash::H256; +use ethereum_types::H256; use key_server_cluster::{Error, NodeId, SessionId, AclStorage, KeyStorage, KeyServerSet, NodeKeyPair}; use key_server_cluster::cluster_sessions::{ClusterSession, AdminSession, ClusterSessions, SessionIdWithSubSession, ClusterSessionsContainer, SERVERS_SET_CHANGE_SESSION_ID, create_cluster_view, AdminSessionCreationData, ClusterSessionsListener}; @@ -1038,7 +1038,7 @@ pub mod tests { use std::collections::{BTreeSet, VecDeque}; use parking_lot::Mutex; use tokio_core::reactor::Core; - use bigint::hash::H256; + use ethereum_types::H256; use ethkey::{Random, Generator, Public, Signature, sign}; use key_server_cluster::{NodeId, SessionId, Error, DummyAclStorage, DummyKeyStorage, MapKeyServerSet, PlainNodeKeyPair, KeyStorage}; use key_server_cluster::message::Message; @@ -1309,7 +1309,7 @@ pub mod tests { // try to start generation session => fails in initialization assert_eq!(clusters[0].client().new_generation_session(SessionId::default(), Public::default(), 100).map(|_| ()), Err(Error::InvalidThreshold)); - + assert!(clusters[0].data.sessions.generation_sessions.is_empty()); } diff --git a/secret_store/src/key_server_cluster/cluster_sessions.rs b/secret_store/src/key_server_cluster/cluster_sessions.rs index b5ddf5311..ff3ccca8e 100644 --- a/secret_store/src/key_server_cluster/cluster_sessions.rs +++ b/secret_store/src/key_server_cluster/cluster_sessions.rs @@ -19,7 +19,7 @@ use std::sync::{Arc, Weak}; use std::sync::atomic::AtomicBool; use std::collections::{VecDeque, BTreeMap, BTreeSet}; use parking_lot::{Mutex, RwLock, Condvar}; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{Secret, Signature}; use key_server_cluster::{Error, NodeId, SessionId}; use key_server_cluster::cluster::{Cluster, ClusterData, ClusterConfiguration, ClusterView}; diff --git a/secret_store/src/key_server_cluster/connection_trigger.rs b/secret_store/src/key_server_cluster/connection_trigger.rs index ba9ff99c9..208700c03 100644 --- a/secret_store/src/key_server_cluster/connection_trigger.rs +++ b/secret_store/src/key_server_cluster/connection_trigger.rs @@ -18,7 +18,7 @@ use std::collections::{BTreeSet, BTreeMap}; use std::collections::btree_map::Entry; use std::net::SocketAddr; use std::sync::Arc; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::Public; use key_server_cluster::{KeyServerSet, KeyServerSetSnapshot}; use key_server_cluster::cluster::{ClusterClient, ClusterConnectionsData}; 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 cb9525742..42dfb0574 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 @@ -17,7 +17,7 @@ use std::collections::{BTreeSet, BTreeMap}; use std::net::SocketAddr; use std::sync::Arc; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::Public; use parking_lot::Mutex; use key_server_cluster::{KeyServerSet, KeyServerSetSnapshot, KeyServerSetMigration, is_migration_required}; diff --git a/secret_store/src/key_server_cluster/io/handshake.rs b/secret_store/src/key_server_cluster/io/handshake.rs index 22f841a15..c48ed27da 100644 --- a/secret_store/src/key_server_cluster/io/handshake.rs +++ b/secret_store/src/key_server_cluster/io/handshake.rs @@ -39,7 +39,7 @@ use futures::{Future, Poll, Async}; use tokio_io::{AsyncRead, AsyncWrite}; use ethcrypto::ecdh::agree; use ethkey::{Random, Generator, KeyPair, Public, Signature, verify_public, sign, recover}; -use bigint::hash::H256; +use ethereum_types::H256; use key_server_cluster::{NodeId, Error, NodeKeyPair}; use key_server_cluster::message::{Message, ClusterMessage, NodePublicKey, NodePrivateKeySignature}; use key_server_cluster::io::{write_message, write_encrypted_message, WriteMessage, ReadMessage, @@ -193,7 +193,7 @@ impl Future for Handshake where A: AsyncRead + AsyncWrite { self.peer_session_public.as_ref().expect( "we are in passive mode; in passive mode SendPublicKey follows ReceivePublicKey; peer_session_public is filled in ReceivePublicKey; qed"), ); - + self.shared_key = match shared_key { Ok(shared_key) => Some(shared_key), Err(err) => return Ok((stream, Err(err)).into()), @@ -318,7 +318,7 @@ mod tests { use std::collections::BTreeSet; use futures::Future; use ethkey::{Random, Generator, sign}; - use bigint::hash::H256; + use ethereum_types::H256; use key_server_cluster::PlainNodeKeyPair; use key_server_cluster::io::message::tests::TestIo; use key_server_cluster::message::{Message, ClusterMessage, NodePublicKey, NodePrivateKeySignature}; diff --git a/secret_store/src/key_server_cluster/io/message.rs b/secret_store/src/key_server_cluster/io/message.rs index 0bf561449..d0fce230f 100644 --- a/secret_store/src/key_server_cluster/io/message.rs +++ b/secret_store/src/key_server_cluster/io/message.rs @@ -22,8 +22,7 @@ use serde_json; use ethcrypto::ecies::{encrypt_single_message, decrypt_single_message}; use ethkey::{Secret, KeyPair}; use ethkey::math::curve_order; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use key_server_cluster::Error; use key_server_cluster::message::{Message, ClusterMessage, GenerationMessage, EncryptionMessage, DecryptionMessage, SigningMessage, ServersSetChangeMessage, ShareAddMessage, KeyVersionNegotiationMessage}; 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 1ed58ddde..d28233f7f 100644 --- a/secret_store/src/key_server_cluster/jobs/decryption_job.rs +++ b/secret_store/src/key_server_cluster/jobs/decryption_job.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use std::collections::{BTreeSet, BTreeMap}; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{Public, Secret}; use ethcrypto::ecies::encrypt; use ethcrypto::DEFAULT_MAC; diff --git a/secret_store/src/key_server_cluster/jobs/signing_job.rs b/secret_store/src/key_server_cluster/jobs/signing_job.rs index 7b02de1c0..cf9bd533d 100644 --- a/secret_store/src/key_server_cluster/jobs/signing_job.rs +++ b/secret_store/src/key_server_cluster/jobs/signing_job.rs @@ -16,7 +16,7 @@ use std::collections::{BTreeSet, BTreeMap}; use ethkey::{Public, Secret}; -use bigint::hash::H256; +use ethereum_types::H256; use key_server_cluster::{Error, NodeId, DocumentKeyShare}; use key_server_cluster::math; use key_server_cluster::jobs::job_session::{JobPartialRequestAction, JobPartialResponseAction, JobExecutor}; diff --git a/secret_store/src/key_server_cluster/math.rs b/secret_store/src/key_server_cluster/math.rs index 352a1e015..b8104c78b 100644 --- a/secret_store/src/key_server_cluster/math.rs +++ b/secret_store/src/key_server_cluster/math.rs @@ -15,8 +15,7 @@ // along with Parity. If not, see . use ethkey::{Public, Secret, Random, Generator, math}; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use hash::keccak; use key_server_cluster::Error; diff --git a/secret_store/src/key_server_set.rs b/secret_store/src/key_server_set.rs index f60b377ec..7b48909b1 100644 --- a/secret_store/src/key_server_set.rs +++ b/secret_store/src/key_server_set.rs @@ -24,8 +24,7 @@ use ethcore::client::{Client, BlockChainClient, BlockId, ChainNotify}; use ethkey::public_to_address; use native_contracts::KeyServerSet as KeyServerSetContract; use hash::keccak; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use bytes::Bytes; use types::all::{Error, Public, NodeAddress, NodeId}; use trusted_client::TrustedClient; @@ -544,7 +543,7 @@ fn block_confirmations(client: &BlockChainClient, block: H256) -> Option { pub mod tests { use std::collections::BTreeMap; use std::net::SocketAddr; - use bigint::hash::H256; + use ethereum_types::H256; use ethkey::Public; use super::{update_future_set, update_number_of_confirmations, FutureNewSet, KeyServerSet, KeyServerSetSnapshot, MIGRATION_CONFIRMATIONS_REQUIRED}; diff --git a/secret_store/src/key_storage.rs b/secret_store/src/key_storage.rs index 7fe3b24db..f540f357d 100644 --- a/secret_store/src/key_storage.rs +++ b/secret_store/src/key_storage.rs @@ -18,7 +18,7 @@ use std::path::PathBuf; use std::collections::BTreeMap; use serde_json; use tiny_keccak::Keccak; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{Secret, Public}; use kvdb_rocksdb::{Database, DatabaseIterator}; use types::all::{Error, ServiceConfiguration, ServerKeyId, NodeId}; diff --git a/secret_store/src/lib.rs b/secret_store/src/lib.rs index 3400e3fae..4e253f812 100644 --- a/secret_store/src/lib.rs +++ b/secret_store/src/lib.rs @@ -38,9 +38,8 @@ extern crate url; extern crate ethcore; extern crate ethcore_bytes as bytes; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_logger as logger; +extern crate ethereum_types; extern crate ethcrypto; extern crate ethkey; extern crate ethsync; diff --git a/secret_store/src/listener/service_contract.rs b/secret_store/src/listener/service_contract.rs index b7e365bed..f68dbe1ad 100644 --- a/secret_store/src/listener/service_contract.rs +++ b/secret_store/src/listener/service_contract.rs @@ -22,8 +22,7 @@ use ethcore::client::{Client, BlockChainClient, BlockId}; use ethkey::{Public, Signature, public_to_address}; use native_contracts::SecretStoreService; use hash::keccak; -use bigint::hash::H256; -use bigint::prelude::U256; +use ethereum_types::{H256, U256}; use listener::service_contract_listener::ServiceTask; use trusted_client::TrustedClient; use {ServerKeyId, NodeKeyPair, ContractAddress}; @@ -307,9 +306,9 @@ fn get_confirmed_block_hash(client: &Client, confirmations: u64) -> Option #[cfg(test)] pub mod tests { - use parking_lot::Mutex; + use parking_lot::Mutex; use ethkey::Public; - use bigint::hash::H256; + use ethereum_types::H256; use listener::service_contract_listener::ServiceTask; use ServerKeyId; use super::ServiceContract; diff --git a/secret_store/src/listener/service_contract_listener.rs b/secret_store/src/listener/service_contract_listener.rs index a8324c883..ab9b0b4d3 100644 --- a/secret_store/src/listener/service_contract_listener.rs +++ b/secret_store/src/listener/service_contract_listener.rs @@ -22,8 +22,7 @@ use parking_lot::Mutex; use ethcore::client::ChainNotify; use ethkey::{Random, Generator, Public, sign}; use bytes::Bytes; -use bigint::hash::H256; -use bigint::prelude::U256; +use ethereum_types::{H256, U256}; use key_server_set::KeyServerSet; use key_server_cluster::{ClusterClient, ClusterSessionsListener, ClusterSession}; use key_server_cluster::generation_session::SessionImpl as GenerationSession; diff --git a/secret_store/src/node_key_pair.rs b/secret_store/src/node_key_pair.rs index f50c765f2..75c840185 100644 --- a/secret_store/src/node_key_pair.rs +++ b/secret_store/src/node_key_pair.rs @@ -18,8 +18,7 @@ use std::sync::Arc; use ethcrypto::ecdh::agree; use ethkey::{KeyPair, Public, Signature, Error as EthKeyError, sign, public_to_address}; use ethcore::account_provider::AccountProvider; -use bigint::hash::H256; -use util::Address; +use ethereum_types::{H256, Address}; use traits::NodeKeyPair; pub struct PlainNodeKeyPair { diff --git a/secret_store/src/serialization.rs b/secret_store/src/serialization.rs index 8125eea1b..3831b67ca 100644 --- a/secret_store/src/serialization.rs +++ b/secret_store/src/serialization.rs @@ -21,7 +21,7 @@ use rustc_hex::{ToHex, FromHex}; use serde::{Serialize, Deserialize, Serializer, Deserializer}; use serde::de::{Visitor, Error as SerdeError}; use ethkey::{Public, Secret, Signature}; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; /// Serializable message hash. diff --git a/secret_store/src/traits.rs b/secret_store/src/traits.rs index 15e1af84d..ca3439fa4 100644 --- a/secret_store/src/traits.rs +++ b/secret_store/src/traits.rs @@ -15,8 +15,9 @@ // along with Parity. If not, see . use std::collections::BTreeSet; -use ethkey::{KeyPair, Signature, Address, Error as EthKeyError}; -use bigint::hash::H256; +use ethkey::{KeyPair, Signature, Error as EthKeyError}; +use ethereum_types::{H256, Address}; + use types::all::{Error, Public, ServerKeyId, MessageHash, EncryptedMessageSignature, RequestSignature, EncryptedDocumentKey, EncryptedDocumentKeyShadow, NodeId}; diff --git a/secret_store/src/types/all.rs b/secret_store/src/types/all.rs index 5b628fa1f..c7b709829 100644 --- a/secret_store/src/types/all.rs +++ b/secret_store/src/types/all.rs @@ -18,16 +18,16 @@ use std::fmt; use std::collections::BTreeMap; use serde_json; -use {ethkey, kvdb, bytes, bigint, key_server_cluster}; +use {ethkey, kvdb, bytes, ethereum_types, key_server_cluster}; /// Node id. pub type NodeId = ethkey::Public; /// Server key id. When key is used to encrypt document, it could be document contents hash. -pub type ServerKeyId = bigint::hash::H256; +pub type ServerKeyId = ethereum_types::H256; /// Encrypted document key type. pub type EncryptedDocumentKey = bytes::Bytes; /// Message hash. -pub type MessageHash = bigint::hash::H256; +pub type MessageHash = ethereum_types::H256; /// Message signature. pub type EncryptedMessageSignature = bytes::Bytes; /// Request signature type. diff --git a/stratum/Cargo.toml b/stratum/Cargo.toml index d7245796e..46ecd537e 100644 --- a/stratum/Cargo.toml +++ b/stratum/Cargo.toml @@ -6,8 +6,8 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -ethcore-bigint = { path = "../util/bigint" } ethcore-logger = { path = "../logger" } +ethereum-types = "0.1" keccak-hash = { path = "../util/hash" } jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } diff --git a/stratum/src/lib.rs b/stratum/src/lib.rs index ebe90e8e4..1efaeb052 100644 --- a/stratum/src/lib.rs +++ b/stratum/src/lib.rs @@ -19,7 +19,7 @@ extern crate jsonrpc_tcp_server; extern crate jsonrpc_core; extern crate jsonrpc_macros; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate keccak_hash as hash; extern crate parking_lot; @@ -46,7 +46,7 @@ use std::sync::Arc; use std::net::SocketAddr; use std::collections::{HashSet, HashMap}; use hash::keccak; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::{RwLock, RwLockReadGuard}; type RpcResult = Result; diff --git a/stratum/src/traits.rs b/stratum/src/traits.rs index 8bb497091..431d338a4 100644 --- a/stratum/src/traits.rs +++ b/stratum/src/traits.rs @@ -16,7 +16,7 @@ use std; use std::error::Error as StdError; -use bigint::hash::H256; +use ethereum_types::H256; use jsonrpc_tcp_server::PushMessageError; #[derive(Debug, Clone)] diff --git a/sync/Cargo.toml b/sync/Cargo.toml index fea5fbf1e..eb90a11d7 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -8,13 +8,13 @@ authors = ["Parity Technologies "] [lib] [dependencies] -ethcore-util = { path = "../util" } ethcore-bytes = { path = "../util/bytes" } -ethcore-bigint = { path = "../util/bigint" } ethcore-network = { path = "../util/network" } ethcore-io = { path = "../util/io" } ethcore-light = { path = "../ethcore/light"} ethcore = { path = "../ethcore" } +ethereum-types = "0.1" +plain_hasher = { path = "../util/plain_hasher" } rlp = { path = "../util/rlp" } keccak-hash = { path = "../util/hash" } triehash = { path = "../util/triehash" } diff --git a/sync/src/api.rs b/sync/src/api.rs index 51b24c08e..79d69a552 100644 --- a/sync/src/api.rs +++ b/sync/src/api.rs @@ -20,8 +20,7 @@ use std::io; use bytes::Bytes; use network::{NetworkProtocolHandler, NetworkService, NetworkContext, HostInfo, PeerId, ProtocolId, NetworkConfiguration as BasicNetworkConfiguration, NonReservedPeerMode, Error, ErrorKind, ConnectionFilter}; -use bigint::prelude::U256; -use bigint::hash::{H256, H512}; +use ethereum_types::{H256, H512, U256}; use io::{TimerToken}; use ethcore::ethstore::ethkey::Secret; use ethcore::client::{BlockChainClient, ChainNotify}; diff --git a/sync/src/block_sync.rs b/sync/src/block_sync.rs index fbd7eddae..71687f225 100644 --- a/sync/src/block_sync.rs +++ b/sync/src/block_sync.rs @@ -21,7 +21,7 @@ use std::collections::{HashSet, VecDeque}; use std::cmp; use heapsize::HeapSizeOf; -use bigint::hash::H256; +use ethereum_types::H256; use rlp::*; use ethcore::views::{BlockView}; use ethcore::header::{BlockNumber, Header as BlockHeader}; diff --git a/sync/src/blocks.rs b/sync/src/blocks.rs index 8ad65e9a8..b9addf698 100644 --- a/sync/src/blocks.rs +++ b/sync/src/blocks.rs @@ -19,7 +19,7 @@ use std::collections::hash_map::Entry; use smallvec::SmallVec; use hash::{keccak, KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP}; use heapsize::HeapSizeOf; -use bigint::hash::H256; +use ethereum_types::H256; use triehash::ordered_trie_root; use bytes::Bytes; use rlp::*; diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 8cf21ef7b..249161f56 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -92,8 +92,8 @@ use std::collections::{HashSet, HashMap}; use std::cmp; use hash::keccak; use heapsize::HeapSizeOf; -use bigint::prelude::U256; -use bigint::hash::{H256, H256FastMap}; +use ethereum_types::{H256, U256}; +use plain_hasher::H256FastMap; use parking_lot::RwLock; use bytes::Bytes; use rlp::*; @@ -2220,12 +2220,11 @@ fn accepts_service_transaction(client_id: &str) -> bool { #[cfg(test)] mod tests { use std::collections::{HashSet, VecDeque}; - use {ethkey, Address}; + use ethkey; use network::PeerId; use tests::helpers::*; use tests::snapshot::TestSnapshotService; - use bigint::prelude::U256; - use bigint::hash::H256; + use ethereum_types::{H256, U256, Address}; use parking_lot::RwLock; use bytes::Bytes; use rlp::{Rlp, RlpStream, UntrustedRlp}; diff --git a/sync/src/lib.rs b/sync/src/lib.rs index 2d020e43d..64cd78cca 100644 --- a/sync/src/lib.rs +++ b/sync/src/lib.rs @@ -22,12 +22,13 @@ //! extern crate ethcore_network as network; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate ethcore_io as io; extern crate ethcore; +extern crate ethereum_types; extern crate env_logger; extern crate time; +extern crate plain_hasher; extern crate rand; extern crate semver; extern crate parking_lot; @@ -67,6 +68,3 @@ mod api; pub use api::*; pub use chain::{SyncStatus, SyncState}; pub use network::{validate_node_url, NonReservedPeerMode, Error, ErrorKind, ConnectionFilter, ConnectionDirection}; - -#[cfg(test)] -pub(crate) type Address = bigint::hash::H160; diff --git a/sync/src/light_sync/mod.rs b/sync/src/light_sync/mod.rs index 05a104607..12db882f0 100644 --- a/sync/src/light_sync/mod.rs +++ b/sync/src/light_sync/mod.rs @@ -45,8 +45,7 @@ use light::net::{ }; use light::request::{self, CompleteHeadersRequest as HeadersRequest}; use network::PeerId; -use bigint::prelude::U256; -use bigint::hash::H256; +use ethereum_types::{H256, U256}; use parking_lot::{Mutex, RwLock}; use rand::{Rng, OsRng}; diff --git a/sync/src/light_sync/response.rs b/sync/src/light_sync/response.rs index 59a75dc1d..4dfb383d4 100644 --- a/sync/src/light_sync/response.rs +++ b/sync/src/light_sync/response.rs @@ -22,7 +22,7 @@ use ethcore::encoded; use ethcore::header::Header; use light::request::{HashOrNumber, CompleteHeadersRequest as HeadersRequest}; use rlp::DecoderError; -use bigint::hash::H256; +use ethereum_types::H256; /// Errors found when decoding headers and verifying with basic constraints. #[derive(Debug, PartialEq)] diff --git a/sync/src/light_sync/sync_round.rs b/sync/src/light_sync/sync_round.rs index f8d1d438a..4fa7a528b 100644 --- a/sync/src/light_sync/sync_round.rs +++ b/sync/src/light_sync/sync_round.rs @@ -27,7 +27,7 @@ use light::net::ReqId; use light::request::CompleteHeadersRequest as HeadersRequest; use network::PeerId; -use bigint::hash::H256; +use ethereum_types::H256; use super::response; diff --git a/sync/src/snapshot.rs b/sync/src/snapshot.rs index 88725929f..d54b6bd3e 100644 --- a/sync/src/snapshot.rs +++ b/sync/src/snapshot.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use hash::keccak; -use bigint::hash::H256; +use ethereum_types::H256; use std::collections::HashSet; use ethcore::snapshot::ManifestData; diff --git a/sync/src/tests/consensus.rs b/sync/src/tests/consensus.rs index b65a72152..cab515fd0 100644 --- a/sync/src/tests/consensus.rs +++ b/sync/src/tests/consensus.rs @@ -16,7 +16,7 @@ use std::sync::Arc; use hash::keccak; -use bigint::prelude::U256; +use ethereum_types::{U256, Address}; use io::{IoHandler, IoContext, IoChannel}; use ethcore::client::{BlockChainClient, Client}; use ethcore::service::ClientIoMessage; @@ -26,7 +26,7 @@ use ethcore::transaction::*; use ethcore::account_provider::AccountProvider; use ethkey::{KeyPair, Secret}; use super::helpers::*; -use {SyncConfig, Address}; +use SyncConfig; struct TestIoHandler { client: Arc, diff --git a/sync/src/tests/helpers.rs b/sync/src/tests/helpers.rs index 49ab9bdb8..32a90b414 100644 --- a/sync/src/tests/helpers.rs +++ b/sync/src/tests/helpers.rs @@ -16,7 +16,7 @@ use std::collections::{VecDeque, HashSet, HashMap}; use std::sync::Arc; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::RwLock; use bytes::Bytes; use network::{self, PeerId, ProtocolId, PacketId, SessionInfo}; diff --git a/sync/src/tests/snapshot.rs b/sync/src/tests/snapshot.rs index 6ed616bae..516e3d7e2 100644 --- a/sync/src/tests/snapshot.rs +++ b/sync/src/tests/snapshot.rs @@ -17,7 +17,7 @@ use std::collections::HashMap; use std::sync::Arc; use hash::keccak; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::Mutex; use bytes::Bytes; use ethcore::snapshot::{SnapshotService, ManifestData, RestorationStatus}; diff --git a/sync/src/transactions_stats.rs b/sync/src/transactions_stats.rs index aa4aa136e..4d3300862 100644 --- a/sync/src/transactions_stats.rs +++ b/sync/src/transactions_stats.rs @@ -16,7 +16,8 @@ use api::TransactionStats; use std::collections::{HashSet, HashMap}; -use bigint::hash::{H256, H512, H256FastMap}; +use ethereum_types::{H256, H512}; +use plain_hasher::H256FastMap; type NodeId = H512; type BlockNumber = u64; diff --git a/transaction-pool/Cargo.toml b/transaction-pool/Cargo.toml index 3d53d3273..70aba5d04 100644 --- a/transaction-pool/Cargo.toml +++ b/transaction-pool/Cargo.toml @@ -7,6 +7,6 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" -log="0.3" +log = "0.3" smallvec = "0.4" -ethcore-bigint = { features = ["heapsizeof"], version="0.2" } +ethereum-types = { version = "0.1", features = ["heapsizeof"] } diff --git a/transaction-pool/src/error.rs b/transaction-pool/src/error.rs index 2adb75963..57fffebc0 100644 --- a/transaction-pool/src/error.rs +++ b/transaction-pool/src/error.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H256; +use ethereum_types::H256; error_chain! { errors { diff --git a/transaction-pool/src/lib.rs b/transaction-pool/src/lib.rs index 047178dab..987fdfc40 100644 --- a/transaction-pool/src/lib.rs +++ b/transaction-pool/src/lib.rs @@ -69,7 +69,7 @@ #![warn(missing_docs)] extern crate smallvec; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; #[macro_use] extern crate error_chain; @@ -100,7 +100,7 @@ pub use self::verifier::Verifier; use std::fmt; -use self::bigint::prelude::{H256, H160 as Address}; +use ethereum_types::{H256, Address}; /// Already verified transaction that can be safely queued. pub trait VerifiedTransaction: fmt::Debug { diff --git a/transaction-pool/src/pool.rs b/transaction-pool/src/pool.rs index 1c58da3fe..5978acf60 100644 --- a/transaction-pool/src/pool.rs +++ b/transaction-pool/src/pool.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use std::collections::{HashMap, BTreeSet}; -use bigint::hash::{H160, H256}; +use ethereum_types::{H160, H256}; use error; use listener::{Listener, NoopListener}; diff --git a/transaction-pool/src/tests/helpers.rs b/transaction-pool/src/tests/helpers.rs index faa9aba3e..4e03cc896 100644 --- a/transaction-pool/src/tests/helpers.rs +++ b/transaction-pool/src/tests/helpers.rs @@ -17,8 +17,9 @@ use std::cmp; use std::collections::HashMap; +use ethereum_types::U256; use {scoring, Scoring, Ready, Readiness, Address as Sender}; -use super::{Transaction, SharedTransaction, U256}; +use super::{Transaction, SharedTransaction}; #[derive(Default)] pub struct DummyScoring; diff --git a/transaction-pool/src/tests/mod.rs b/transaction-pool/src/tests/mod.rs index 8dfb0e149..326801162 100644 --- a/transaction-pool/src/tests/mod.rs +++ b/transaction-pool/src/tests/mod.rs @@ -22,7 +22,7 @@ use self::tx_builder::TransactionBuilder; use std::sync::Arc; -use bigint::prelude::{H256, U256, H160 as Address}; +use ethereum_types::{H256, U256, Address}; use super::*; #[derive(Debug, PartialEq)] diff --git a/updater/Cargo.toml b/updater/Cargo.toml index ec1b99296..7acfa4f17 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -12,9 +12,8 @@ target_info = "0.1" semver = "0.6" ethcore = { path = "../ethcore" } ethsync = { path = "../sync" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } +ethereum-types = "0.1" futures = "0.1" parking_lot = "0.4" parity-hash-fetch = { path = "../hash-fetch" } diff --git a/updater/src/lib.rs b/updater/src/lib.rs index 73ebc7ec4..84dfc49f0 100644 --- a/updater/src/lib.rs +++ b/updater/src/lib.rs @@ -17,9 +17,8 @@ //! Updater for Parity executables #[macro_use] extern crate log; -extern crate ethcore_util as util; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; +extern crate ethereum_types; extern crate parking_lot; extern crate parity_hash_fetch as hash_fetch; extern crate ethcore; diff --git a/updater/src/operations.rs b/updater/src/operations.rs index b9bb01bd7..f10cae4d9 100644 --- a/updater/src/operations.rs +++ b/updater/src/operations.rs @@ -4,16 +4,15 @@ use std::string::String; use std::result::Result; use std::fmt; use ethabi; -use util; -use bigint; +use ethereum_types; pub struct Operations { contract: ethabi::Contract, - address: util::Address, - do_call: Box) -> Result, String> + Send + Sync + 'static>, + address: ethereum_types::Address, + do_call: Box) -> Result, String> + Send + Sync + 'static>, } impl Operations { - pub fn new(address: util::Address, do_call: F) -> Self where F: Fn(util::Address, Vec) -> Result, String> + Send + Sync + 'static { + pub fn new(address: ethereum_types::Address, do_call: F) -> Self where F: Fn(ethereum_types::Address, Vec) -> Result, String> + Send + Sync + 'static { Operations { contract: ethabi::Contract::load(b"[{\"constant\":false,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"resetClientOwner\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_release\",\"type\":\"bytes32\"}],\"name\":\"isLatest\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"rejectTransaction\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_number\",\"type\":\"uint32\"},{\"name\":\"_name\",\"type\":\"bytes32\"},{\"name\":\"_hard\",\"type\":\"bool\"},{\"name\":\"_spec\",\"type\":\"bytes32\"}],\"name\":\"proposeFork\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"}],\"name\":\"removeClient\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_release\",\"type\":\"bytes32\"}],\"name\":\"release\",\"outputs\":[{\"name\":\"o_forkBlock\",\"type\":\"uint32\"},{\"name\":\"o_track\",\"type\":\"uint8\"},{\"name\":\"o_semver\",\"type\":\"uint24\"},{\"name\":\"o_critical\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_checksum\",\"type\":\"bytes32\"}],\"name\":\"build\",\"outputs\":[{\"name\":\"o_release\",\"type\":\"bytes32\"},{\"name\":\"o_platform\",\"type\":\"bytes32\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"rejectFork\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"client\",\"outputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"required\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"setClientOwner\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"fork\",\"outputs\":[{\"name\":\"name\",\"type\":\"bytes32\"},{\"name\":\"spec\",\"type\":\"bytes32\"},{\"name\":\"hard\",\"type\":\"bool\"},{\"name\":\"ratified\",\"type\":\"bool\"},{\"name\":\"requiredCount\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_release\",\"type\":\"bytes32\"},{\"name\":\"_platform\",\"type\":\"bytes32\"},{\"name\":\"_checksum\",\"type\":\"bytes32\"}],\"name\":\"addChecksum\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"confirmTransaction\",\"outputs\":[{\"name\":\"txSuccess\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"proxy\",\"outputs\":[{\"name\":\"requiredCount\",\"type\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"gas\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"addClient\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"clientOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_txid\",\"type\":\"bytes32\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_data\",\"type\":\"bytes\"},{\"name\":\"_value\",\"type\":\"uint256\"},{\"name\":\"_gas\",\"type\":\"uint256\"}],\"name\":\"proposeTransaction\",\"outputs\":[{\"name\":\"txSuccess\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"grandOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_release\",\"type\":\"bytes32\"},{\"name\":\"_forkBlock\",\"type\":\"uint32\"},{\"name\":\"_track\",\"type\":\"uint8\"},{\"name\":\"_semver\",\"type\":\"uint24\"},{\"name\":\"_critical\",\"type\":\"bool\"}],\"name\":\"addRelease\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"acceptFork\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"clientsRequired\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_release\",\"type\":\"bytes32\"}],\"name\":\"track\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_r\",\"type\":\"bool\"}],\"name\":\"setClientRequired\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"latestFork\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_track\",\"type\":\"uint8\"}],\"name\":\"latestInTrack\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_client\",\"type\":\"bytes32\"},{\"name\":\"_release\",\"type\":\"bytes32\"},{\"name\":\"_platform\",\"type\":\"bytes32\"}],\"name\":\"checksum\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"proposedFork\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"type\":\"function\"}]" as &[u8]).expect("JSON is autogenerated; qed"), address: address, @@ -24,7 +23,7 @@ impl Operations { /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_newOwner","type":"address"}],"name":"resetClientOwner","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn reset_client_owner(&self, _client: &str, _new_owner: &util::Address) -> Result<(), String> { + pub fn reset_client_owner(&self, _client: &str, _new_owner: ðereum_types::Address) -> Result<(), String> { let call = self.contract.function("resetClientOwner".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::Address(_new_owner.clone().0)] @@ -36,7 +35,7 @@ impl Operations { /// Auto-generated from: `{"constant":true,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_release","type":"bytes32"}],"name":"isLatest","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn is_latest(&self, _client: &str, _release: &bigint::hash::H256) -> Result { + pub fn is_latest(&self, _client: &str, _release: ðereum_types::H256) -> Result { let call = self.contract.function("isLatest".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::FixedBytes(_release.as_ref().to_owned())] @@ -48,7 +47,7 @@ impl Operations { /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_txid","type":"bytes32"}],"name":"rejectTransaction","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn reject_transaction(&self, _txid: &bigint::hash::H256) -> Result<(), String> { + pub fn reject_transaction(&self, _txid: ðereum_types::H256) -> Result<(), String> { let call = self.contract.function("rejectTransaction".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_txid.as_ref().to_owned())] @@ -60,7 +59,7 @@ impl Operations { /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn set_owner(&self, _new_owner: &util::Address) -> Result<(), String> { + pub fn set_owner(&self, _new_owner: ðereum_types::Address) -> Result<(), String> { let call = self.contract.function("setOwner".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::Address(_new_owner.clone().0)] @@ -72,10 +71,10 @@ impl Operations { /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_number","type":"uint32"},{"name":"_name","type":"bytes32"},{"name":"_hard","type":"bool"},{"name":"_spec","type":"bytes32"}],"name":"proposeFork","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn propose_fork(&self, _number: u32, _name: &bigint::hash::H256, _hard: bool, _spec: &bigint::hash::H256) -> Result<(), String> { + pub fn propose_fork(&self, _number: u32, _name: ðereum_types::H256, _hard: bool, _spec: ðereum_types::H256) -> Result<(), String> { let call = self.contract.function("proposeFork".into()).map_err(Self::as_string)?; let data = call.encode_input(& - vec![ethabi::Token::Uint({ let mut r = [0u8; 32]; bigint::prelude::U256::from(_number as u64).to_big_endian(&mut r); r }), ethabi::Token::FixedBytes(_name.as_ref().to_owned()), ethabi::Token::Bool(_hard), ethabi::Token::FixedBytes(_spec.as_ref().to_owned())] + vec![ethabi::Token::Uint({ let mut r = [0u8; 32]; ethereum_types::U256::from(_number as u64).to_big_endian(&mut r); r }), ethabi::Token::FixedBytes(_name.as_ref().to_owned()), ethabi::Token::Bool(_hard), ethabi::Token::FixedBytes(_spec.as_ref().to_owned())] ).map_err(Self::as_string)?; call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; @@ -96,26 +95,26 @@ impl Operations { /// Auto-generated from: `{"constant":true,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_release","type":"bytes32"}],"name":"release","outputs":[{"name":"o_forkBlock","type":"uint32"},{"name":"o_track","type":"uint8"},{"name":"o_semver","type":"uint24"},{"name":"o_critical","type":"bool"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn release(&self, _client: &str, _release: &bigint::hash::H256) -> Result<(u32, u8, u32, bool), String> { + pub fn release(&self, _client: &str, _release: ðereum_types::H256) -> Result<(u32, u8, u32, bool), String> { let call = self.contract.function("release".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::FixedBytes(_release.as_ref().to_owned())] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()).as_u64() as u32 }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()).as_u64() as u8 }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()).as_u64() as u32 }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()).as_u64() as u32 }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()).as_u64() as u8 }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()).as_u64() as u32 }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r })) } /// Auto-generated from: `{"constant":true,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_checksum","type":"bytes32"}],"name":"build","outputs":[{"name":"o_release","type":"bytes32"},{"name":"o_platform","type":"bytes32"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn build(&self, _client: &str, _checksum: &bigint::hash::H256) -> Result<(bigint::hash::H256, bigint::hash::H256), String> { + pub fn build(&self, _client: &str, _checksum: ðereum_types::H256) -> Result<(ethereum_types::H256, ethereum_types::H256), String> { let call = self.contract.function("build".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::FixedBytes(_checksum.as_ref().to_owned())] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; bigint::hash::H256::from_slice(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; bigint::hash::H256::from_slice(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; ethereum_types::H256::from_slice(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; ethereum_types::H256::from_slice(r.as_ref()) })) } /// Auto-generated from: `{"constant":false,"inputs":[],"name":"rejectFork","outputs":[],"payable":false,"type":"function"}` @@ -132,19 +131,19 @@ impl Operations { /// Auto-generated from: `{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"client","outputs":[{"name":"owner","type":"address"},{"name":"required","type":"bool"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn client(&self, _1: &bigint::hash::H256) -> Result<(util::Address, bool), String> { + pub fn client(&self, _1: ðereum_types::H256) -> Result<(ethereum_types::Address, bool), String> { let call = self.contract.function("client".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_1.as_ref().to_owned())] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_address().ok_or("Invalid type returned")?; util::Address::from(r) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_address().ok_or("Invalid type returned")?; ethereum_types::Address::from(r) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r })) } /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setClientOwner","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn set_client_owner(&self, _new_owner: &util::Address) -> Result<(), String> { + pub fn set_client_owner(&self, _new_owner: ðereum_types::Address) -> Result<(), String> { let call = self.contract.function("setClientOwner".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::Address(_new_owner.clone().0)] @@ -156,19 +155,19 @@ impl Operations { /// Auto-generated from: `{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"fork","outputs":[{"name":"name","type":"bytes32"},{"name":"spec","type":"bytes32"},{"name":"hard","type":"bool"},{"name":"ratified","type":"bool"},{"name":"requiredCount","type":"uint256"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn fork(&self, _1: u32) -> Result<(bigint::hash::H256, bigint::hash::H256, bool, bool, bigint::prelude::U256), String> { + pub fn fork(&self, _1: u32) -> Result<(ethereum_types::H256, ethereum_types::H256, bool, bool, ethereum_types::U256), String> { let call = self.contract.function("fork".into()).map_err(Self::as_string)?; let data = call.encode_input(& - vec![ethabi::Token::Uint({ let mut r = [0u8; 32]; bigint::prelude::U256::from(_1 as u64).to_big_endian(&mut r); r })] + vec![ethabi::Token::Uint({ let mut r = [0u8; 32]; ethereum_types::U256::from(_1 as u64).to_big_endian(&mut r); r })] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; bigint::hash::H256::from_slice(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; bigint::hash::H256::from_slice(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; ethereum_types::H256::from_slice(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; ethereum_types::H256::from_slice(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bool().ok_or("Invalid type returned")?; r }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()) })) } /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_release","type":"bytes32"},{"name":"_platform","type":"bytes32"},{"name":"_checksum","type":"bytes32"}],"name":"addChecksum","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn add_checksum(&self, _release: &bigint::hash::H256, _platform: &str, _checksum: &bigint::hash::H256) -> Result<(), String> { + pub fn add_checksum(&self, _release: ðereum_types::H256, _platform: &str, _checksum: ðereum_types::H256) -> Result<(), String> { let call = self.contract.function("addChecksum".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_release.as_ref().to_owned()), ethabi::Token::FixedBytes(_platform.as_bytes().to_owned()), ethabi::Token::FixedBytes(_checksum.as_ref().to_owned())] @@ -180,31 +179,31 @@ impl Operations { /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_txid","type":"bytes32"}],"name":"confirmTransaction","outputs":[{"name":"txSuccess","type":"uint256"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn confirm_transaction(&self, _txid: &bigint::hash::H256) -> Result { + pub fn confirm_transaction(&self, _txid: ðereum_types::H256) -> Result { let call = self.contract.function("confirmTransaction".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_txid.as_ref().to_owned())] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()) })) } /// Auto-generated from: `{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"proxy","outputs":[{"name":"requiredCount","type":"uint256"},{"name":"to","type":"address"},{"name":"data","type":"bytes"},{"name":"value","type":"uint256"},{"name":"gas","type":"uint256"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn proxy(&self, _1: &bigint::hash::H256) -> Result<(bigint::prelude::U256, util::Address, Vec, bigint::prelude::U256, bigint::prelude::U256), String> { + pub fn proxy(&self, _1: ðereum_types::H256) -> Result<(ethereum_types::U256, ethereum_types::Address, Vec, ethereum_types::U256, ethereum_types::U256), String> { let call = self.contract.function("proxy".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_1.as_ref().to_owned())] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_address().ok_or("Invalid type returned")?; util::Address::from(r) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bytes().ok_or("Invalid type returned")?; r }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_address().ok_or("Invalid type returned")?; ethereum_types::Address::from(r) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_bytes().ok_or("Invalid type returned")?; r }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()) }, { let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()) })) } /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_owner","type":"address"}],"name":"addClient","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn add_client(&self, _client: &str, _owner: &util::Address) -> Result<(), String> { + pub fn add_client(&self, _client: &str, _owner: ðereum_types::Address) -> Result<(), String> { let call = self.contract.function("addClient".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::Address(_owner.clone().0)] @@ -216,46 +215,46 @@ impl Operations { /// Auto-generated from: `{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"clientOwner","outputs":[{"name":"","type":"bytes32"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn client_owner(&self, _1: &util::Address) -> Result { + pub fn client_owner(&self, _1: ðereum_types::Address) -> Result { let call = self.contract.function("clientOwner".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::Address(_1.clone().0)] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; bigint::hash::H256::from_slice(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; ethereum_types::H256::from_slice(r.as_ref()) })) } /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_txid","type":"bytes32"},{"name":"_to","type":"address"},{"name":"_data","type":"bytes"},{"name":"_value","type":"uint256"},{"name":"_gas","type":"uint256"}],"name":"proposeTransaction","outputs":[{"name":"txSuccess","type":"uint256"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn propose_transaction(&self, _txid: &bigint::hash::H256, _to: &util::Address, _data: &[u8], _value: bigint::prelude::U256, _gas: bigint::prelude::U256) -> Result { + pub fn propose_transaction(&self, _txid: ðereum_types::H256, _to: ðereum_types::Address, _data: &[u8], _value: ethereum_types::U256, _gas: ethereum_types::U256) -> Result { let call = self.contract.function("proposeTransaction".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_txid.as_ref().to_owned()), ethabi::Token::Address(_to.clone().0), ethabi::Token::Bytes(_data.to_owned()), ethabi::Token::Uint({ let mut r = [0u8; 32]; _value.to_big_endian(&mut r); r }), ethabi::Token::Uint({ let mut r = [0u8; 32]; _gas.to_big_endian(&mut r); r })] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()) })) } /// Auto-generated from: `{"constant":true,"inputs":[],"name":"grandOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn grand_owner(&self) -> Result { + pub fn grand_owner(&self) -> Result { let call = self.contract.function("grandOwner".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![] ).map_err(Self::as_string)?; let output = call.decode_output(&&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_address().ok_or("Invalid type returned")?; util::Address::from(r) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_address().ok_or("Invalid type returned")?; ethereum_types::Address::from(r) })) } /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_release","type":"bytes32"},{"name":"_forkBlock","type":"uint32"},{"name":"_track","type":"uint8"},{"name":"_semver","type":"uint24"},{"name":"_critical","type":"bool"}],"name":"addRelease","outputs":[],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn add_release(&self, _release: &bigint::hash::H256, _fork_block: u32, _track: u8, _semver: u32, _critical: bool) -> Result<(), String> { + pub fn add_release(&self, _release: ðereum_types::H256, _fork_block: u32, _track: u8, _semver: u32, _critical: bool) -> Result<(), String> { let call = self.contract.function("addRelease".into()).map_err(Self::as_string)?; let data = call.encode_input(& - vec![ethabi::Token::FixedBytes(_release.as_ref().to_owned()), ethabi::Token::Uint({ let mut r = [0u8; 32]; bigint::prelude::U256::from(_fork_block as u64).to_big_endian(&mut r); r }), ethabi::Token::Uint({ let mut r = [0u8; 32]; bigint::prelude::U256::from(_track as u64).to_big_endian(&mut r); r }), ethabi::Token::Uint({ let mut r = [0u8; 32]; bigint::prelude::U256::from(_semver as u64).to_big_endian(&mut r); r }), ethabi::Token::Bool(_critical)] + vec![ethabi::Token::FixedBytes(_release.as_ref().to_owned()), ethabi::Token::Uint({ let mut r = [0u8; 32]; ethereum_types::U256::from(_fork_block as u64).to_big_endian(&mut r); r }), ethabi::Token::Uint({ let mut r = [0u8; 32]; ethereum_types::U256::from(_track as u64).to_big_endian(&mut r); r }), ethabi::Token::Uint({ let mut r = [0u8; 32]; ethereum_types::U256::from(_semver as u64).to_big_endian(&mut r); r }), ethabi::Token::Bool(_critical)] ).map_err(Self::as_string)?; call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; @@ -283,19 +282,19 @@ impl Operations { ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()).as_u64() as u32 })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()).as_u64() as u32 })) } /// Auto-generated from: `{"constant":true,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_release","type":"bytes32"}],"name":"track","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn track(&self, _client: &str, _release: &bigint::hash::H256) -> Result { + pub fn track(&self, _client: &str, _release: ðereum_types::H256) -> Result { let call = self.contract.function("track".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::FixedBytes(_release.as_ref().to_owned())] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()).as_u64() as u8 })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()).as_u64() as u8 })) } /// Auto-generated from: `{"constant":false,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_r","type":"bool"}],"name":"setClientRequired","outputs":[],"payable":false,"type":"function"}` @@ -317,31 +316,31 @@ impl Operations { let data = call.encode_input(&[]).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()).as_u64() as u32 })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()).as_u64() as u32 })) } /// Auto-generated from: `{"constant":true,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_track","type":"uint8"}],"name":"latestInTrack","outputs":[{"name":"","type":"bytes32"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn latest_in_track(&self, _client: &str, _track: u8) -> Result { + pub fn latest_in_track(&self, _client: &str, _track: u8) -> Result { let call = self.contract.function("latestInTrack".into()).map_err(Self::as_string)?; let data = call.encode_input(& - &vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::Uint({ let mut r = [0u8; 32]; bigint::prelude::U256::from(_track as u64).to_big_endian(&mut r); r })] + &vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::Uint({ let mut r = [0u8; 32]; ethereum_types::U256::from(_track as u64).to_big_endian(&mut r); r })] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; bigint::hash::H256::from_slice(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; ethereum_types::H256::from_slice(r.as_ref()) })) } /// Auto-generated from: `{"constant":true,"inputs":[{"name":"_client","type":"bytes32"},{"name":"_release","type":"bytes32"},{"name":"_platform","type":"bytes32"}],"name":"checksum","outputs":[{"name":"","type":"bytes32"}],"payable":false,"type":"function"}` #[allow(dead_code)] - pub fn checksum(&self, _client: &str, _release: &bigint::hash::H256, _platform: &str) -> Result { + pub fn checksum(&self, _client: &str, _release: ðereum_types::H256, _platform: &str) -> Result { let call = self.contract.function("checksum".into()).map_err(Self::as_string)?; let data = call.encode_input(& vec![ethabi::Token::FixedBytes(_client.as_bytes().to_owned()), ethabi::Token::FixedBytes(_release.as_ref().to_owned()), ethabi::Token::FixedBytes(_platform.as_bytes().to_owned())] ).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; bigint::hash::H256::from_slice(r.as_ref()) })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_fixed_bytes().ok_or("Invalid type returned")?; ethereum_types::H256::from_slice(r.as_ref()) })) } /// Auto-generated from: `{"constant":true,"inputs":[],"name":"proposedFork","outputs":[{"name":"","type":"uint32"}],"payable":false,"type":"function"}` @@ -351,6 +350,6 @@ impl Operations { let data = call.encode_input(&[]).map_err(Self::as_string)?; let output = call.decode_output(&(self.do_call)(self.address.clone(), data)?).map_err(Self::as_string)?; let mut result = output.into_iter().rev().collect::>(); - Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; bigint::prelude::U256::from(r.as_ref()).as_u64() as u32 })) + Ok(({ let r = result.pop().ok_or("Invalid return arity")?; let r = r.to_uint().ok_or("Invalid type returned")?; ethereum_types::U256::from(r.as_ref()).as_u64() as u32 })) } } diff --git a/updater/src/types/all.rs b/updater/src/types/all.rs index b20b2fa41..7079fb8de 100644 --- a/updater/src/types/all.rs +++ b/updater/src/types/all.rs @@ -16,7 +16,7 @@ //! Types used in the public API -use bigint::hash::H256; +use ethereum_types::H256; use types::VersionInfo; /// Information regarding a particular release of Parity diff --git a/updater/src/types/version_info.rs b/updater/src/types/version_info.rs index ea9b44577..4409153e2 100644 --- a/updater/src/types/version_info.rs +++ b/updater/src/types/version_info.rs @@ -17,8 +17,8 @@ //! Types used in the public API use std::fmt; -use semver::{Version}; -use bigint::hash::H160; +use semver::Version; +use ethereum_types::H160; use version::raw_package_info; use types::ReleaseTrack; diff --git a/updater/src/updater.rs b/updater/src/updater.rs index 72ddaa7fe..347d2ccf9 100644 --- a/updater/src/updater.rs +++ b/updater/src/updater.rs @@ -30,8 +30,7 @@ use path::restrict_permissions_owner; use service::{Service}; use target_info::Target; use types::{ReleaseInfo, OperationsInfo, CapState, VersionInfo, ReleaseTrack}; -use bigint::hash::{H160, H256}; -use util::Address; +use ethereum_types::{H160, H256, Address}; use bytes::Bytes; use parking_lot::Mutex; use version; diff --git a/util/Cargo.toml b/util/Cargo.toml deleted file mode 100644 index e60b3c8eb..000000000 --- a/util/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -description = "Ethcore utility library" -homepage = "http://parity.io" -license = "GPL-3.0" -name = "ethcore-util" -version = "1.9.0" -authors = ["Parity Technologies "] - -[dependencies] -ethcore-bigint = { path = "bigint", features = ["heapsizeof"] } -hashdb = { path = "hashdb" } -memorydb = { path = "memorydb" } - -[dev-dependencies] -ethcore-bytes = { path = "bytes" } -keccak-hash = { path = "hash" } -log = "0.3" -patricia-trie = { path = "patricia_trie" } -triehash = { path = "triehash" } diff --git a/util/bigint/Cargo.toml b/util/bigint/Cargo.toml deleted file mode 100644 index 3e9f9fd37..000000000 --- a/util/bigint/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -description = "Large fixed-size integers and hash function outputs" -homepage = "http://parity.io" -repository = "https://github.com/paritytech/parity" -license = "MIT/Apache-2.0" -name = "ethcore-bigint" -version = "0.2.1" -authors = ["Parity Technologies "] - -[dependencies] -bigint = "4.0" -rustc-hex = "1.0" -rand = "0.3.12" -libc = "0.2" -heapsize = { version = "0.4", optional = true } -plain_hasher = { path = "../plain_hasher", version = "0.1" } - -[features] -x64asm_arithmetic=[] -rust_arithmetic=[] -std = ["bigint/std"] -heapsizeof = ["heapsize", "bigint/heapsizeof"] diff --git a/util/bigint/LICENSE-APACHE2 b/util/bigint/LICENSE-APACHE2 deleted file mode 100644 index 16fe87b06..000000000 --- a/util/bigint/LICENSE-APACHE2 +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/util/bigint/LICENSE-MIT b/util/bigint/LICENSE-MIT deleted file mode 100644 index cd8fdd2b9..000000000 --- a/util/bigint/LICENSE-MIT +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2017 Parity Technologies - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/util/bigint/README.md b/util/bigint/README.md deleted file mode 100644 index 86cf41aab..000000000 --- a/util/bigint/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Bigint - -Big numbers and hashes - -## License - -Unlike most parts of Parity, which fall under the GPLv3, this package is dual-licensed under MIT/Apache2 at the user's choice. -Find the associated license files in this directory as `LICENSE-MIT` and `LICENSE-APACHE2` respectively. diff --git a/util/bigint/license-header b/util/bigint/license-header deleted file mode 100644 index 03df169c8..000000000 --- a/util/bigint/license-header +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2015-2017 Parity Technologies -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. diff --git a/util/bigint/src/hash.rs b/util/bigint/src/hash.rs deleted file mode 100644 index 5581bbc20..000000000 --- a/util/bigint/src/hash.rs +++ /dev/null @@ -1,524 +0,0 @@ -// Copyright 2015-2017 Parity Technologies -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! General hash types, a fixed-size raw-data type used as the output of hash functions. - -use std::{ops, fmt, cmp, str}; -use std::cmp::{min, Ordering}; -use std::ops::{Deref, DerefMut, BitXor, BitAnd, BitOr, IndexMut, Index}; -use std::hash::{Hash, Hasher, BuildHasherDefault}; -use std::collections::{HashMap, HashSet}; -use rand::{Rand, Rng}; -use rand::os::OsRng; -use rustc_hex::{FromHex, FromHexError}; -use plain_hasher::PlainHasher; -use uint::U256; -use libc::{c_void, memcmp}; - -/// Return `s` without the `0x` at the beginning of it, if any. -pub fn clean_0x(s: &str) -> &str { - if s.starts_with("0x") { - &s[2..] - } else { - s - } -} - -macro_rules! impl_hash { - ($from: ident, $size: expr) => { - #[repr(C)] - /// Unformatted binary data of fixed length. - pub struct $from (pub [u8; $size]); - - - impl From<[u8; $size]> for $from { - fn from(bytes: [u8; $size]) -> Self { - $from(bytes) - } - } - - impl From<$from> for [u8; $size] { - fn from(s: $from) -> Self { - s.0 - } - } - - impl Deref for $from { - type Target = [u8]; - - #[inline] - fn deref(&self) -> &[u8] { - &self.0 - } - } - - impl AsRef<[u8]> for $from { - #[inline] - fn as_ref(&self) -> &[u8] { - &self.0 - } - } - - impl DerefMut for $from { - #[inline] - fn deref_mut(&mut self) -> &mut [u8] { - &mut self.0 - } - } - - impl $from { - /// Create a new, zero-initialised, instance. - pub fn new() -> $from { - $from([0; $size]) - } - - /// Synonym for `new()`. Prefer to new as it's more readable. - pub fn zero() -> $from { - $from([0; $size]) - } - - /// Create a new, cryptographically random, instance. - pub fn random() -> $from { - let mut hash = $from::new(); - hash.randomize(); - hash - } - - /// Assign self have a cryptographically random value. - pub fn randomize(&mut self) { - let mut rng = OsRng::new().unwrap(); - *self= $from::rand(&mut rng); - } - - /// Get the size of this object in bytes. - pub fn len() -> usize { - $size - } - - #[inline] - /// Assign self to be of the same value as a slice of bytes of length `len()`. - pub fn clone_from_slice(&mut self, src: &[u8]) -> usize { - let min = cmp::min($size, src.len()); - self.0[..min].copy_from_slice(&src[..min]); - min - } - - /// Convert a slice of bytes of length `len()` to an instance of this type. - pub fn from_slice(src: &[u8]) -> Self { - let mut r = Self::new(); - r.clone_from_slice(src); - r - } - - /// Copy the data of this object into some mutable slice of length `len()`. - pub fn copy_to(&self, dest: &mut[u8]) { - let min = cmp::min($size, dest.len()); - dest[..min].copy_from_slice(&self.0[..min]); - } - - /// Returns `true` if all bits set in `b` are also set in `self`. - pub fn contains<'a>(&'a self, b: &'a Self) -> bool { - &(b & self) == b - } - - /// Returns `true` if no bits are set. - pub fn is_zero(&self) -> bool { - self.eq(&Self::new()) - } - - /// Returns the lowest 8 bytes interpreted as a BigEndian integer. - pub fn low_u64(&self) -> u64 { - let mut ret = 0u64; - for i in 0..min($size, 8) { - ret |= (self.0[$size - 1 - i] as u64) << (i * 8); - } - ret - } - } - - impl str::FromStr for $from { - type Err = FromHexError; - - fn from_str(s: &str) -> Result<$from, FromHexError> { - let a = s.from_hex()?; - if a.len() != $size { - return Err(FromHexError::InvalidHexLength); - } - - let mut ret = [0;$size]; - ret.copy_from_slice(&a); - Ok($from(ret)) - } - } - - impl fmt::Debug for $from { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - for i in &self.0[..] { - write!(f, "{:02x}", i)?; - } - Ok(()) - } - } - - impl fmt::Display for $from { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - for i in &self.0[0..2] { - write!(f, "{:02x}", i)?; - } - write!(f, "…")?; - for i in &self.0[$size - 2..$size] { - write!(f, "{:02x}", i)?; - } - Ok(()) - } - } - - impl Copy for $from {} - impl Clone for $from { - fn clone(&self) -> $from { - let mut ret = $from::new(); - ret.0.copy_from_slice(&self.0); - ret - } - } - - impl Eq for $from {} - - impl PartialEq for $from { - fn eq(&self, other: &Self) -> bool { - unsafe { memcmp(self.0.as_ptr() as *const c_void, other.0.as_ptr() as *const c_void, $size) == 0 } - } - } - - impl Ord for $from { - fn cmp(&self, other: &Self) -> Ordering { - let r = unsafe { memcmp(self.0.as_ptr() as *const c_void, other.0.as_ptr() as *const c_void, $size) }; - if r < 0 { return Ordering::Less } - if r > 0 { return Ordering::Greater } - return Ordering::Equal; - } - } - - impl PartialOrd for $from { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } - } - - impl Hash for $from { - fn hash(&self, state: &mut H) where H: Hasher { - state.write(&self.0); - state.finish(); - } - } - - impl Index for $from { - type Output = u8; - - fn index(&self, index: usize) -> &u8 { - &self.0[index] - } - } - impl IndexMut for $from { - fn index_mut(&mut self, index: usize) -> &mut u8 { - &mut self.0[index] - } - } - impl Index> for $from { - type Output = [u8]; - - fn index(&self, index: ops::Range) -> &[u8] { - &self.0[index] - } - } - impl IndexMut> for $from { - fn index_mut(&mut self, index: ops::Range) -> &mut [u8] { - &mut self.0[index] - } - } - impl Index for $from { - type Output = [u8]; - - fn index(&self, _index: ops::RangeFull) -> &[u8] { - &self.0 - } - } - impl IndexMut for $from { - fn index_mut(&mut self, _index: ops::RangeFull) -> &mut [u8] { - &mut self.0 - } - } - - /// `BitOr` on references - impl<'a> BitOr for &'a $from { - type Output = $from; - - fn bitor(self, rhs: Self) -> Self::Output { - let mut ret: $from = $from::default(); - for i in 0..$size { - ret.0[i] = self.0[i] | rhs.0[i]; - } - ret - } - } - - /// Moving `BitOr` - impl BitOr for $from { - type Output = $from; - - fn bitor(self, rhs: Self) -> Self::Output { - &self | &rhs - } - } - - /// `BitAnd` on references - impl <'a> BitAnd for &'a $from { - type Output = $from; - - fn bitand(self, rhs: Self) -> Self::Output { - let mut ret: $from = $from::default(); - for i in 0..$size { - ret.0[i] = self.0[i] & rhs.0[i]; - } - ret - } - } - - /// Moving `BitAnd` - impl BitAnd for $from { - type Output = $from; - - fn bitand(self, rhs: Self) -> Self::Output { - &self & &rhs - } - } - - /// `BitXor` on references - impl <'a> BitXor for &'a $from { - type Output = $from; - - fn bitxor(self, rhs: Self) -> Self::Output { - let mut ret: $from = $from::default(); - for i in 0..$size { - ret.0[i] = self.0[i] ^ rhs.0[i]; - } - ret - } - } - - /// Moving `BitXor` - impl BitXor for $from { - type Output = $from; - - fn bitxor(self, rhs: Self) -> Self::Output { - &self ^ &rhs - } - } - - impl $from { - /// Get a hex representation. - pub fn hex(&self) -> String { - format!("{:?}", self) - } - } - - impl Default for $from { - fn default() -> Self { $from::new() } - } - - impl From for $from { - fn from(mut value: u64) -> $from { - let mut ret = $from::new(); - for i in 0..8 { - if i < $size { - ret.0[$size - i - 1] = (value & 0xff) as u8; - value >>= 8; - } - } - ret - } - } - - impl From<&'static str> for $from { - fn from(s: &'static str) -> $from { - let s = clean_0x(s); - if s.len() % 2 == 1 { - ("0".to_owned() + s).parse().unwrap() - } else { - s.parse().unwrap() - } - } - } - - impl<'a> From<&'a [u8]> for $from { - fn from(s: &'a [u8]) -> $from { - $from::from_slice(s) - } - } - - impl Rand for $from { - fn rand(r: &mut R) -> Self { - let mut hash = $from::new(); - r.fill_bytes(&mut hash.0); - hash - } - } - } -} - -impl From for H256 { - fn from(value: U256) -> H256 { - let mut ret = H256::new(); - value.to_big_endian(&mut ret); - ret - } -} - -impl<'a> From<&'a U256> for H256 { - fn from(value: &'a U256) -> H256 { - let mut ret: H256 = H256::new(); - value.to_big_endian(&mut ret); - ret - } -} - -impl From for U256 { - fn from(value: H256) -> U256 { - U256::from(&value) - } -} - -impl<'a> From<&'a H256> for U256 { - fn from(value: &'a H256) -> U256 { - U256::from(value.as_ref() as &[u8]) - } -} - -impl From for H160 { - fn from(value: H256) -> H160 { - let mut ret = H160::new(); - ret.0.copy_from_slice(&value[12..32]); - ret - } -} - -impl From for H64 { - fn from(value: H256) -> H64 { - let mut ret = H64::new(); - ret.0.copy_from_slice(&value[20..28]); - ret - } -} - -impl From for H256 { - fn from(value: H160) -> H256 { - let mut ret = H256::new(); - ret.0[12..32].copy_from_slice(&value); - ret - } -} - -impl<'a> From<&'a H160> for H256 { - fn from(value: &'a H160) -> H256 { - let mut ret = H256::new(); - ret.0[12..32].copy_from_slice(value); - ret - } -} - -impl_hash!(H32, 4); -impl_hash!(H64, 8); -impl_hash!(H128, 16); -impl_hash!(H160, 20); -impl_hash!(H256, 32); -impl_hash!(H264, 33); -impl_hash!(H512, 64); -impl_hash!(H520, 65); -impl_hash!(H1024, 128); -impl_hash!(H2048, 256); - -#[cfg(feature="heapsizeof")] -known_heap_size!(0, H32, H64, H128, H160, H256, H264, H512, H520, H1024, H2048); -// Specialized HashMap and HashSet - -/// Specialized version of `HashMap` with H256 keys and fast hashing function. -pub type H256FastMap = HashMap>; -/// Specialized version of `HashSet` with H256 keys and fast hashing function. -pub type H256FastSet = HashSet>; - -#[cfg(test)] -mod tests { - use hash::*; - use std::str::FromStr; - - #[test] - fn hasher_alignment() { - use std::mem::align_of; - assert_eq!(align_of::(), align_of::()); - } - - #[test] - fn hash() { - let h = H64([0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef]); - assert_eq!(H64::from_str("0123456789abcdef").unwrap(), h); - assert_eq!(format!("{}", h), "0123…cdef"); - assert_eq!(format!("{:?}", h), "0123456789abcdef"); - assert_eq!(h.hex(), "0123456789abcdef"); - assert!(h == h); - assert!(h != H64([0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xee])); - assert!(h != H64([0; 8])); - } - - #[test] - fn hash_bitor() { - let a = H64([1; 8]); - let b = H64([2; 8]); - let c = H64([3; 8]); - - // borrow - assert_eq!(&a | &b, c); - - // move - assert_eq!(a | b, c); - } - - #[test] - fn from_and_to_address() { - let address: H160 = "ef2d6d194084c2de36e0dabfce45d046b37d1106".into(); - let h = H256::from(address.clone()); - let a = H160::from(h); - assert_eq!(address, a); - } - - #[test] - fn from_u64() { - assert_eq!(H128::from(0x1234567890abcdef), H128::from_str("00000000000000001234567890abcdef").unwrap()); - assert_eq!(H64::from(0x1234567890abcdef), H64::from_str("1234567890abcdef").unwrap()); - assert_eq!(H32::from(0x1234567890abcdef), H32::from_str("90abcdef").unwrap()); - } - - #[test] - fn from_str() { - assert_eq!(H64::from(0x1234567890abcdef), H64::from("0x1234567890abcdef")); - assert_eq!(H64::from(0x1234567890abcdef), H64::from("1234567890abcdef")); - assert_eq!(H64::from(0x234567890abcdef), H64::from("0x234567890abcdef")); - } - - #[test] - fn from_and_to_u256() { - let u: U256 = 0x123456789abcdef0u64.into(); - let h = H256::from(u); - assert_eq!(H256::from(u), H256::from("000000000000000000000000000000000000000000000000123456789abcdef0")); - let h_ref = H256::from(&u); - assert_eq!(h, h_ref); - let r_ref: U256 = From::from(&h); - assert_eq!(r_ref, u); - let r: U256 = From::from(h); - assert_eq!(r, u); - } -} diff --git a/util/bigint/src/lib.rs b/util/bigint/src/lib.rs deleted file mode 100644 index 58d416b50..000000000 --- a/util/bigint/src/lib.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015-2017 Parity Technologies -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Efficient large, fixed-size big integers and hashes. - -#![cfg_attr(asm_available, feature(asm))] - -extern crate rand; -extern crate rustc_hex; -extern crate libc; -extern crate plain_hasher; - -#[cfg(feature="heapsizeof")] -#[macro_use] -extern crate heapsize; - -pub extern crate bigint as uint; -pub mod hash; - -/// A prelude module for re-exporting all the types defined in this crate. -/// -/// ```rust -/// use ethcore_bigint::prelude::*; -/// -/// let x: U256 = U256::zero(); -/// let y = x + 1.into(); -/// ``` -pub mod prelude { - pub use ::uint::*; - pub use ::hash::*; -} diff --git a/util/bloomable/Cargo.toml b/util/bloomable/Cargo.toml index d919e2163..8b61c93c1 100644 --- a/util/bloomable/Cargo.toml +++ b/util/bloomable/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["debris "] [dependencies] -ethcore-bigint = { path = "../bigint" } +ethereum-types = "0.1" [dev-dependencies] keccak-hash = { path = "../hash" } diff --git a/util/bloomable/src/lib.rs b/util/bloomable/src/lib.rs index 29a9abde5..79d467a84 100644 --- a/util/bloomable/src/lib.rs +++ b/util/bloomable/src/lib.rs @@ -16,11 +16,11 @@ //! Bloom operations. -extern crate ethcore_bigint; +extern crate ethereum_types; use std::mem; use std::ops::DerefMut; -use ethcore_bigint::hash::{H64, H160, H256, H512, H520, H2048}; +use ethereum_types::{H64, H160, H256, H512, H520, H2048}; /// Returns log2. pub fn log2(x: usize) -> u32 { diff --git a/util/bloomable/tests/test.rs b/util/bloomable/tests/test.rs index 6e9cde484..e0be72331 100644 --- a/util/bloomable/tests/test.rs +++ b/util/bloomable/tests/test.rs @@ -1,8 +1,8 @@ extern crate keccak_hash as hash; -extern crate ethcore_bigint; +extern crate ethereum_types; extern crate bloomable; -use ethcore_bigint::hash::{H160, H256, H2048}; +use ethereum_types::{H160, H256, H2048}; use bloomable::Bloomable; use hash::keccak; diff --git a/util/dir/Cargo.toml b/util/dir/Cargo.toml index ee6dc638a..fab41c630 100644 --- a/util/dir/Cargo.toml +++ b/util/dir/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethcore-bigint = { path = "../bigint" } +ethereum-types = "0.1" journaldb = { path = "../journaldb" } app_dirs = "1.1.1" diff --git a/util/dir/src/lib.rs b/util/dir/src/lib.rs index 6e751420a..303919e42 100644 --- a/util/dir/src/lib.rs +++ b/util/dir/src/lib.rs @@ -18,13 +18,13 @@ //! Dir utilities for platform-specific operations extern crate app_dirs; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate journaldb; pub mod helpers; use std::{env, fs}; use std::path::{PathBuf, Path}; -use bigint::hash::{H64, H256}; +use ethereum_types::{H64, H256}; use journaldb::Algorithm; use helpers::{replace_home, replace_home_and_local}; use app_dirs::{AppInfo, get_app_root, AppDataType}; diff --git a/util/error/Cargo.toml b/util/error/Cargo.toml index 8f1aa9e0c..4bd28e478 100644 --- a/util/error/Cargo.toml +++ b/util/error/Cargo.toml @@ -6,6 +6,6 @@ authors = ["Parity Technologies "] [dependencies] rlp = { path = "../rlp" } kvdb = { path = "../kvdb" } -ethcore-bigint = { path = "../bigint" } +ethereum-types = "0.1" error-chain = { version = "0.11", default-features = false } rustc-hex = "1.0" diff --git a/util/error/src/lib.rs b/util/error/src/lib.rs index 0f6c9ad70..9a1ab8753 100644 --- a/util/error/src/lib.rs +++ b/util/error/src/lib.rs @@ -22,7 +22,7 @@ #[macro_use] extern crate error_chain; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate rlp; extern crate rustc_hex; extern crate kvdb; @@ -30,7 +30,7 @@ extern crate kvdb; use std::fmt; use rustc_hex::FromHexError; use rlp::DecoderError; -use bigint::hash::H256; +use ethereum_types::H256; #[derive(Debug)] /// Error in database subsystem. diff --git a/util/hash/Cargo.toml b/util/hash/Cargo.toml index e4225c85c..7e97b09f5 100644 --- a/util/hash/Cargo.toml +++ b/util/hash/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] build = "build.rs" [dependencies] -ethcore-bigint = { version = "0.2.1", path = "../bigint" } +ethereum-types = "0.1" tiny-keccak = "1.3" [build-dependencies] diff --git a/util/hash/src/lib.rs b/util/hash/src/lib.rs index 91d3b4bf9..0982c11da 100644 --- a/util/hash/src/lib.rs +++ b/util/hash/src/lib.rs @@ -14,12 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate tiny_keccak; use std::io; use tiny_keccak::Keccak; -pub use bigint::hash::H256; +pub use ethereum_types::H256; /// Get the KECCAK (i.e. Keccak) hash of the empty bytes string. pub const KECCAK_EMPTY: H256 = H256( [0xc5, 0xd2, 0x46, 0x01, 0x86, 0xf7, 0x23, 0x3c, 0x92, 0x7e, 0x7d, 0xb2, 0xdc, 0xc7, 0x03, 0xc0, 0xe5, 0x00, 0xb6, 0x53, 0xca, 0x82, 0x27, 0x3b, 0x7b, 0xfa, 0xd8, 0x04, 0x5d, 0x85, 0xa4, 0x70] ); diff --git a/util/hashdb/Cargo.toml b/util/hashdb/Cargo.toml index 0060afbaa..61b1f2ce2 100644 --- a/util/hashdb/Cargo.toml +++ b/util/hashdb/Cargo.toml @@ -7,4 +7,4 @@ license = "GPL-3.0" [dependencies] elastic-array = "0.9" -ethcore-bigint = { version = "0.2.1", path = "../bigint" } +ethereum-types = "0.1" diff --git a/util/hashdb/src/lib.rs b/util/hashdb/src/lib.rs index 9162670e3..b65f304e4 100644 --- a/util/hashdb/src/lib.rs +++ b/util/hashdb/src/lib.rs @@ -16,11 +16,11 @@ //! Database of byte-slices keyed to their Keccak hash. extern crate elastic_array; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; -use bigint::hash::*; use std::collections::HashMap; use elastic_array::ElasticArray128; +use ethereum_types::H256; /// `HashDB` value type. pub type DBValue = ElasticArray128; diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index 3d92d9ed6..4d08bce7f 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -6,14 +6,15 @@ description = "A `HashDB` which can manage a short-term journal potentially cont license = "GPL3" [dependencies] -ethcore-bigint = { path = "../bigint", features = ["heapsizeof"] } ethcore-bytes = { path = "../bytes" } +ethereum-types = "0.1" hashdb = { path = "../hashdb" } heapsize = "0.4" kvdb = { path = "../kvdb" } log = "0.3" memorydb = { path = "../memorydb" } parking_lot = "0.4" +plain_hasher = { path = "../plain_hasher" } rlp = { path = "../rlp" } util-error = { path = "../error" } diff --git a/util/journaldb/src/archivedb.rs b/util/journaldb/src/archivedb.rs index bd5745900..e365e3c87 100644 --- a/util/journaldb/src/archivedb.rs +++ b/util/journaldb/src/archivedb.rs @@ -25,7 +25,7 @@ use super::memorydb::*; use super::{DB_PREFIX_LEN, LATEST_ERA_KEY}; use traits::JournalDB; use kvdb::{KeyValueDB, DBTransaction}; -use bigint::hash::H256; +use ethereum_types::H256; use error::{BaseDataError, UtilError}; use bytes::Bytes; diff --git a/util/journaldb/src/earlymergedb.rs b/util/journaldb/src/earlymergedb.rs index e9a1b80f9..5625741c5 100644 --- a/util/journaldb/src/earlymergedb.rs +++ b/util/journaldb/src/earlymergedb.rs @@ -28,7 +28,7 @@ use memorydb::*; use super::{DB_PREFIX_LEN, LATEST_ERA_KEY}; use super::traits::JournalDB; use kvdb::{KeyValueDB, DBTransaction}; -use bigint::hash::H256; +use ethereum_types::H256; use error::{BaseDataError, UtilError}; use bytes::Bytes; diff --git a/util/journaldb/src/lib.rs b/util/journaldb/src/lib.rs index 1e805abe6..949c0609f 100644 --- a/util/journaldb/src/lib.rs +++ b/util/journaldb/src/lib.rs @@ -20,12 +20,13 @@ extern crate heapsize; #[macro_use] extern crate log; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate ethcore_bytes as bytes; extern crate hashdb; extern crate kvdb; extern crate memorydb; extern crate parking_lot; +extern crate plain_hasher; extern crate rlp; extern crate util_error as error; diff --git a/util/journaldb/src/overlaydb.rs b/util/journaldb/src/overlaydb.rs index 220076eaa..0739bea48 100644 --- a/util/journaldb/src/overlaydb.rs +++ b/util/journaldb/src/overlaydb.rs @@ -20,7 +20,7 @@ use std::sync::Arc; use std::collections::HashMap; use std::collections::hash_map::Entry; use error::{Result, BaseDataError}; -use bigint::hash::*; +use ethereum_types::H256; use rlp::*; use hashdb::*; use memorydb::*; diff --git a/util/journaldb/src/overlayrecentdb.rs b/util/journaldb/src/overlayrecentdb.rs index 97fec7604..bb6663991 100644 --- a/util/journaldb/src/overlayrecentdb.rs +++ b/util/journaldb/src/overlayrecentdb.rs @@ -27,7 +27,8 @@ use memorydb::*; use super::{DB_PREFIX_LEN, LATEST_ERA_KEY}; use kvdb::{KeyValueDB, DBTransaction}; use super::JournalDB; -use bigint::hash::{H256, H256FastMap}; +use ethereum_types::H256; +use plain_hasher::H256FastMap; use error::{BaseDataError, UtilError}; use bytes::Bytes; diff --git a/util/journaldb/src/refcounteddb.rs b/util/journaldb/src/refcounteddb.rs index e1d15383e..4772c29b3 100644 --- a/util/journaldb/src/refcounteddb.rs +++ b/util/journaldb/src/refcounteddb.rs @@ -26,7 +26,7 @@ use memorydb::MemoryDB; use super::{DB_PREFIX_LEN, LATEST_ERA_KEY}; use super::traits::JournalDB; use kvdb::{KeyValueDB, DBTransaction}; -use bigint::hash::H256; +use ethereum_types::H256; use error::UtilError; use bytes::Bytes; diff --git a/util/journaldb/src/traits.rs b/util/journaldb/src/traits.rs index a7667124b..aaf5b2797 100644 --- a/util/journaldb/src/traits.rs +++ b/util/journaldb/src/traits.rs @@ -19,7 +19,7 @@ use std::sync::Arc; use hashdb::*; use kvdb::{self, DBTransaction}; -use bigint::hash::H256; +use ethereum_types::H256; use error::UtilError; use bytes::Bytes; diff --git a/util/kvdb-rocksdb/Cargo.toml b/util/kvdb-rocksdb/Cargo.toml index 1e81d1dfb..d948e3b48 100644 --- a/util/kvdb-rocksdb/Cargo.toml +++ b/util/kvdb-rocksdb/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] elastic-array = "0.9" -ethcore-bigint = { path = "../bigint" } +ethereum-types = "0.1" kvdb = { path = "../kvdb" } log = "0.3" num_cpus = "1.0" diff --git a/util/kvdb-rocksdb/src/lib.rs b/util/kvdb-rocksdb/src/lib.rs index 3f5fdd1e2..df605855c 100644 --- a/util/kvdb-rocksdb/src/lib.rs +++ b/util/kvdb-rocksdb/src/lib.rs @@ -24,7 +24,7 @@ extern crate parking_lot; extern crate regex; extern crate rocksdb; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate kvdb; extern crate rlp; @@ -699,7 +699,7 @@ mod tests { use std::str::FromStr; use self::tempdir::TempDir; - use bigint::hash::H256; + use ethereum_types::H256; use super::*; fn test_db(config: &DatabaseConfig) { diff --git a/util/memorydb/Cargo.toml b/util/memorydb/Cargo.toml index 4ea50a736..9d1785e96 100644 --- a/util/memorydb/Cargo.toml +++ b/util/memorydb/Cargo.toml @@ -9,7 +9,8 @@ license = "GPL-3.0" bigint = "4.0" elastic-array = "0.9" heapsize = "0.4" -ethcore-bigint = { version = "0.2", path = "../bigint", features = ["heapsizeof"] } +ethereum-types = { version = "0.1", features = ["heapsizeof"] } keccak-hash = { version = "0.1.0", path = "../hash" } hashdb = { version = "0.1.1", path = "../hashdb" } +plain_hasher = { path = "../plain_hasher" } rlp = { version = "0.2.1", path = "../rlp" } diff --git a/util/memorydb/src/lib.rs b/util/memorydb/src/lib.rs index d8e342d98..12eb62e05 100644 --- a/util/memorydb/src/lib.rs +++ b/util/memorydb/src/lib.rs @@ -16,20 +16,22 @@ //! Reference-counted memory-based `HashDB` implementation. extern crate heapsize; -extern crate ethcore_bigint as bigint; -extern crate rlp; -extern crate keccak_hash as keccak; +extern crate ethereum_types; extern crate hashdb; +extern crate keccak_hash as keccak; +extern crate plain_hasher; +extern crate rlp; +extern crate elastic_array; use std::mem; use std::collections::HashMap; use std::collections::hash_map::Entry; use heapsize::HeapSizeOf; -use bigint::hash::{H256FastMap, H256}; -use rlp::NULL_RLP; +use ethereum_types::H256; +use hashdb::{HashDB, DBValue}; use keccak::{KECCAK_NULL_RLP, keccak}; -use hashdb::*; - +use plain_hasher::H256FastMap; +use rlp::NULL_RLP; /// Reference-counted memory-based `HashDB` implementation. /// /// Use `new()` to create a new database. Insert items with `insert()`, remove items diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index 006bbc5ac..81c754ebb 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -21,8 +21,8 @@ parking_lot = "0.4" ansi_term = "0.9" rustc-hex = "1.0" ethcore-io = { path = "../io" } -ethcore-bigint = { path = "../bigint" } ethcore-bytes = { path = "../bytes" } +ethereum-types = "0.1" ethkey = { path = "../../ethkey" } ethcrypto = { path = "../../ethcrypto" } rlp = { path = "../rlp" } diff --git a/util/network/src/connection.rs b/util/network/src/connection.rs index 9bbe1186a..e874db280 100644 --- a/util/network/src/connection.rs +++ b/util/network/src/connection.rs @@ -22,7 +22,7 @@ use hash::{keccak, write_keccak}; use mio::{Token, Ready, PollOpt}; use mio::deprecated::{Handler, EventLoop, TryRead, TryWrite}; use mio::tcp::*; -use bigint::hash::*; +use ethereum_types::{H128, H256, H512}; use ethcore_bytes::*; use rlp::*; use std::io::{self, Cursor, Read, Write}; @@ -482,7 +482,7 @@ impl EncryptedConnection { #[test] pub fn test_encryption() { - use bigint::hash::*; + use ethereum_types::{H256, H128}; use std::str::FromStr; let key = H256::from_str("2212767d793a7a3d66f869ae324dd11bd17044b82c9f463b8a541a4d089efec5").unwrap(); let before = H128::from_str("12532abaec065082a3cf1da7d0136f15").unwrap(); diff --git a/util/network/src/discovery.rs b/util/network/src/discovery.rs index f75672bf5..88468a375 100644 --- a/util/network/src/discovery.rs +++ b/util/network/src/discovery.rs @@ -24,7 +24,7 @@ use mio::deprecated::{Handler, EventLoop}; use mio::udp::*; use hash::keccak; use time; -use bigint::hash::*; +use ethereum_types::{H256, H520}; use rlp::*; use node_table::*; use error::{Error, ErrorKind}; diff --git a/util/network/src/handshake.rs b/util/network/src/handshake.rs index 09671205f..64622f274 100644 --- a/util/network/src/handshake.rs +++ b/util/network/src/handshake.rs @@ -18,7 +18,7 @@ use std::sync::Arc; use rand::random; use hash::write_keccak; use mio::tcp::*; -use bigint::hash::*; +use ethereum_types::{H256, H520}; use ethcore_bytes::Bytes; use rlp::*; use connection::{Connection}; @@ -333,7 +333,7 @@ mod test { use std::sync::Arc; use rustc_hex::FromHex; use super::*; - use bigint::hash::H256; + use ethereum_types::H256; use io::*; use mio::tcp::TcpStream; use stats::NetworkStats; diff --git a/util/network/src/host.rs b/util/network/src/host.rs index 5c770094d..30cd09b50 100644 --- a/util/network/src/host.rs +++ b/util/network/src/host.rs @@ -29,7 +29,7 @@ use hash::keccak; use mio::*; use mio::deprecated::{EventLoop}; use mio::tcp::*; -use bigint::hash::*; +use ethereum_types::H256; use rlp::*; use session::{Session, SessionInfo, SessionData}; use io::*; diff --git a/util/network/src/lib.rs b/util/network/src/lib.rs index 9d2050cf0..f31da60d9 100644 --- a/util/network/src/lib.rs +++ b/util/network/src/lib.rs @@ -59,8 +59,8 @@ #![recursion_limit="128"] extern crate ethcore_io as io; -extern crate ethcore_bigint as bigint; extern crate ethcore_bytes; +extern crate ethereum_types; extern crate parking_lot; extern crate mio; extern crate tiny_keccak; diff --git a/util/network/src/node_table.rs b/util/network/src/node_table.rs index e19da8280..a673f1b34 100644 --- a/util/network/src/node_table.rs +++ b/util/network/src/node_table.rs @@ -25,7 +25,7 @@ use std::path::{PathBuf}; use std::fmt; use std::fs; use std::io::{Read, Write}; -use bigint::hash::*; +use ethereum_types::H512; use rlp::*; use time::Tm; use error::{Error, ErrorKind}; @@ -375,7 +375,7 @@ pub fn validate_node_url(url: &str) -> Option { mod tests { use super::*; use std::net::{SocketAddr, SocketAddrV4, Ipv4Addr}; - use bigint::hash::H512; + use ethereum_types::H512; use std::str::FromStr; use tempdir::TempDir; use ipnetwork::IpNetwork; diff --git a/util/network/src/session.rs b/util/network/src/session.rs index 1e5e0f3b2..e5ffc68c6 100644 --- a/util/network/src/session.rs +++ b/util/network/src/session.rs @@ -23,7 +23,7 @@ use std::collections::HashMap; use mio::*; use mio::deprecated::{Handler, EventLoop}; use mio::tcp::*; -use bigint::hash::*; +use ethereum_types::H256; use rlp::*; use connection::{EncryptedConnection, Packet, Connection, MAX_PAYLOAD_SIZE}; use handshake::Handshake; diff --git a/util/patricia_trie/Cargo.toml b/util/patricia_trie/Cargo.toml index ae0027cf4..cf8d7899e 100644 --- a/util/patricia_trie/Cargo.toml +++ b/util/patricia_trie/Cargo.toml @@ -10,7 +10,7 @@ elastic-array = "0.9" log = "0.3" rand = "0.3" ethcore-bytes = { version = "0.1.0", path = "../bytes" } -ethcore-bigint = { version = "0.2.1", path = "../bigint" } +ethereum-types = "0.1" keccak-hash = { version = "0.1.0", path = "../hash" } hashdb = { version = "0.1.1", path = "../hashdb" } rlp = { version = "0.2.1", path = "../rlp" } diff --git a/util/patricia_trie/src/fatdb.rs b/util/patricia_trie/src/fatdb.rs index 4602482b1..d428ff811 100644 --- a/util/patricia_trie/src/fatdb.rs +++ b/util/patricia_trie/src/fatdb.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H256; +use ethereum_types::H256; use keccak::keccak; use hashdb::HashDB; use super::{TrieDB, Trie, TrieDBIterator, TrieItem, TrieIterator, Query}; diff --git a/util/patricia_trie/src/fatdbmut.rs b/util/patricia_trie/src/fatdbmut.rs index 8267585f9..4b7f2de06 100644 --- a/util/patricia_trie/src/fatdbmut.rs +++ b/util/patricia_trie/src/fatdbmut.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H256; +use ethereum_types::H256; use keccak::keccak; use hashdb::{HashDB, DBValue}; use super::{TrieDBMut, TrieMut}; diff --git a/util/patricia_trie/src/lib.rs b/util/patricia_trie/src/lib.rs index 83ab09073..aefa1d536 100644 --- a/util/patricia_trie/src/lib.rs +++ b/util/patricia_trie/src/lib.rs @@ -16,7 +16,7 @@ //! Trie interface and implementation. extern crate rand; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types; extern crate keccak_hash as keccak; extern crate rlp; extern crate hashdb; @@ -29,7 +29,7 @@ extern crate ethcore_logger; extern crate log; use std::{fmt, error}; -use bigint::hash::H256; +use ethereum_types::H256; use keccak::KECCAK_NULL_RLP; use hashdb::{HashDB, DBValue}; diff --git a/util/patricia_trie/src/lookup.rs b/util/patricia_trie/src/lookup.rs index 168cd00a3..75a5b28a9 100644 --- a/util/patricia_trie/src/lookup.rs +++ b/util/patricia_trie/src/lookup.rs @@ -19,7 +19,7 @@ use hashdb::HashDB; use nibbleslice::NibbleSlice; use rlp::Rlp; -use bigint::hash::H256; +use ethereum_types::H256; use super::{TrieError, Query}; use super::node::Node; diff --git a/util/patricia_trie/src/recorder.rs b/util/patricia_trie/src/recorder.rs index ce52ff780..35a515b70 100644 --- a/util/patricia_trie/src/recorder.rs +++ b/util/patricia_trie/src/recorder.rs @@ -17,7 +17,7 @@ //! Trie query recorder. use keccak::keccak; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::Bytes; /// A record of a visited node. @@ -83,7 +83,7 @@ impl Recorder { #[cfg(test)] mod tests { use super::*; - use bigint::hash::H256; + use ethereum_types::H256; #[test] fn basic_recorder() { diff --git a/util/patricia_trie/src/sectriedb.rs b/util/patricia_trie/src/sectriedb.rs index 2bf55dd92..a9176d022 100644 --- a/util/patricia_trie/src/sectriedb.rs +++ b/util/patricia_trie/src/sectriedb.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H256; +use ethereum_types::H256; use keccak::keccak; use hashdb::HashDB; use super::triedb::TrieDB; diff --git a/util/patricia_trie/src/sectriedbmut.rs b/util/patricia_trie/src/sectriedbmut.rs index b3790f27d..b0436b271 100644 --- a/util/patricia_trie/src/sectriedbmut.rs +++ b/util/patricia_trie/src/sectriedbmut.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use bigint::hash::H256; +use ethereum_types::H256; use keccak::keccak; use hashdb::{HashDB, DBValue}; use super::triedbmut::TrieDBMut; diff --git a/util/patricia_trie/src/standardmap.rs b/util/patricia_trie/src/standardmap.rs index 866dc6e0e..d71f1ee37 100644 --- a/util/patricia_trie/src/standardmap.rs +++ b/util/patricia_trie/src/standardmap.rs @@ -17,7 +17,7 @@ //! Key-value datastore with a modified Merkle tree. use keccak::keccak; use bytes::*; -use bigint::hash::*; +use ethereum_types::H256; use rlp::encode; /// Alphabet to use when creating words for insertion into tries. diff --git a/util/patricia_trie/src/triedb.rs b/util/patricia_trie/src/triedb.rs index 39776d106..38f7e2adf 100644 --- a/util/patricia_trie/src/triedb.rs +++ b/util/patricia_trie/src/triedb.rs @@ -21,7 +21,7 @@ use rlp::*; use super::node::{Node, OwnedNode}; use super::lookup::Lookup; use super::{Trie, TrieItem, TrieError, TrieIterator, Query}; -use bigint::hash::H256; +use ethereum_types::H256; use bytes::{ToPretty, Bytes}; /// A `Trie` implementation using a generic `HashDB` backing database. @@ -34,12 +34,12 @@ use bytes::{ToPretty, Bytes}; /// extern crate patricia_trie as trie; /// extern crate hashdb; /// extern crate memorydb; -/// extern crate ethcore_bigint as bigint; +/// extern crate ethereum_types; /// /// use trie::*; /// use hashdb::*; /// use memorydb::*; -/// use bigint::hash::*; +/// use ethereum_types::H256; /// /// fn main() { /// let mut memdb = MemoryDB::new(); diff --git a/util/patricia_trie/src/triedbmut.rs b/util/patricia_trie/src/triedbmut.rs index 497fe7284..98d6c8333 100644 --- a/util/patricia_trie/src/triedbmut.rs +++ b/util/patricia_trie/src/triedbmut.rs @@ -30,7 +30,7 @@ use hashdb::DBValue; use std::collections::{HashSet, VecDeque}; use std::mem; use std::ops::Index; -use bigint::hash::H256; +use ethereum_types::H256; use elastic_array::ElasticArray1024; use keccak::{KECCAK_NULL_RLP}; @@ -265,13 +265,13 @@ impl<'a> Index<&'a StorageHandle> for NodeStorage { /// extern crate keccak_hash; /// extern crate hashdb; /// extern crate memorydb; -/// extern crate ethcore_bigint as bigint; +/// extern crate ethereum_types; /// /// use keccak_hash::KECCAK_NULL_RLP; /// use trie::*; /// use hashdb::*; /// use memorydb::*; -/// use bigint::hash::*; +/// use ethereum_types::H256; /// /// fn main() { /// let mut memdb = MemoryDB::new(); diff --git a/util/plain_hasher/Cargo.toml b/util/plain_hasher/Cargo.toml index 0ed45ba36..f14f2f48f 100644 --- a/util/plain_hasher/Cargo.toml +++ b/util/plain_hasher/Cargo.toml @@ -5,8 +5,8 @@ version = "0.1.0" authors = ["Parity Technologies "] license = "MIT" keywords = ["hash", "hasher"] -categories = ["no-std"] homepage = "https://github.com/paritytech/plain_hasher" [dependencies] crunchy = "0.1.6" +ethereum-types = "0.1" diff --git a/util/plain_hasher/src/lib.rs b/util/plain_hasher/src/lib.rs index b16596363..54bad92f4 100644 --- a/util/plain_hasher/src/lib.rs +++ b/util/plain_hasher/src/lib.rs @@ -1,8 +1,15 @@ -#![no_std] #[macro_use] extern crate crunchy; +extern crate ethereum_types; -use core::{hash, mem}; +use std::{hash, mem}; +use std::collections::{HashMap, HashSet}; +use ethereum_types::H256; + +/// Specialized version of `HashMap` with H256 keys and fast hashing function. +pub type H256FastMap = HashMap>; +/// Specialized version of `HashSet` with H256 keys and fast hashing function. +pub type H256FastSet = HashSet>; /// Hasher that just takes 8 bytes of the provided value. /// May only be used for keys which are 32 bytes. @@ -41,7 +48,7 @@ impl hash::Hasher for PlainHasher { #[cfg(test)] mod tests { - use core::hash::Hasher; + use std::hash::Hasher; use super::PlainHasher; #[test] diff --git a/util/rlp/Cargo.toml b/util/rlp/Cargo.toml index 83ac3a9d6..962bb9f5b 100644 --- a/util/rlp/Cargo.toml +++ b/util/rlp/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] [dependencies] elastic-array = "0.9" -ethcore-bigint = { version = "0.2.1", path = "../bigint" } +ethereum-types = "0.1" lazy_static = "0.2" rustc-hex = "1.0" byteorder = "1.0" diff --git a/util/rlp/src/impls.rs b/util/rlp/src/impls.rs index bc3caa495..7de1f7aa8 100644 --- a/util/rlp/src/impls.rs +++ b/util/rlp/src/impls.rs @@ -8,7 +8,7 @@ use std::{cmp, mem, str}; use byteorder::{ByteOrder, BigEndian}; -use bigint::prelude::{U128, U256, H64, H128, H160, H256, H512, H520, H2048}; +use bigint::{U128, U256, H64, H128, H160, H256, H512, H520, H2048}; use traits::{Encodable, Decodable}; use stream::RlpStream; use {UntrustedRlp, DecoderError}; diff --git a/util/rlp/src/lib.rs b/util/rlp/src/lib.rs index f7596b2bc..677c4221f 100644 --- a/util/rlp/src/lib.rs +++ b/util/rlp/src/lib.rs @@ -39,7 +39,7 @@ //! * You don't want to decode whole rlp at once. extern crate byteorder; -extern crate ethcore_bigint as bigint; +extern crate ethereum_types as bigint; extern crate elastic_array; extern crate rustc_hex; diff --git a/util/rlp/src/rlpin.rs b/util/rlp/src/rlpin.rs index f4f3d3d58..c96795913 100644 --- a/util/rlp/src/rlpin.rs +++ b/util/rlp/src/rlpin.rs @@ -274,7 +274,7 @@ impl<'a, 'view> Iterator for RlpIterator<'a, 'view> { #[test] fn break_it() { use rustc_hex::FromHex; - use bigint::prelude::U256; + use bigint::U256; let h: Vec = FromHex::from_hex("f84d0589010efbef67941f79b2a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470").unwrap(); let r: Rlp = Rlp::new(&h); diff --git a/util/rlp/tests/tests.rs b/util/rlp/tests/tests.rs index 81035d570..03151c5bf 100644 --- a/util/rlp/tests/tests.rs +++ b/util/rlp/tests/tests.rs @@ -6,11 +6,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate ethcore_bigint as bigint; +extern crate ethereum_types as bigint; extern crate rlp; use std::{fmt, cmp}; -use bigint::prelude::U256; +use bigint::{U256, H160}; use rlp::{Encodable, Decodable, UntrustedRlp, RlpStream, DecoderError}; #[test] @@ -164,8 +164,6 @@ fn encode_str() { #[test] fn encode_address() { - use bigint::hash::H160; - let tests = vec![ ETestPair(H160::from("ef2d6d194084c2de36e0dabfce45d046b37d1106"), vec![0x94, 0xef, 0x2d, 0x6d, 0x19, 0x40, 0x84, 0xc2, 0xde, @@ -308,8 +306,6 @@ fn decode_untrusted_str() { #[test] fn decode_untrusted_address() { - use bigint::hash::H160; - let tests = vec![ DTestPair(H160::from("ef2d6d194084c2de36e0dabfce45d046b37d1106"), vec![0x94, 0xef, 0x2d, 0x6d, 0x19, 0x40, 0x84, 0xc2, 0xde, diff --git a/util/src/lib.rs b/util/src/lib.rs deleted file mode 100644 index 4094ed967..000000000 --- a/util/src/lib.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity 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 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. If not, see . - -#![warn(missing_docs)] - -//! Ethcore-util library -//! -//! ### Rust version: -//! - nightly -//! -//! ### Supported platforms: -//! - OSX -//! - Linux -//! -//! ### Building: -//! -//! - Ubuntu 14.04 and later: -//! -//! ```bash -//! # install rocksdb -//! add-apt-repository "deb http://ppa.launchpad.net/giskou/librocksdb/ubuntu trusty main" -//! apt-get update -//! apt-get install -y --force-yes librocksdb -//! -//! # install multirust -//! curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh -s -- --yes -//! -//! # install nightly and make it default -//! multirust update nightly && multirust default nightly -//! -//! # export rust LIBRARY_PATH -//! export LIBRARY_PATH=/usr/local/lib -//! -//! # download and build parity -//! git clone https://github.com/paritytech/parity -//! cd parity -//! cargo build --release -//! ``` -//! -//! - OSX: -//! -//! ```bash -//! # install rocksdb && multirust -//! brew update -//! brew install rocksdb -//! brew install multirust -//! -//! # install nightly and make it default -//! multirust update nightly && multirust default nightly -//! -//! # export rust LIBRARY_PATH -//! export LIBRARY_PATH=/usr/local/lib -//! -//! # download and build parity -//! git clone https://github.com/paritytech/parity -//! cd parity -//! cargo build --release -//! ``` - -extern crate ethcore_bigint as bigint; -extern crate hashdb; -extern crate memorydb; - -pub use hashdb::*; -pub use memorydb::MemoryDB; - -/// 160-bit integer representing account address -pub type Address = bigint::hash::H160; diff --git a/util/triehash/Cargo.toml b/util/triehash/Cargo.toml index 53d6b56d8..a19a4da0d 100644 --- a/util/triehash/Cargo.toml +++ b/util/triehash/Cargo.toml @@ -7,5 +7,5 @@ license = "GPL-3.0" [dependencies] rlp = { version = "0.2.1", path = "../rlp" } -ethcore-bigint = { version = "0.2.1", path = "../bigint" } +ethereum-types = "0.1" keccak-hash = { version = "0.1", path = "../hash" } diff --git a/util/triehash/src/lib.rs b/util/triehash/src/lib.rs index 78c22fb87..13ed4919c 100644 --- a/util/triehash/src/lib.rs +++ b/util/triehash/src/lib.rs @@ -18,13 +18,13 @@ //! //! This module should be used to generate trie root hash. -extern crate ethcore_bigint; +extern crate ethereum_types; extern crate keccak_hash as hash; extern crate rlp; use std::collections::BTreeMap; use std::cmp; -use ethcore_bigint::hash::H256; +use ethereum_types::H256; use hash::keccak; use rlp::RlpStream; diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index 20d52666b..8b2be6dbc 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" -ethcore-bigint = { path = "../util/bigint" } +ethereum-types = "0.1" ethcore-network = { path = "../util/network" } ethcrypto = { path = "../ethcrypto" } ethkey = { path = "../ethkey" } diff --git a/whisper/src/lib.rs b/whisper/src/lib.rs index 7e13a2c24..441235f1f 100644 --- a/whisper/src/lib.rs +++ b/whisper/src/lib.rs @@ -18,9 +18,9 @@ //! interface. extern crate byteorder; -extern crate ethcore_bigint as bigint; extern crate ethcore_network as network; extern crate ethcrypto; +extern crate ethereum_types; extern crate ethkey; extern crate hex; extern crate ordered_float; diff --git a/whisper/src/message.rs b/whisper/src/message.rs index fe6997c01..4970483bc 100644 --- a/whisper/src/message.rs +++ b/whisper/src/message.rs @@ -19,7 +19,7 @@ use std::fmt; use std::time::{self, SystemTime, Duration}; -use bigint::hash::{H256, H512}; +use ethereum_types::{H256, H512}; use rlp::{self, DecoderError, RlpStream, UntrustedRlp}; use smallvec::SmallVec; use tiny_keccak::{keccak256, Keccak}; diff --git a/whisper/src/net/mod.rs b/whisper/src/net/mod.rs index 1fc5f30b4..c4774b788 100644 --- a/whisper/src/net/mod.rs +++ b/whisper/src/net/mod.rs @@ -22,7 +22,7 @@ use std::fmt; use std::time::{Duration, SystemTime}; use std::sync::Arc; -use bigint::hash::{H256, H512}; +use ethereum_types::{H256, H512}; use network::{self, HostInfo, NetworkContext, NodeId, PeerId, ProtocolId, TimerToken}; use ordered_float::OrderedFloat; use parking_lot::{Mutex, RwLock}; diff --git a/whisper/src/rpc/crypto.rs b/whisper/src/rpc/crypto.rs index 19c26fda8..8dcfed88a 100644 --- a/whisper/src/rpc/crypto.rs +++ b/whisper/src/rpc/crypto.rs @@ -16,7 +16,7 @@ //! Encryption schemes supported by RPC layer. -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{self, Public, Secret}; use ring::aead::{self, AES_256_GCM, SealingKey, OpeningKey}; diff --git a/whisper/src/rpc/filter.rs b/whisper/src/rpc/filter.rs index f4dd7bb9a..435fb950b 100644 --- a/whisper/src/rpc/filter.rs +++ b/whisper/src/rpc/filter.rs @@ -20,7 +20,7 @@ use std::collections::HashMap; use std::sync::{mpsc, Arc}; use std::thread; -use bigint::hash::{H256, H512}; +use ethereum_types::{H256, H512}; use ethkey::Public; use jsonrpc_macros::pubsub::{Subscriber, Sink}; use parking_lot::{Mutex, RwLock}; diff --git a/whisper/src/rpc/key_store.rs b/whisper/src/rpc/key_store.rs index ac9e758d6..f71ec5bf3 100644 --- a/whisper/src/rpc/key_store.rs +++ b/whisper/src/rpc/key_store.rs @@ -21,7 +21,7 @@ use std::collections::HashMap; -use bigint::hash::H256; +use ethereum_types::H256; use ethkey::{KeyPair, Public, Secret}; use rand::{Rng, OsRng}; use ring::error::Unspecified; diff --git a/whisper/src/rpc/mod.rs b/whisper/src/rpc/mod.rs index 30fd04db9..039df08a8 100644 --- a/whisper/src/rpc/mod.rs +++ b/whisper/src/rpc/mod.rs @@ -27,7 +27,7 @@ use jsonrpc_core::{Error, ErrorCode, Metadata}; use jsonrpc_pubsub::{Session, PubSubMetadata, SubscriptionId}; use jsonrpc_macros::pubsub; -use bigint::hash::H256; +use ethereum_types::H256; use parking_lot::RwLock; use self::filter::Filter; diff --git a/whisper/src/rpc/payload.rs b/whisper/src/rpc/payload.rs index b68f55a29..75d24bd7c 100644 --- a/whisper/src/rpc/payload.rs +++ b/whisper/src/rpc/payload.rs @@ -33,7 +33,7 @@ //! //! AES-256-GCM will append 12 bytes of metadata to the front of the message. -use bigint::hash::H256; +use ethereum_types::H256; use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; use ethkey::{Public, Secret}; use tiny_keccak::keccak256; diff --git a/whisper/src/rpc/types.rs b/whisper/src/rpc/types.rs index 9b2d53218..9598f48bf 100644 --- a/whisper/src/rpc/types.rs +++ b/whisper/src/rpc/types.rs @@ -19,7 +19,7 @@ use std::fmt; use std::ops::Deref; -use bigint::hash::*; +use ethereum_types::{H32, H64, H128, H256, H264, H512, H1024}; use hex::{ToHex, FromHex}; use serde::{Serialize, Serializer, Deserialize, Deserializer};