diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 00000000..75a9c12d --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,7 @@ +Zebra is developed and maintained by the Zcash Foundation. + +The codebase began as `parity-zcash`, authored by: + +- Svyatoslav Nikolsky +- Marek Kotewicz +- Nikolay Volf diff --git a/Cargo.lock b/Cargo.lock index 8331ada4..a5a26495 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,17 +5,17 @@ name = "abstract-ns" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "aho-corasick" -version = "0.6.10" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -23,7 +23,7 @@ name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -62,12 +62,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "autocfg" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -81,28 +81,13 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "pairing 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bencher" -version = "0.1.0" -dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chain 0.1.0", - "db 0.1.0", - "network 0.1.0", - "primitives 0.1.0", - "storage 0.1.0", - "test-data 0.1.0", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "verification 0.1.0", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -110,7 +95,7 @@ name = "bigint" version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -120,35 +105,14 @@ name = "bit-vec" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bitcrypto" -version = "0.1.0" -dependencies = [ - "bellman 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc.git?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", - "blake2b_simd 0.4.1 (git+https://github.com/oconnor663/blake2b_simd.git)", - "bn 0.4.4 (git+https://github.com/paritytech/bn)", - "ed25519-dalek 1.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pairing 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rust-crypto 0.2.36 (git+https://github.com/nikvolf/rust-crypto?branch=no-pad)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sapling-crypto 0.0.1 (git+https://github.com/zcash-hackworks/sapling-crypto.git?rev=21084bde2019c04bd34208e63c3560fe2c02fb0e)", - "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", - "siphasher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bitflags" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bitvec" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -157,18 +121,17 @@ version = "0.2.18" source = "git+https://github.com/gtank/blake2-rfc.git?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9#7a5b5fc99ae483a0043db7547fb79a6fa44b88a9" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "blake2b_simd" -version = "0.4.1" -source = "git+https://github.com/oconnor663/blake2b_simd.git#b75a0d10e39000fcae18a1f54fab89e2a9a0a1f6" +version = "0.5.3" +source = "git+https://github.com/oconnor663/blake2b_simd.git#011e695fb3061056f97cd3244ace9b301fad0825" dependencies = [ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -179,8 +142,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -196,14 +159,25 @@ name = "bn" version = "0.4.4" source = "git+https://github.com/paritytech/bn#6079255e65793038b9a6e5292203eab482737cc2" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bstr" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-automata 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "byte-tools" version = "0.3.1" @@ -211,7 +185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "1.2.7" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -219,42 +193,31 @@ name = "bytes" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cc" -version = "1.0.28" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "chain" -version = "0.1.0" -dependencies = [ - "bitcrypto 0.1.0", - "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "primitives 0.1.0", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serialization 0.1.0", - "serialization_derive 0.1.0", -] - [[package]] name = "clap" -version = "2.32.0" +version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -265,7 +228,7 @@ name = "clear_on_drop" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -273,15 +236,15 @@ name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cmake" -version = "0.1.35" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -294,91 +257,52 @@ name = "crossbeam" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "crossbeam" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-epoch 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-channel" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-deque" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam-deque" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-epoch 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-epoch" -version = "0.3.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "crossbeam-utils" -version = "0.2.2" +name = "crossbeam-queue" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-utils" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -388,26 +312,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "crunchy" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "csv" -version = "1.0.7" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bstr 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "csv-core" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -415,31 +340,13 @@ name = "curve25519-dalek" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "subtle 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "db" -version = "0.1.0" -dependencies = [ - "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "chain 0.1.0", - "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-rocksdb 0.5.1 (git+https://github.com/paritytech/rust-rocksdb)", - "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "serialization 0.1.0", - "storage 0.1.0", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "test-data 0.1.0", -] - [[package]] name = "digest" version = "0.7.6" @@ -450,10 +357,10 @@ dependencies = [ [[package]] name = "digest" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -471,9 +378,9 @@ name = "domain" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -485,7 +392,7 @@ dependencies = [ "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "curve25519-dalek 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -510,19 +417,19 @@ dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "eth-secp256k1" version = "0.5.7" -source = "git+https://github.com/ethcore/rust-secp256k1#ccc06e7480148b723eb44ac56cf4d20eec380b6f" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -545,12 +452,17 @@ name = "fs_extra" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -561,7 +473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -569,8 +481,8 @@ name = "futures-cpupool" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -588,7 +500,7 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.12.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -604,14 +516,14 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bstr 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -619,10 +531,10 @@ name = "h2" version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -637,7 +549,7 @@ version = "0.4.2" source = "git+https://github.com/cheme/heapsize.git?branch=ec-macfix#c07ffe843acb9da570682e290a48540741afdce1" dependencies = [ "jemallocator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -647,7 +559,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -665,38 +588,31 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.20" +version = "0.12.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "h2 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "import" -version = "0.1.0" -dependencies = [ - "chain 0.1.0", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "serialization 0.1.0", + "tokio-threadpool 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -715,7 +631,7 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -723,7 +639,7 @@ name = "jemalloc-sys" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -739,34 +655,34 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "10.0.1" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-derive" -version = "10.0.1" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-http-server" -version = "10.0.1" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hyper 0.12.20 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-server-utils 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.31 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-server-utils 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -774,10 +690,10 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "10.0.1" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", @@ -785,16 +701,16 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "10.0.1" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -808,19 +724,6 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "keys" -version = "0.1.0" -dependencies = [ - "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitcrypto 0.1.0", - "eth-secp256k1 0.5.7 (git+https://github.com/ethcore/rust-secp256k1)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "lazy_static" version = "1.3.0" @@ -831,11 +734,6 @@ name = "libc" version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "linked-hash-map" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "linked-hash-map" version = "0.5.2" @@ -873,35 +771,23 @@ name = "log" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "logs" -version = "0.1.0" -dependencies = [ - "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lru-cache" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "memchr" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -909,38 +795,6 @@ name = "memoffset" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "message" -version = "0.1.0" -dependencies = [ - "bitcrypto 0.1.0", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chain 0.1.0", - "network 0.1.0", - "primitives 0.1.0", - "serialization 0.1.0", - "serialization_derive 0.1.0", -] - -[[package]] -name = "miner" -version = "0.1.0" -dependencies = [ - "bitcrypto 0.1.0", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chain 0.1.0", - "db 0.1.0", - "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "keys 0.1.0", - "network 0.1.0", - "primitives 0.1.0", - "script 0.1.0", - "serialization 0.1.0", - "storage 0.1.0", - "test-data 0.1.0", - "verification 0.1.0", -] - [[package]] name = "mio" version = "0.6.19" @@ -984,7 +838,7 @@ name = "murmur3" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -992,22 +846,9 @@ name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "network" -version = "0.1.0" -dependencies = [ - "bitcrypto 0.1.0", - "chain 0.1.0", - "keys 0.1.0", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serialization 0.1.0", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1022,13 +863,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "abstract-ns 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "domain 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num_cpus" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1061,35 +902,13 @@ dependencies = [ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "p2p" -version = "0.1.0" -dependencies = [ - "abstract-ns 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bitcrypto 0.1.0", - "csv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "message 0.1.0", - "network 0.1.0", - "ns-dns-tokio 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serialization 0.1.0", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pairing" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1107,7 +926,7 @@ name = "parity-rocksdb-sys" version = "0.5.6" source = "git+https://github.com/paritytech/rust-rocksdb#6e099ebea51e5b5adb33405310504c8582649b34" dependencies = [ - "cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1118,7 +937,7 @@ name = "parity-snappy-sys" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1147,10 +966,10 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1158,24 +977,14 @@ name = "parking_lot_core" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "primitives" -version = "0.1.0" -dependencies = [ - "bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1206,7 +1015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quote" -version = "0.6.10" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1214,53 +1023,53 @@ dependencies = [ [[package]] name = "rand" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1268,21 +1077,21 @@ name = "rand_chacha" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" -version = "0.2.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1290,7 +1099,7 @@ name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1298,29 +1107,39 @@ name = "rand_isaac" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_os" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_pcg" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1328,28 +1147,29 @@ name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1357,12 +1177,12 @@ name = "rdrand" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "redox_syscall" -version = "0.1.50" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1370,24 +1190,32 @@ name = "redox_termios" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" -version = "1.1.2" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-automata" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1398,37 +1226,7 @@ name = "remove_dir_all" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rpc" -version = "0.1.0" -dependencies = [ - "chain 0.1.0", - "db 0.1.0", - "jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-derive 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-http-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-pubsub 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "keys 0.1.0", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "miner 0.1.0", - "network 0.1.0", - "p2p 0.1.0", - "primitives 0.1.0", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "script 0.1.0", - "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", - "serialization 0.1.0", - "storage 0.1.0", - "sync 0.1.0", - "test-data 0.1.0", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "verification 0.1.0", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1438,7 +1236,7 @@ source = "git+https://github.com/nikvolf/rust-crypto?branch=no-pad#4acc67cb46bb4 dependencies = [ "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1468,7 +1266,7 @@ dependencies = [ [[package]] name = "ryu" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1478,10 +1276,10 @@ source = "git+https://github.com/zcash-hackworks/sapling-crypto.git?rev=21084bde dependencies = [ "bellman 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc.git?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "pairing 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1499,21 +1297,6 @@ name = "scopeguard" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "script" -version = "0.1.0" -dependencies = [ - "bitcrypto 0.1.0", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chain 0.1.0", - "keys 0.1.0", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", - "serialization 0.1.0", -] - [[package]] name = "semver" version = "0.9.0" @@ -1534,49 +1317,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serialization" -version = "0.1.0" -dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serialization_derive" -version = "0.1.0" -dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serialization 0.1.0", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sha2" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1611,34 +1376,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "smallvec" -version = "0.6.7" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "storage" -version = "0.1.0" -dependencies = [ - "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bitcrypto 0.1.0", - "chain 0.1.0", - "display_derive 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "network 0.1.0", - "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "serialization 0.1.0", -] - [[package]] name = "string" version = "0.2.1" @@ -1649,7 +1394,7 @@ dependencies = [ [[package]] name = "strsim" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1669,43 +1414,14 @@ dependencies = [ [[package]] name = "syn" -version = "0.15.24" +version = "0.15.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sync" -version = "0.1.0" -dependencies = [ - "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bitcrypto 0.1.0", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chain 0.1.0", - "db 0.1.0", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", - "keys 0.1.0", - "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "message 0.1.0", - "miner 0.1.0", - "murmur3 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "network 0.1.0", - "p2p 0.1.0", - "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "script 0.1.0", - "serialization 0.1.0", - "storage 0.1.0", - "test-data 0.1.0", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "verification 0.1.0", -] - [[package]] name = "synom" version = "0.11.3" @@ -1728,7 +1444,7 @@ name = "tempdir" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1747,25 +1463,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "test-data" -version = "0.1.0" -dependencies = [ - "chain 0.1.0", - "network 0.1.0", - "primitives 0.1.0", - "script 0.1.0", - "serialization 0.1.0", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "textwrap" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1785,39 +1489,51 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio" -version = "0.1.14" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-current-thread 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-fs 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-trace-core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tokio-codec" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1827,44 +1543,44 @@ version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-current-thread" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-executor" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-fs" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1873,7 +1589,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1882,15 +1598,15 @@ name = "tokio-reactor" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1901,7 +1617,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1910,7 +1626,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1919,30 +1635,37 @@ dependencies = [ [[package]] name = "tokio-threadpool" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-timer" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-trace-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1951,7 +1674,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1965,7 +1688,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2014,17 +1737,9 @@ name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "utf8-ranges" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2032,48 +1747,17 @@ name = "vec_map" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "verification" -version = "0.1.0" -dependencies = [ - "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitcrypto 0.1.0", - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bitvec 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chain 0.1.0", - "db 0.1.0", - "keys 0.1.0", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "network 0.1.0", - "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "primitives 0.1.0", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "script 0.1.0", - "serialization 0.1.0", - "storage 0.1.0", - "test-data 0.1.0", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "version_check" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "want" -version = "0.0.6" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2085,7 +1769,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2107,7 +1791,7 @@ name = "winapi-util" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2120,7 +1804,7 @@ name = "wincolor" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2148,121 +1832,443 @@ name = "zebra" version = "0.1.0" dependencies = [ "app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)", - "chain 0.1.0", - "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "db 0.1.0", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "import 0.1.0", - "keys 0.1.0", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "logs 0.1.0", - "message 0.1.0", - "miner 0.1.0", - "network 0.1.0", - "p2p 0.1.0", - "primitives 0.1.0", - "rpc 0.1.0", - "script 0.1.0", - "storage 0.1.0", - "sync 0.1.0", - "verification 0.1.0", + "zebra-chain 0.1.0", + "zebra-db 0.1.0", + "zebra-import 0.1.0", + "zebra-keys 0.1.0", + "zebra-logs 0.1.0", + "zebra-message 0.1.0", + "zebra-miner 0.1.0", + "zebra-network 0.1.0", + "zebra-p2p 0.1.0", + "zebra-primitives 0.1.0", + "zebra-rpc 0.1.0", + "zebra-script 0.1.0", + "zebra-storage 0.1.0", + "zebra-sync 0.1.0", + "zebra-verification 0.1.0", +] + +[[package]] +name = "zebra-bencher" +version = "0.1.0" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-db 0.1.0", + "zebra-network 0.1.0", + "zebra-primitives 0.1.0", + "zebra-storage 0.1.0", + "zebra-test-data 0.1.0", + "zebra-verification 0.1.0", +] + +[[package]] +name = "zebra-chain" +version = "0.1.0" +dependencies = [ + "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-crypto 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", + "zebra-serialization_derive 0.1.0", +] + +[[package]] +name = "zebra-crypto" +version = "0.1.0" +dependencies = [ + "bellman 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc.git?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", + "blake2b_simd 0.5.3 (git+https://github.com/oconnor663/blake2b_simd.git)", + "bn 0.4.4 (git+https://github.com/paritytech/bn)", + "ed25519-dalek 1.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pairing 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.36 (git+https://github.com/nikvolf/rust-crypto?branch=no-pad)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sapling-crypto 0.0.1 (git+https://github.com/zcash-hackworks/sapling-crypto.git?rev=21084bde2019c04bd34208e63c3560fe2c02fb0e)", + "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "siphasher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-primitives 0.1.0", +] + +[[package]] +name = "zebra-db" +version = "0.1.0" +dependencies = [ + "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-rocksdb 0.5.1 (git+https://github.com/paritytech/rust-rocksdb)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", + "zebra-storage 0.1.0", + "zebra-test-data 0.1.0", +] + +[[package]] +name = "zebra-import" +version = "0.1.0" +dependencies = [ + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", +] + +[[package]] +name = "zebra-keys" +version = "0.1.0" +dependencies = [ + "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth-secp256k1 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-crypto 0.1.0", + "zebra-primitives 0.1.0", +] + +[[package]] +name = "zebra-logs" +version = "0.1.0" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "zebra-message" +version = "0.1.0" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-crypto 0.1.0", + "zebra-network 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", + "zebra-serialization_derive 0.1.0", +] + +[[package]] +name = "zebra-miner" +version = "0.1.0" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "zebra-chain 0.1.0", + "zebra-crypto 0.1.0", + "zebra-db 0.1.0", + "zebra-keys 0.1.0", + "zebra-network 0.1.0", + "zebra-primitives 0.1.0", + "zebra-script 0.1.0", + "zebra-serialization 0.1.0", + "zebra-storage 0.1.0", + "zebra-test-data 0.1.0", + "zebra-verification 0.1.0", +] + +[[package]] +name = "zebra-network" +version = "0.1.0" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-crypto 0.1.0", + "zebra-keys 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", +] + +[[package]] +name = "zebra-p2p" +version = "0.1.0" +dependencies = [ + "abstract-ns 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ns-dns-tokio 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-crypto 0.1.0", + "zebra-message 0.1.0", + "zebra-network 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", +] + +[[package]] +name = "zebra-primitives" +version = "0.1.0" +dependencies = [ + "bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "zebra-rpc" +version = "0.1.0" +dependencies = [ + "jsonrpc-core 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-derive 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-http-server 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-pubsub 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-db 0.1.0", + "zebra-keys 0.1.0", + "zebra-miner 0.1.0", + "zebra-network 0.1.0", + "zebra-p2p 0.1.0", + "zebra-primitives 0.1.0", + "zebra-script 0.1.0", + "zebra-serialization 0.1.0", + "zebra-storage 0.1.0", + "zebra-sync 0.1.0", + "zebra-test-data 0.1.0", + "zebra-verification 0.1.0", +] + +[[package]] +name = "zebra-script" +version = "0.1.0" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-crypto 0.1.0", + "zebra-keys 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", +] + +[[package]] +name = "zebra-serialization" +version = "0.1.0" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-primitives 0.1.0", +] + +[[package]] +name = "zebra-serialization_derive" +version = "0.1.0" +dependencies = [ + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-serialization 0.1.0", +] + +[[package]] +name = "zebra-storage" +version = "0.1.0" +dependencies = [ + "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "display_derive 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-crypto 0.1.0", + "zebra-network 0.1.0", + "zebra-primitives 0.1.0", + "zebra-serialization 0.1.0", +] + +[[package]] +name = "zebra-sync" +version = "0.1.0" +dependencies = [ + "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "murmur3 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-crypto 0.1.0", + "zebra-db 0.1.0", + "zebra-keys 0.1.0", + "zebra-message 0.1.0", + "zebra-miner 0.1.0", + "zebra-network 0.1.0", + "zebra-p2p 0.1.0", + "zebra-primitives 0.1.0", + "zebra-script 0.1.0", + "zebra-serialization 0.1.0", + "zebra-storage 0.1.0", + "zebra-test-data 0.1.0", + "zebra-verification 0.1.0", +] + +[[package]] +name = "zebra-test-data" +version = "0.1.0" +dependencies = [ + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-network 0.1.0", + "zebra-primitives 0.1.0", + "zebra-script 0.1.0", + "zebra-serialization 0.1.0", +] + +[[package]] +name = "zebra-verification" +version = "0.1.0" +dependencies = [ + "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitvec 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "zebra-chain 0.1.0", + "zebra-crypto 0.1.0", + "zebra-db 0.1.0", + "zebra-keys 0.1.0", + "zebra-network 0.1.0", + "zebra-primitives 0.1.0", + "zebra-script 0.1.0", + "zebra-serialization 0.1.0", + "zebra-storage 0.1.0", + "zebra-test-data 0.1.0", ] [metadata] "checksum abstract-ns 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2f451afbdf8ed8c8f8a98433055bb9a6b7a72aef4baff16227d2a43dd547f43b" -"checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" +"checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)" = "" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" "checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" -"checksum autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e5f34df7a019573fb8bdc7e24a2bfebe51a2a1d6bfdbaeccedb3c41fc574727" +"checksum autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0e49efa51329a5fd37e7c79db4621af617cd4e3e5bc224939808d076077077bf" "checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" "checksum bellman 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eae372472c7ea8f7c8fc6a62f7d5535db8302de7f1aafda2e13a97c4830d3bcf" "checksum bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebecac13b3c745150d7b6c3ea7572d372f09d627c2077e893bf26c5c7f70d282" "checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" -"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" -"checksum bitvec 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81be2dda00e233388a4605ceb6ce977503cf16e2859d8ef8899e6780b988f4b1" +"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" +"checksum bitvec 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "284495959f63520b015b41f8e2a0627af935345ea558ae779b354e8f98c966fa" "checksum blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc.git?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)" = "" -"checksum blake2b_simd 0.4.1 (git+https://github.com/oconnor663/blake2b_simd.git)" = "" +"checksum blake2b_simd 0.5.3 (git+https://github.com/oconnor663/blake2b_simd.git)" = "" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" "checksum bn 0.4.4 (git+https://github.com/paritytech/bn)" = "" +"checksum bstr 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc0572e02f76cb335f309b19e0a0d585b4f62788f7d26de2a13a836a637385f" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" -"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -"checksum cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749" -"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" -"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" +"checksum cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "39f75544d7bbaf57560d2168f28fd649ff9c76153874db88bdbdfd839b1a7e7d" +"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "97276801e127ffb46b66ce23f35cc96bd454fa311294bced4bbace7baa8b1d17" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" +"checksum cmake 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "2ca4386c8954b76a8415b63959337d940d724b336cabd3afe189c2b51a7e1ff0" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" "checksum crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19" -"checksum crossbeam 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad4c7ea749d9fb09e23c5cb17e3b70650860553a0e2744e38446b1803bf7db94" -"checksum crossbeam-channel 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "137bc235f622ffaa0428e3854e24acb53291fc0b3ff6fb2cb75a8be6fb02f06b" -"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" "checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13" -"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" -"checksum crossbeam-epoch 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f10a4f8f409aaac4b16a5474fb233624238fcdeefb9ba50d5ea059aab63ba31c" -"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" -"checksum crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "41ee4864f4797060e52044376f7d107429ce1fb43460021b126424b7180ee21a" +"checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" +"checksum crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "04c9e3102cc2d69cd681412141b390abd55a362afc1540965dad0ad4d34280b4" +"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +"checksum crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" -"checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2" -"checksum csv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9044e25afb0924b5a5fc5511689b0918629e85d68ea591e5e87fbf1e85ea1b3b" -"checksum csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5cdef62f37e6ffe7d1f07a381bc0db32b7a3ff1cac0de56cb0d81e71f53d65" +"checksum crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +"checksum csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37519ccdfd73a75821cac9319d4fce15a81b9fcf75f951df5b9988aa3a0af87d" +"checksum csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c" "checksum curve25519-dalek 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5d4b820e8711c211745880150f5fac78ab07d6e3851d8ce9f5a02cedc199174c" "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" -"checksum digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05f47366984d3ad862010e22c7ce81a7dbcaebbdfb37241a620f8b6596ee135c" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum display_derive 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4bba5dcd6d2855639fcf65a9af7bbad0bfb6dbf6fe68fba70bab39a6eb973ef4" "checksum domain 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fd084ecc1e666961e32fa29a01a5d9d6da04e7cef8702b9f31fd2dbe9e62a274" "checksum ed25519-dalek 1.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81956bcf7ef761fb4e1d88de3fa181358a0d26cbcb9755b587a08f9119824b86" "checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" "checksum elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "073be79b6538296faf81c631872676600616073817dd9a440c477ad09b408983" "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" -"checksum eth-secp256k1 0.5.7 (git+https://github.com/ethcore/rust-secp256k1)" = "" +"checksum eth-secp256k1 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "cbd3fb7567e8dbc89918e5f8906c336d4025c8da7e8d89e790477bfa2a9f79e0" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)" = "a2037ec1c6c1c4f79557762eab1f7eae1f64f6cb418ace90fae88f0942b60139" +"checksum futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" -"checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" "checksum getopts 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "72327b15c228bfe31f1390f93dd5e9279587f0463836393c9df719ce62a3e450" -"checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865" +"checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" "checksum h2 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "a539b63339fbbb00e081e84b6e11bd1d9634a82d91da2984a18ac74a8823f392" "checksum heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)" = "" "checksum http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "eed324f0f0daf6ec10c474f150505af2c143f251722bf9dbd1261bd1f2ee2c1a" +"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" "checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" "checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" -"checksum hyper 0.12.20 (registry+https://github.com/rust-lang/crates.io-index)" = "80eeda66c9ef8e18f5122fff2c54604c053420b11dae951cfb74cf1dcba2e93f" +"checksum hyper 0.12.31 (registry+https://github.com/rust-lang/crates.io-index)" = "6481fff8269772d4463253ca83c788104a7305cb3fb9136bc651a6211e46e03f" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" -"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" +"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jemalloc-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "bfc62c8e50e381768ce8ee0428ee53741929f7ebd73e4d83f669bcf7693e00ae" "checksum jemallocator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9f0cd42ac65f758063fea55126b0148b1ce0a6354ff78e07a4d6806bc65c4ab3" -"checksum jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a5152c3fda235dfd68341b3edf4121bc4428642c93acbd6de88c26bf95fc5d7" -"checksum jsonrpc-derive 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8de4e89cf0938dec51a14255556172b1f5208e4d8999d613813eceeae1405d37" -"checksum jsonrpc-http-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "99e1ce36c7cc9dcab398024d76849ab2cb917ee812653bce6f74fc9eb7c82d16" -"checksum jsonrpc-pubsub 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56608ed54b1b2a69f4357cb8bdfbcbd99fe1179383c03a09bb428931bd35f592" -"checksum jsonrpc-server-utils 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5521613b31ea22d36d9f95ad642058dccec846a94ed8690957652d479f620707" +"checksum jsonrpc-core 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc15eef5f8b6bef5ac5f7440a957ff95d036e2f98706947741bfc93d1976db4c" +"checksum jsonrpc-derive 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2dae61ca8a3b047fb11309b00661bc56837085bd07e46f907b9c562c0b03e68" +"checksum jsonrpc-http-server 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11d2a00824306155b8ef57fe957f31b8cd8ad24262f15cf911d84dcf9a3f206d" +"checksum jsonrpc-pubsub 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37fce55133ee264d0ab42bd862efcd45ae1d062cda599f4cc12ccc4be3195f2a" +"checksum jsonrpc-server-utils 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c9527f01ef25f251d64082cbefc0c6d6f367349afe6848ef908a674e06b2bdd3" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" "checksum libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "6281b86796ba5e4366000be6e9e18bf35580adf9e63fbe2294aadb587613a319" -"checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" "checksum lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" -"checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21" -"checksum memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db4c41318937f6e76648f42826b1d9ade5c09cafb5aef7e351240a70f39206e9" +"checksum lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" "checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" @@ -2271,7 +2277,7 @@ dependencies = [ "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum ns-dns-tokio 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d13b872a5a65428c1d4628fa04391f5c05ba8a23d5ee3094e22284fdddebed86" -"checksum num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5a69d464bdc213aaaff628444e99578ede64e9c854025aa43b9796530afa9238" +"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" "checksum opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "93f5bb2e8e8dec81642920ccff6b61f1eb94fa3020c5a325c9851ff604152409" @@ -2288,33 +2294,35 @@ dependencies = [ "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" -"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" -"checksum rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dee497e66d8d76bf08ce20c8d36e16f93749ab0bf89975b4f8ae5cee660c2da2" -"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" -"checksum rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3906503e80ac6cbcacb2c2973fa8e473f24d7e2747c8c92bb230c2441cad96b5" +"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" -"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -"checksum rand_os 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f46fbd5550acf75b0c2730f5dd1873751daf9beb8f11b44027778fae50d7feca" -"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" +"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "373814f27745b2686b350dd261bfd24576a6fb0e2c5919b3a2b6005f820b0473" -"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" +"checksum rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4b0186e22767d5b9738a05eab7c6ac90b15db17e5b5f9bd87976dd7d89a10a4" +"checksum rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbe0df8435ac0c397d467b6cad6d25543d06e8a019ef3f6af3c384597515bd2" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -"checksum redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)" = "52ee9a534dc1301776eff45b4fa92d2c39b1d8c3d3357e6eb593e0d795506fc2" +"checksum redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)" = "12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53ee8cfdddb2e0291adfb9f13d31d3bbe0a03c9a402c01b1e24188d86c35b24f" -"checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96" +"checksum regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0b2f0808e7d7e4fb1cb07feb6ff2f4bc827938f24f8c2e6a3beb7370af544bdd" +"checksum regex-automata 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3ed09217220c272b29ef237a974ad58515bde75f194e3ffa7e6d0bf0f3b01f86" +"checksum regex-syntax 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d76410686f9e3a17f06128962e0ecc5755870bb890c34820c7af7f1db2e1d48" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum rust-crypto 0.2.36 (git+https://github.com/nikvolf/rust-crypto?branch=no-pad)" = "" "checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" +"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" "checksum sapling-crypto 0.0.1 (git+https://github.com/zcash-hackworks/sapling-crypto.git?rev=21084bde2019c04bd34208e63c3560fe2c02fb0e)" = "" "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" @@ -2322,40 +2330,42 @@ dependencies = [ "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)" = "076a696fdea89c19d3baed462576b8f6d663064414b5c793642da8dfeb99475b" -"checksum serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)" = "46a3223d0c9ba936b61c0d2e3e559e3217dbfb8d65d06d26e8b3c25de38bae3e" -"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d" +"checksum serde_derive 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)" = "ef45eb79d6463b22f5f9e16d283798b7c0175ba6050bc25c1a946c122727fe7b" +"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" "checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" "checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" "checksum siphasher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9913c75df657d84a03fa689c016b0bb2863ff0b497b26a8d6e9703f8d5df03a8" "checksum skeptic 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24ebf8a06f5f8bae61ae5bbc7af7aac4ef6907ae975130faba1199e5fe82256a" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db" +"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subtle 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01dca13cf6c3b179864ab3292bd794e757618d35a7766b7c46050c614ba00829" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)" = "734ecc29cd36e8123850d9bf21dfd62ef8300aaa8f879aabaa899721808be37c" +"checksum syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d960b829a55e56db167e861ddb43602c003c7be0bee1d345021703fac2fb7c" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a8fb22f7cde82c8220e5aeacb3258ed7ce996142c77cba193f203515e26c330" -"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" -"checksum tokio 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4790d0be6f4ba6ae4f48190efa2ed7780c9e3567796abdb285003cf39840d9c5" +"checksum tokio 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "ec2ffcf4bcfc641413fa0f1427bf8f91dfc78f56a6559cbf50e04837ae442a87" +"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" -"checksum tokio-current-thread 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c756b04680eea21902a46fca4e9f410a2332c04995af590e07ff262e2193a9a3" -"checksum tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30c6dbf2d1ad1de300b393910e8a3aa272b724a400b6531da03eed99e329fbf0" -"checksum tokio-fs 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0e9cbbc8a3698b7ab652340f46633364f9eaa928ddaaee79d8b8f356dd79a09d" +"checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" +"checksum tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "83ea44c6c0773cc034771693711c35c677b4b5a4b21b9e7071704c54de7d555e" +"checksum tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" "checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" "checksum tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6af16bfac7e112bea8b0442542161bfc41cbfa4466b580bdda7d18cb88b911ce" "checksum tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2162248ff317e2bc713b261f242b69dbb838b85248ed20bb21df56d60ea4cae7" "checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" -"checksum tokio-threadpool 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c3fd86cb15547d02daa2b21aadaf4e37dee3368df38a526178a5afa3c034d2fb" -"checksum tokio-timer 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4f37f0111d76cc5da132fe9bc0590b9b9cfd079bc7e75ac3846278430a299ff8" +"checksum tokio-threadpool 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72558af20be886ea124595ea0f806dd5703b8958e4705429dd58b3d8231f72f2" +"checksum tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f2106812d500ed25a4f38235b9cae8f78a09edf43203e16e59c3b769a342a60e" +"checksum tokio-trace-core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9c8a256d6956f7cb5e2bdfe8b1e8022f1a09206c6c2b1ba00f3b746b260c613" "checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" @@ -2365,14 +2375,12 @@ dependencies = [ "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" +"checksum utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" +"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" diff --git a/Cargo.toml b/Cargo.toml index c24d3576..82a256eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,30 +2,30 @@ name = "zebra" version = "0.1.0" license = "GPL-3.0" -authors = ["Zcash Foundation"] +authors = ["Zcash Foundation "] description = "A consensus-compatible Zcash node client written in Rust." [dependencies] app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } -chain = { path = "chain" } clap = { version = "2", features = ["yaml"] } -db = { path = "db" } env_logger = "0.5" -import = { path = "import" } -keys = { path = "keys" } libc = "0.2" log = "0.4" -logs = { path = "logs" } -message = { path = "message" } -network = { path = "network" } -miner = { path = "miner" } -p2p = { path = "p2p" } -primitives = { path = "primitives" } -rpc = { path = "rpc" } -script = { path = "script" } -storage = { path = "storage" } -sync = { path = "sync" } -verification = { path = "verification" } +zebra-db = { path = "db" } +zebra-chain = { path = "chain" } +zebra-import = { path = "import" } +zebra-keys = { path = "keys" } +zebra-logs = { path = "logs" } +zebra-message = { path = "message" } +zebra-network = { path = "network" } +zebra-miner = { path = "miner" } +zebra-p2p = { path = "p2p" } +zebra-primitives = { path = "primitives" } +zebra-rpc = { path = "rpc" } +zebra-script = { path = "script" } +zebra-storage = { path = "storage" } +zebra-sync = { path = "sync" } +zebra-verification = { path = "verification" } [profile.dev] debug = true @@ -45,7 +45,7 @@ name = "zebra" [workspace] members = [ "bencher", - "./crypto", + "crypto", "chain", "db", "import", diff --git a/bencher/Cargo.toml b/bencher/Cargo.toml index b8be234f..cbb0f8c2 100644 --- a/bencher/Cargo.toml +++ b/bencher/Cargo.toml @@ -1,18 +1,17 @@ [package] -name = "bencher" +name = "zebra-bencher" version = "0.1.0" license = "GPL-3.0" -authors = ["Ethcore "] -description = "Parity bitcoin client." +authors = ["Zcash Foundation "] [dependencies] -storage = { path = "../storage" } -db = { path = "../db" } -verification = { path = "../verification" } -network = { path = "../network" } -chain = { path = "../chain", features = ["test-helpers"] } -primitives = { path = "../primitives" } -test-data = { path = "../test-data" } +zebra-storage = { path = "../storage" } +zebra-db = { path = "../db" } +zebra-verification = { path = "../verification" } +zebra-network = { path = "../network" } +zebra-chain = { path = "../chain", features = ["test-helpers"] } +zebra-primitives = { path = "../primitives" } +zebra-test-data = { path = "../test-data" } time = "*" byteorder = "1.0" diff --git a/bencher/src/database.rs b/bencher/src/database.rs index 5817bd6b..581ac3e7 100644 --- a/bencher/src/database.rs +++ b/bencher/src/database.rs @@ -1,7 +1,7 @@ -use chain::IndexedBlock; -use db::BlockChainDatabase; -use storage::{BlockOrigin, BlockProvider, BlockRef, ForkChain}; -use test_data; +use zebra_chain::IndexedBlock; +use zebra_db::BlockChainDatabase; +use zebra_storage::{BlockOrigin, BlockProvider, BlockRef, ForkChain}; +use zebra_test_data; use super::Benchmark; @@ -12,7 +12,7 @@ pub fn fetch(benchmark: &mut Benchmark) { benchmark.samples(BLOCKS); // test setup - let genesis: IndexedBlock = test_data::genesis().into(); + let genesis: IndexedBlock = zebra_test_data::genesis().into(); let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]); let mut rolling_hash = genesis.hash().clone(); @@ -20,7 +20,7 @@ pub fn fetch(benchmark: &mut Benchmark) { let mut hashes = Vec::new(); for x in 0..BLOCKS { - let next_block = test_data::block_builder() + let next_block = zebra_test_data::block_builder() .transaction() .coinbase() .lock_time(x as u32) @@ -60,7 +60,7 @@ pub fn write(benchmark: &mut Benchmark) { benchmark.samples(BLOCKS); // setup - let genesis: IndexedBlock = test_data::genesis().into(); + let genesis: IndexedBlock = zebra_test_data::genesis().into(); let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]); let mut rolling_hash = genesis.hash().clone(); @@ -68,7 +68,7 @@ pub fn write(benchmark: &mut Benchmark) { let mut blocks: Vec = Vec::new(); for x in 0..BLOCKS { - let next_block = test_data::block_builder() + let next_block = zebra_test_data::block_builder() .transaction() .coinbase() .lock_time(x as u32) @@ -101,7 +101,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { benchmark.samples(BLOCKS); // setup - let genesis: IndexedBlock = test_data::genesis().into(); + let genesis: IndexedBlock = zebra_test_data::genesis().into(); let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]); let mut rolling_hash = genesis.hash().clone(); @@ -111,7 +111,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { for x in 0..BLOCKS { let base = rolling_hash.clone(); - let next_block = test_data::block_builder() + let next_block = zebra_test_data::block_builder() .transaction() .coinbase() .lock_time(x as u32) @@ -127,7 +127,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { rolling_hash = next_block.hash(); blocks.push(next_block); - let next_block_side = test_data::block_builder() + let next_block_side = zebra_test_data::block_builder() .transaction() .coinbase() .lock_time(x as u32) @@ -143,7 +143,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { let next_base = next_block_side.hash(); blocks.push(next_block_side); - let next_block_side_continue = test_data::block_builder() + let next_block_side_continue = zebra_test_data::block_builder() .transaction() .coinbase() .lock_time(x as u32) @@ -158,7 +158,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { .build(); blocks.push(next_block_side_continue); - let next_block_continue = test_data::block_builder() + let next_block_continue = zebra_test_data::block_builder() .transaction() .coinbase() .lock_time(x as u32) @@ -224,7 +224,7 @@ pub fn write_heavy(benchmark: &mut Benchmark) { benchmark.samples(BLOCKS); // test setup - let genesis: IndexedBlock = test_data::genesis().into(); + let genesis: IndexedBlock = zebra_test_data::genesis().into(); let store = BlockChainDatabase::init_test_chain(vec![genesis.clone()]); let mut rolling_hash = genesis.hash().clone(); @@ -232,7 +232,7 @@ pub fn write_heavy(benchmark: &mut Benchmark) { let mut hashes = Vec::new(); for x in 0..BLOCKS_INITIAL { - let next_block = test_data::block_builder() + let next_block = zebra_test_data::block_builder() .transaction() .coinbase() .lock_time(x as u32) @@ -251,7 +251,10 @@ pub fn write_heavy(benchmark: &mut Benchmark) { } for b in 0..BLOCKS { - let mut builder = test_data::block_builder().transaction().coinbase().build(); + let mut builder = zebra_test_data::block_builder() + .transaction() + .coinbase() + .build(); for t in 0..TRANSACTIONS { builder = builder diff --git a/bencher/src/main.rs b/bencher/src/main.rs index d66ec49a..523affbc 100644 --- a/bencher/src/main.rs +++ b/bencher/src/main.rs @@ -1,12 +1,12 @@ extern crate byteorder; -extern crate chain; -extern crate db; -extern crate network; -extern crate primitives; -extern crate storage; -extern crate test_data; extern crate time; -extern crate verification; +extern crate zebra_chain; +extern crate zebra_db; +extern crate zebra_network; +extern crate zebra_primitives; +extern crate zebra_storage; +extern crate zebra_test_data; +extern crate zebra_verification; mod database; mod verifier; diff --git a/bencher/src/verifier.rs b/bencher/src/verifier.rs index 62b85904..e0ef484c 100644 --- a/bencher/src/verifier.rs +++ b/bencher/src/verifier.rs @@ -1,10 +1,12 @@ use byteorder::{ByteOrder, LittleEndian}; -use chain::IndexedBlock; -use db::BlockChainDatabase; -use network::{ConsensusParams, Network}; use std::sync::Arc; -use test_data; -use verification::{BackwardsCompatibleChainVerifier as ChainVerifier, VerificationLevel, Verify}; +use zebra_chain::IndexedBlock; +use zebra_db::BlockChainDatabase; +use zebra_network::{ConsensusParams, Network}; +use zebra_test_data; +use zebra_verification::{ + BackwardsCompatibleChainVerifier as ChainVerifier, VerificationLevel, Verify, +}; use super::Benchmark; @@ -26,7 +28,7 @@ pub fn main(benchmark: &mut Benchmark) { ); // test setup - let genesis = test_data::genesis(); + let genesis = zebra_test_data::genesis(); let consensus = ConsensusParams::new(Network::Unitest); let mut rolling_hash = genesis.hash(); @@ -35,7 +37,7 @@ pub fn main(benchmark: &mut Benchmark) { for x in 0..BLOCKS_INITIAL { let mut coinbase_nonce = [0u8; 8]; LittleEndian::write_u64(&mut coinbase_nonce[..], x as u64); - let next_block = test_data::block_builder() + let next_block = zebra_test_data::block_builder() .transaction() .lock_time(x as u32) .input() @@ -69,7 +71,7 @@ pub fn main(benchmark: &mut Benchmark) { for b in 0..BLOCKS { let mut coinbase_nonce = [0u8; 8]; LittleEndian::write_u64(&mut coinbase_nonce[..], (b + BLOCKS_INITIAL) as u64); - let mut builder = test_data::block_builder() + let mut builder = zebra_test_data::block_builder() .transaction() .lock_time(b as u32) .input() diff --git a/chain/Cargo.toml b/chain/Cargo.toml index ac197ee2..06bf8567 100644 --- a/chain/Cargo.toml +++ b/chain/Cargo.toml @@ -1,15 +1,16 @@ [package] -name = "chain" +name = "zebra-chain" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] rustc-hex = "2" heapsize = "0.4" -bitcrypto = { path = "../crypto" } -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } -serialization_derive = { path = "../serialization_derive" } +zebra-crypto = { path = "../crypto" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } +zebra-serialization_derive = { path = "../serialization_derive" } [features] default = [] diff --git a/chain/src/block_header.rs b/chain/src/block_header.rs index 3dd98881..f5cda193 100644 --- a/chain/src/block_header.rs +++ b/chain/src/block_header.rs @@ -1,12 +1,12 @@ use compact::Compact; -use crypto::dhash256; use hash::H256; use hex::FromHex; -use primitives::bytes::Bytes; use ser::Stream; use ser::{deserialize, serialize}; use solution::EquihashSolution; use std::fmt; +use zebra_crypto::dhash256; +use zebra_primitives::bytes::Bytes; #[derive(PartialEq, Clone, Serializable, Deserializable)] pub struct BlockHeader { diff --git a/chain/src/join_split.rs b/chain/src/join_split.rs index 10aac074..2f7948ca 100644 --- a/chain/src/join_split.rs +++ b/chain/src/join_split.rs @@ -1,8 +1,8 @@ -use crypto::Groth16Proof; use hash::{H256, H512}; use hex::ToHex; use ser::{CompactInteger, Error, Reader, Serializable, Stream}; use std::{fmt, io}; +use zebra_crypto::Groth16Proof; #[derive(Clone)] pub enum JoinSplitProof { diff --git a/chain/src/lib.rs b/chain/src/lib.rs index 2035b3ea..aaf8aa1e 100644 --- a/chain/src/lib.rs +++ b/chain/src/lib.rs @@ -1,10 +1,10 @@ -extern crate bitcrypto as crypto; extern crate heapsize; -extern crate primitives; extern crate rustc_hex as hex; -extern crate serialization as ser; +extern crate zebra_crypto; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; #[macro_use] -extern crate serialization_derive; +extern crate zebra_serialization_derive; pub mod constants; @@ -22,7 +22,7 @@ mod indexed_transaction; /// `IndexedBlock` extension mod read_and_hash; -pub use primitives::{bigint, bytes, compact, hash}; +pub use zebra_primitives::{bigint, bytes, compact, hash}; pub use transaction::{ BTC_TX_VERSION, OVERWINTER_TX_VERSION, SAPLING_TX_VERSION, SPROUT_TX_VERSION, diff --git a/chain/src/merkle_root.rs b/chain/src/merkle_root.rs index ea6c6c62..ee8ef988 100644 --- a/chain/src/merkle_root.rs +++ b/chain/src/merkle_root.rs @@ -1,5 +1,5 @@ -use crypto::dhash256; use hash::{H256, H512}; +use zebra_crypto::dhash256; #[inline] fn concat(a: T, b: T) -> H512 diff --git a/chain/src/read_and_hash.rs b/chain/src/read_and_hash.rs index 45b9f9e7..a4325668 100644 --- a/chain/src/read_and_hash.rs +++ b/chain/src/read_and_hash.rs @@ -1,7 +1,7 @@ -use crypto::{DHash256, Digest}; use hash::H256; use ser::{Deserializable, Error as ReaderError, Reader}; use std::io; +use zebra_crypto::{DHash256, Digest}; pub struct HashedData { pub size: usize, diff --git a/chain/src/transaction.rs b/chain/src/transaction.rs index 4128cb43..512daa9f 100644 --- a/chain/src/transaction.rs +++ b/chain/src/transaction.rs @@ -3,7 +3,6 @@ use bytes::Bytes; use constants::{LOCKTIME_THRESHOLD, SEQUENCE_FINAL}; -use crypto::dhash256; use hash::H256; use heapsize::HeapSizeOf; use hex::FromHex; @@ -12,6 +11,7 @@ use sapling::Sapling; use ser::{deserialize, serialize}; use ser::{Deserializable, Error, Reader, Serializable, Stream}; use std::io; +use zebra_crypto::dhash256; /// Original bitcoin transaction version. pub const BTC_TX_VERSION: i32 = 1; diff --git a/crypto/Cargo.toml b/crypto/Cargo.toml index f6b8b592..7aaa1003 100644 --- a/crypto/Cargo.toml +++ b/crypto/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "bitcrypto" +name = "zebra-crypto" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] bellman = "0.1" @@ -11,7 +12,6 @@ bn = { git = "https://github.com/paritytech/bn" } ed25519-dalek = "1.0.0-pre.1" lazy_static = "1.3.0" pairing = "0.14.2" -primitives = { path = "../primitives" } rust-crypto = { git = "https://github.com/nikvolf/rust-crypto", branch = "no-pad" } rustc-hex = "2" sapling-crypto = { git = "https://github.com/zcash-hackworks/sapling-crypto.git", rev = "21084bde2019c04bd34208e63c3560fe2c02fb0e" } @@ -19,3 +19,4 @@ serde = "1.0" serde_derive = "1.0" serde_json = "1.0" siphasher = "0.3.0" +zebra-primitives = { path = "../primitives" } diff --git a/crypto/src/lib.rs b/crypto/src/lib.rs index 1324b8b8..f6d16ae3 100644 --- a/crypto/src/lib.rs +++ b/crypto/src/lib.rs @@ -2,11 +2,11 @@ extern crate blake2_rfc; extern crate bn; extern crate crypto as rcrypto; extern crate ed25519_dalek as ed25519; -extern crate primitives; extern crate rustc_hex as hex; extern crate serde; extern crate serde_json; extern crate siphasher; +extern crate zebra_primitives; pub extern crate bellman; pub extern crate blake2b_simd as blake2; @@ -30,12 +30,12 @@ lazy_static! { { sapling_crypto::jubjub::JubjubBls12::new() }; } -use primitives::hash::{H160, H256, H32}; use rcrypto::ripemd160::Ripemd160; use rcrypto::sha1::Sha1; use rcrypto::sha2::Sha256; use siphasher::sip::SipHasher24; use std::hash::Hasher; +use zebra_primitives::hash::{H160, H256, H32}; pub use json::groth16::{ load_joinsplit_groth16_verifying_key, load_sapling_output_verifying_key, @@ -344,8 +344,8 @@ mod tests { checksum, dhash160, dhash256, pedersen_hash, ripemd160, sha1, sha256, sha256_compress, siphash24, }; - use primitives::bytes::Bytes; - use primitives::hash::H256; + use zebra_primitives::bytes::Bytes; + use zebra_primitives::hash::H256; #[test] fn test_ripemd160() { diff --git a/db/Cargo.toml b/db/Cargo.toml index 42a3120d..b74d72b8 100644 --- a/db/Cargo.toml +++ b/db/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "db" +name = "zebra-db" version = "0.1.0" -authors = ["Parity Technologies "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] parity-rocksdb = { git = "https://github.com/paritytech/rust-rocksdb" } @@ -10,11 +11,11 @@ parking_lot = "0.8" log = "0.4" bit-vec = "0.4" lru-cache = "0.1" -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } -chain = { path = "../chain" } -storage = { path = "../storage" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } +zebra-chain = { path = "../chain" } +zebra-storage = { path = "../storage" } [dev-dependencies] tempdir = "0.3" -test-data = { path = "../test-data" } +zebra-test-data = { path = "../test-data" } diff --git a/db/src/block_chain_db.rs b/db/src/block_chain_db.rs index 85b8a029..e1510d01 100644 --- a/db/src/block_chain_db.rs +++ b/db/src/block_chain_db.rs @@ -1,5 +1,4 @@ use bytes::Bytes; -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction, OutPoint, TransactionOutput}; use hash::H256; use kv::{ AutoFlushingOverlayDatabase, CacheDatabase, DatabaseConfig, DiskDatabase, Key, KeyState, @@ -16,7 +15,10 @@ use ser::{deserialize, serialize, List}; use std::collections::HashMap; use std::fs; use std::path::Path; -use storage::{ +use zebra_chain::{ + IndexedBlock, IndexedBlockHeader, IndexedTransaction, OutPoint, TransactionOutput, +}; +use zebra_storage::{ BestBlock, BlockChain, BlockHeaderProvider, BlockOrigin, BlockProvider, BlockRef, CanonStore, EpochRef, EpochTag, Error, ForkChain, Forkable, NullifierTracker, SaplingTreeState, SideChainOrigin, SproutTreeState, Store, TransactionMeta, TransactionMetaProvider, diff --git a/db/src/kv/cachedb.rs b/db/src/kv/cachedb.rs index ce1fe5b6..66cfd47a 100644 --- a/db/src/kv/cachedb.rs +++ b/db/src/kv/cachedb.rs @@ -1,8 +1,8 @@ -use chain::BlockHeader; use hash::H256; use kv::{Key, KeyState, KeyValue, KeyValueDatabase, Operation, Transaction, Value}; use lru_cache::LruCache; use parking_lot::Mutex; +use zebra_chain::BlockHeader; pub struct CacheDatabase where diff --git a/db/src/kv/memorydb.rs b/db/src/kv/memorydb.rs index bc3ede73..8dec886d 100644 --- a/db/src/kv/memorydb.rs +++ b/db/src/kv/memorydb.rs @@ -1,5 +1,4 @@ use bytes::Bytes; -use chain::{BlockHeader, Transaction as ChainTransaction}; use hash::H256; use kv::{Key, KeyState, KeyValue, KeyValueDatabase, Operation, Transaction, Value}; use parking_lot::RwLock; @@ -7,7 +6,8 @@ use ser::List; use std::collections::HashMap; use std::mem::replace; use std::sync::Arc; -use storage::{EpochRef, EpochTag, SaplingTreeState, SproutTreeState, TransactionMeta}; +use zebra_chain::{BlockHeader, Transaction as ChainTransaction}; +use zebra_storage::{EpochRef, EpochTag, SaplingTreeState, SproutTreeState, TransactionMeta}; #[derive(Default, Debug)] struct InnerDatabase { diff --git a/db/src/kv/transaction.rs b/db/src/kv/transaction.rs index ed507fb0..495046c0 100644 --- a/db/src/kv/transaction.rs +++ b/db/src/kv/transaction.rs @@ -1,8 +1,8 @@ use bytes::Bytes; -use chain::{BlockHeader, Transaction as ChainTransaction}; use hash::H256; use ser::{deserialize, serialize, List}; -use storage::{EpochRef, EpochTag, SaplingTreeState, SproutTreeState, TransactionMeta}; +use zebra_chain::{BlockHeader, Transaction as ChainTransaction}; +use zebra_storage::{EpochRef, EpochTag, SaplingTreeState, SproutTreeState, TransactionMeta}; pub const COL_COUNT: u32 = 16; pub const COL_META: u32 = 0; diff --git a/db/src/lib.rs b/db/src/lib.rs index dc7d2623..d35872b6 100644 --- a/db/src/lib.rs +++ b/db/src/lib.rs @@ -6,13 +6,13 @@ extern crate log; extern crate bit_vec; extern crate lru_cache; -extern crate chain; -extern crate primitives; -extern crate serialization as ser; -extern crate storage; +extern crate zebra_chain; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; +extern crate zebra_storage; mod block_chain_db; pub mod kv; pub use block_chain_db::{BlockChainDatabase, ForkChainDatabase}; -pub use primitives::{bytes, hash}; +pub use zebra_primitives::{bytes, hash}; diff --git a/db/tests/blockchaindb.rs b/db/tests/blockchaindb.rs index 9148265a..28064e00 100644 --- a/db/tests/blockchaindb.rs +++ b/db/tests/blockchaindb.rs @@ -1,19 +1,19 @@ -extern crate chain; -extern crate db; -extern crate storage; -extern crate test_data; +extern crate zebra_chain; +extern crate zebra_db; +extern crate zebra_storage; +extern crate zebra_test_data; -use chain::IndexedBlock; -use db::kv::{MemoryDatabase, SharedMemoryDatabase}; -use db::BlockChainDatabase; -use storage::{BlockProvider, ForkChain, SideChainOrigin}; +use zebra_chain::IndexedBlock; +use zebra_db::kv::{MemoryDatabase, SharedMemoryDatabase}; +use zebra_db::BlockChainDatabase; +use zebra_storage::{BlockProvider, ForkChain, SideChainOrigin}; #[test] fn insert_block() { let store = BlockChainDatabase::open(MemoryDatabase::default()); - let b0: IndexedBlock = test_data::block_h0().into(); - let b1: IndexedBlock = test_data::block_h1().into(); - let b2: IndexedBlock = test_data::block_h2().into(); + let b0: IndexedBlock = zebra_test_data::block_h0().into(); + let b1: IndexedBlock = zebra_test_data::block_h1().into(); + let b2: IndexedBlock = zebra_test_data::block_h2().into(); store.insert(b0.clone()).unwrap(); store.insert(b1.clone()).unwrap(); @@ -51,9 +51,9 @@ fn insert_block() { #[test] fn reopen_db() { let shared_database = SharedMemoryDatabase::default(); - let b0: IndexedBlock = test_data::block_h0().into(); - let b1: IndexedBlock = test_data::block_h1().into(); - let b2: IndexedBlock = test_data::block_h2().into(); + let b0: IndexedBlock = zebra_test_data::block_h0().into(); + let b1: IndexedBlock = zebra_test_data::block_h1().into(); + let b2: IndexedBlock = zebra_test_data::block_h2().into(); { let store = BlockChainDatabase::open(shared_database.clone()); @@ -78,9 +78,9 @@ fn reopen_db() { #[test] fn switch_to_simple_fork() { let store = BlockChainDatabase::open(MemoryDatabase::default()); - let b0: IndexedBlock = test_data::block_h0().into(); - let b1: IndexedBlock = test_data::block_h1().into(); - let b2: IndexedBlock = test_data::block_h2().into(); + let b0: IndexedBlock = zebra_test_data::block_h0().into(); + let b1: IndexedBlock = zebra_test_data::block_h1().into(); + let b2: IndexedBlock = zebra_test_data::block_h2().into(); store.insert(b0.clone()).unwrap(); store.insert(b1.clone()).unwrap(); diff --git a/fuzz/fuzz_targets/crypto.rs b/fuzz/fuzz_targets/crypto.rs index 13de4483..e996da46 100644 --- a/fuzz/fuzz_targets/crypto.rs +++ b/fuzz/fuzz_targets/crypto.rs @@ -1,4 +1,4 @@ -extern crate bitcrypto as crypto; +extern crate zebra_crypto; fn target(data: &[u8]) { crypto::ripemd160(data); diff --git a/import/Cargo.toml b/import/Cargo.toml index 885ffb21..5faabfac 100644 --- a/import/Cargo.toml +++ b/import/Cargo.toml @@ -1,10 +1,11 @@ [package] -name = "import" +name = "zebra-import" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] log = "0.4" -primitives = { path = "../primitives" } -chain = { path = "../chain" } -serialization = { path = "../serialization" } +zebra-primitives = { path = "../primitives" } +zebra-chain = { path = "../chain" } +zebra-serialization = { path = "../serialization" } diff --git a/import/src/block.rs b/import/src/block.rs index 07a8ba39..f188d144 100644 --- a/import/src/block.rs +++ b/import/src/block.rs @@ -1,7 +1,7 @@ -use chain::IndexedBlock; use hash::H32; use ser::{Deserializable, Error as ReaderError, Reader}; use std::io; +use zebra_chain::IndexedBlock; #[derive(Debug, PartialEq)] pub struct Block { diff --git a/import/src/lib.rs b/import/src/lib.rs index f5f1289a..1d7113c1 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -2,14 +2,14 @@ #[macro_use] extern crate log; -extern crate chain; -extern crate primitives; -extern crate serialization as ser; +extern crate zebra_chain; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; mod blk; mod block; mod fs; -pub use primitives::{bytes, hash}; +pub use zebra_primitives::{bytes, hash}; pub use blk::{open_blk_dir, BlkDir}; diff --git a/keys/Cargo.toml b/keys/Cargo.toml index 3657d201..c051239f 100644 --- a/keys/Cargo.toml +++ b/keys/Cargo.toml @@ -1,13 +1,14 @@ [package] -name = "keys" +name = "zebra-keys" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] rand = "0.4" rustc-hex = "2" lazy_static = "1.3" base58 = "0.1" -eth-secp256k1 = { git = "https://github.com/ethcore/rust-secp256k1" } -bitcrypto = { path = "../crypto" } -primitives = { path = "../primitives" } +eth-secp256k1 = "0.5.7" +zebra-crypto = { path = "../crypto" } +zebra-primitives = { path = "../primitives" } diff --git a/keys/src/address.rs b/keys/src/address.rs index 1f0e62cd..146fcdb7 100644 --- a/keys/src/address.rs +++ b/keys/src/address.rs @@ -6,11 +6,11 @@ //! https://en.bitcoin.it/wiki/Address use base58::{FromBase58, ToBase58}; -use crypto::checksum; use network::Network; use std::fmt; use std::ops::Deref; use std::str::FromStr; +use zebra_crypto::checksum; use {AddressHash, DisplayLayout, Error}; /// There are two transparent address formats currently in use. diff --git a/keys/src/keypair.rs b/keys/src/keypair.rs index cf15974c..76d9d281 100644 --- a/keys/src/keypair.rs +++ b/keys/src/keypair.rs @@ -88,7 +88,7 @@ impl KeyPair { #[cfg(test)] mod tests { use super::KeyPair; - use crypto::dhash256; + use zebra_crypto::dhash256; use Public; /// Tests from: diff --git a/keys/src/lib.rs b/keys/src/lib.rs index 95ad3bb9..3367c048 100644 --- a/keys/src/lib.rs +++ b/keys/src/lib.rs @@ -5,9 +5,9 @@ extern crate rustc_hex as hex; #[macro_use] extern crate lazy_static; extern crate base58; -extern crate bitcrypto as crypto; -extern crate primitives; extern crate secp256k1; +extern crate zebra_crypto; +extern crate zebra_primitives; mod address; mod display; @@ -19,7 +19,7 @@ mod private; mod public; mod signature; -pub use primitives::{bytes, hash}; +pub use zebra_primitives::{bytes, hash}; pub use address::{Address, Type}; pub use display::DisplayLayout; diff --git a/keys/src/private.rs b/keys/src/private.rs index a872dc33..a06b8268 100644 --- a/keys/src/private.rs +++ b/keys/src/private.rs @@ -1,7 +1,6 @@ //! Secret with additional network identifier and format type use base58::{FromBase58, ToBase58}; -use crypto::checksum; use hash::H520; use hex::ToHex; use network::Network; @@ -9,6 +8,7 @@ use secp256k1::key; use secp256k1::Message as SecpMessage; use std::fmt; use std::str::FromStr; +use zebra_crypto::checksum; use {CompactSignature, DisplayLayout, Error, Message, Secret, Signature, SECP256K1}; /// Secret with additional network identifier and format type diff --git a/keys/src/public.rs b/keys/src/public.rs index dab31596..38e11126 100644 --- a/keys/src/public.rs +++ b/keys/src/public.rs @@ -1,4 +1,3 @@ -use crypto::dhash160; use hash::{H264, H520}; use hex::ToHex; use secp256k1::key; @@ -7,6 +6,7 @@ use secp256k1::{ Signature as SecpSignature, }; use std::{fmt, ops}; +use zebra_crypto::dhash160; use {AddressHash, CompactSignature, Error, Message, Signature, SECP256K1}; /// Secret public key diff --git a/logs/Cargo.toml b/logs/Cargo.toml index deea9df5..eee6cf89 100644 --- a/logs/Cargo.toml +++ b/logs/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "logs" +name = "zebra-logs" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] ansi_term = "0.11" diff --git a/message/Cargo.toml b/message/Cargo.toml index b8668e2b..8727bbf2 100644 --- a/message/Cargo.toml +++ b/message/Cargo.toml @@ -1,14 +1,15 @@ [package] -name = "message" +name = "zebra-message" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] byteorder = "1.0" -bitcrypto = { path = "../crypto" } -chain = { path = "../chain" } -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } -serialization_derive = { path = "../serialization_derive" } -network = { path = "../network" } +zebra-crypto = { path = "../crypto" } +zebra-chain = { path = "../chain" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } +zebra-serialization_derive = { path = "../serialization_derive" } +zebra-network = { path = "../network" } diff --git a/message/src/common/block_header_and_ids.rs b/message/src/common/block_header_and_ids.rs index a2d38f5f..9f7a33e3 100644 --- a/message/src/common/block_header_and_ids.rs +++ b/message/src/common/block_header_and_ids.rs @@ -1,5 +1,5 @@ -use chain::{BlockHeader, ShortTransactionID}; use common::PrefilledTransaction; +use zebra_chain::{BlockHeader, ShortTransactionID}; #[derive(Debug, PartialEq, Serializable, Deserializable)] pub struct BlockHeaderAndIDs { diff --git a/message/src/common/block_transactions.rs b/message/src/common/block_transactions.rs index 13c2d817..550657eb 100644 --- a/message/src/common/block_transactions.rs +++ b/message/src/common/block_transactions.rs @@ -1,5 +1,5 @@ -use chain::Transaction; use hash::H256; +use zebra_chain::Transaction; #[derive(Debug, PartialEq, Serializable, Deserializable)] pub struct BlockTransactions { diff --git a/message/src/common/prefilled_transaction.rs b/message/src/common/prefilled_transaction.rs index 78ce2cde..cd07914c 100644 --- a/message/src/common/prefilled_transaction.rs +++ b/message/src/common/prefilled_transaction.rs @@ -1,6 +1,6 @@ -use chain::Transaction; use ser::{CompactInteger, Deserializable, Error as ReaderError, Reader, Serializable, Stream}; use std::io; +use zebra_chain::Transaction; #[derive(Debug, PartialEq)] pub struct PrefilledTransaction { diff --git a/message/src/lib.rs b/message/src/lib.rs index 8ba5568b..ba139a87 100644 --- a/message/src/lib.rs +++ b/message/src/lib.rs @@ -1,11 +1,11 @@ -extern crate bitcrypto as crypto; extern crate byteorder; -extern crate chain; -extern crate primitives; -extern crate serialization as ser; +extern crate zebra_chain; +extern crate zebra_crypto; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; #[macro_use] -extern crate serialization_derive; -extern crate network; +extern crate zebra_serialization_derive; +extern crate zebra_network; pub mod common; mod error; @@ -13,7 +13,7 @@ mod message; mod serialization; pub mod types; -pub use primitives::{bytes, hash}; +pub use zebra_primitives::{bytes, hash}; pub use common::{Command, Services}; pub use error::{Error, MessageResult}; diff --git a/message/src/message/message.rs b/message/src/message/message.rs index c390908e..aa43ecdb 100644 --- a/message/src/message/message.rs +++ b/message/src/message/message.rs @@ -1,8 +1,8 @@ use bytes::{Bytes, TaggedBytes}; use common::Command; -use network::Magic; use ser::Stream; use serialization::serialize_payload; +use zebra_network::Magic; use {MessageHeader, MessageResult, Payload}; pub fn to_raw_message(magic: Magic, command: Command, payload: &Bytes) -> Bytes { diff --git a/message/src/message/message_header.rs b/message/src/message/message_header.rs index af1ef6d1..4442545d 100644 --- a/message/src/message/message_header.rs +++ b/message/src/message/message_header.rs @@ -1,8 +1,8 @@ use common::Command; -use crypto::checksum; use hash::H32; -use network::Magic; use ser::{Reader, Serializable, Stream}; +use zebra_crypto::checksum; +use zebra_network::Magic; use Error; #[derive(Debug, PartialEq)] @@ -62,8 +62,8 @@ impl Serializable for MessageHeader { mod tests { use super::MessageHeader; use bytes::Bytes; - use network::Network; use ser::serialize; + use zebra_network::Network; #[test] fn test_message_header_serialization() { diff --git a/message/src/types/block.rs b/message/src/types/block.rs index f9163626..1f4341f4 100644 --- a/message/src/types/block.rs +++ b/message/src/types/block.rs @@ -1,6 +1,6 @@ -use chain::Block as ChainBlock; use ser::{Reader, Stream}; use std::io; +use zebra_chain::Block as ChainBlock; use {MessageResult, Payload}; #[derive(Debug, PartialEq)] diff --git a/message/src/types/headers.rs b/message/src/types/headers.rs index 9d19cabf..5739a1b5 100644 --- a/message/src/types/headers.rs +++ b/message/src/types/headers.rs @@ -1,6 +1,6 @@ -use chain::BlockHeader; use ser::{CompactInteger, Deserializable, Error as ReaderError, Reader, Serializable, Stream}; use std::io; +use zebra_chain::BlockHeader; use {MessageResult, Payload}; pub const HEADERS_MAX_HEADERS_LEN: usize = 160; diff --git a/message/src/types/merkle_block.rs b/message/src/types/merkle_block.rs index ad055165..b13b8ab3 100644 --- a/message/src/types/merkle_block.rs +++ b/message/src/types/merkle_block.rs @@ -1,8 +1,8 @@ use bytes::Bytes; -use chain::BlockHeader; use hash::H256; use ser::{Reader, Stream}; use std::io; +use zebra_chain::BlockHeader; use {MessageResult, Payload}; #[derive(Debug, PartialEq)] diff --git a/message/src/types/tx.rs b/message/src/types/tx.rs index efe19ac7..cdc97b8c 100644 --- a/message/src/types/tx.rs +++ b/message/src/types/tx.rs @@ -1,6 +1,6 @@ -use chain::Transaction; use ser::{Reader, Stream}; use std::io; +use zebra_chain::Transaction; use {MessageResult, Payload}; #[derive(Debug, PartialEq)] diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 78f2efc8..fdca3e63 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -1,24 +1,25 @@ [package] -name = "miner" +name = "zebra-miner" version = "0.1.0" -authors = ["Ethcore "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] byteorder = "1.0" heapsize = "0.4" -bitcrypto = { path = "../crypto" } -chain = { path = "../chain" } -storage = { path = "../storage" } -db = { path = "../db" } -network = { path = "../network" } -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } -verification = { path = "../verification" } -keys = { path = "../keys" } -script = { path = "../script" } +zebra-crypto = { path = "../crypto" } +zebra-chain = { path = "../chain" } +zebra-storage = { path = "../storage" } +zebra-db = { path = "../db" } +zebra-network = { path = "../network" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } +zebra-verification = { path = "../verification" } +zebra-keys = { path = "../keys" } +zebra-script = { path = "../script" } [dev-dependencies] -test-data = { path = "../test-data" } +zebra-test-data = { path = "../test-data" } [features] test-helpers = [] \ No newline at end of file diff --git a/miner/benches/mod.rs b/miner/benches/mod.rs index 7148b46b..9e7eb7cd 100644 --- a/miner/benches/mod.rs +++ b/miner/benches/mod.rs @@ -1,10 +1,10 @@ #![feature(test)] -extern crate chain; -extern crate miner; -extern crate primitives; -extern crate serialization as ser; extern crate test; +extern crate zebra_chain; +extern crate zebra_miner; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; #[cfg(test)] mod benchmarks { diff --git a/miner/src/block_assembler.rs b/miner/src/block_assembler.rs index a323db62..7b1dc8d3 100644 --- a/miner/src/block_assembler.rs +++ b/miner/src/block_assembler.rs @@ -1,16 +1,16 @@ -use chain::{ +use memory_pool::{Entry, MemoryPool, OrderingStrategy}; +use std::collections::HashSet; +use zebra_chain::{ IndexedTransaction, OutPoint, Transaction, TransactionInput, TransactionOutput, SAPLING_TX_VERSION, SAPLING_TX_VERSION_GROUP_ID, }; -use keys::Address; -use memory_pool::{Entry, MemoryPool, OrderingStrategy}; -use network::ConsensusParams; -use primitives::compact::Compact; -use primitives::hash::H256; -use script::Builder; -use std::collections::HashSet; -use storage::{SaplingTreeState, SharedStore, TransactionOutputProvider}; -use verification::{transaction_sigops, work_required}; +use zebra_keys::Address; +use zebra_network::ConsensusParams; +use zebra_primitives::compact::Compact; +use zebra_primitives::hash::H256; +use zebra_script::Builder; +use zebra_storage::{SaplingTreeState, SharedStore, TransactionOutputProvider}; +use zebra_verification::{transaction_sigops, work_required}; const BLOCK_VERSION: u32 = 4; const BLOCK_HEADER_SIZE: u32 = 4 + 32 + 32 + 32 + 4 + 4 + 32 + 1344; @@ -385,18 +385,18 @@ impl<'a> BlockAssembler<'a> { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; - use self::test_data::{ChainBuilder, TransactionBuilder}; + use self::zebra_test_data::{ChainBuilder, TransactionBuilder}; use super::{BlockAssembler, BlockTemplate, NextStep, SizePolicy}; - use chain::IndexedTransaction; - use db::BlockChainDatabase; use fee::{FeeCalculator, NonZeroFeeCalculator}; use memory_pool::MemoryPool; - use network::{ConsensusParams, Network}; - use primitives::hash::H256; use std::sync::Arc; - use storage::SharedStore; + use zebra_chain::IndexedTransaction; + use zebra_db::BlockChainDatabase; + use zebra_network::{ConsensusParams, Network}; + use zebra_primitives::hash::H256; + use zebra_storage::SharedStore; #[test] fn test_size_policy() { @@ -478,7 +478,7 @@ mod tests { let mut pool = MemoryPool::new(); let storage: SharedStore = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); pool.insert_verified(chain.at(0).into(), &NonZeroFeeCalculator); pool.insert_verified(chain.at(1).into(), &NonZeroFeeCalculator); @@ -506,15 +506,15 @@ mod tests { #[test] fn block_assembler_miner_fee() { - let input_tx = test_data::block_h1().transactions[0].clone(); + let input_tx = zebra_test_data::block_h1().transactions[0].clone(); let tx0: IndexedTransaction = TransactionBuilder::with_input(&input_tx, 0) .set_output(10_000) .into(); let expected_tx0_fee = input_tx.outputs[0].value - tx0.raw.total_spends(); let storage: SharedStore = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), - test_data::block_h1().into(), + zebra_test_data::genesis().into(), + zebra_test_data::block_h1().into(), ])); let mut pool = MemoryPool::new(); pool.insert_verified( diff --git a/miner/src/fee.rs b/miner/src/fee.rs index 1ba022e4..5a0eae3d 100644 --- a/miner/src/fee.rs +++ b/miner/src/fee.rs @@ -1,7 +1,7 @@ -use chain::Transaction; use ser::Serializable; -use storage::{DuplexTransactionOutputProvider, TransactionOutputProvider}; -use verification::checked_transaction_fee; +use zebra_chain::Transaction; +use zebra_storage::{DuplexTransactionOutputProvider, TransactionOutputProvider}; +use zebra_verification::checked_transaction_fee; use MemoryPool; /// Transaction fee calculator for memory pool @@ -48,13 +48,13 @@ pub fn transaction_fee_rate(store: &TransactionOutputProvider, tx: &Transaction) #[cfg(test)] mod tests { use super::transaction_fee_rate; - use db::BlockChainDatabase; use std::sync::Arc; - use storage::AsSubstore; + use zebra_db::BlockChainDatabase; + use zebra_storage::AsSubstore; #[test] fn transaction_fee_rate_works() { - let b0 = test_data::block_builder() + let b0 = zebra_test_data::block_builder() .header() .nonce(1.into()) .build() @@ -69,7 +69,7 @@ mod tests { .build(); let tx0 = b0.transactions[0].clone(); let tx0_hash = tx0.hash(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash().clone()) .nonce(2.into()) diff --git a/miner/src/lib.rs b/miner/src/lib.rs index d6aca680..a4c21f89 100644 --- a/miner/src/lib.rs +++ b/miner/src/lib.rs @@ -1,16 +1,16 @@ extern crate byteorder; extern crate heapsize; -extern crate bitcrypto as crypto; -extern crate chain; -extern crate db; -extern crate keys; -extern crate network; -extern crate primitives; -extern crate script; -extern crate serialization as ser; -extern crate storage; -extern crate verification; +extern crate zebra_chain; +extern crate zebra_crypto; +extern crate zebra_db; +extern crate zebra_keys; +extern crate zebra_network; +extern crate zebra_primitives; +extern crate zebra_script; +extern crate zebra_serialization as ser; +extern crate zebra_storage; +extern crate zebra_verification; mod block_assembler; mod fee; diff --git a/miner/src/memory_pool.rs b/miner/src/memory_pool.rs index 1cf4ad7a..9e3201d4 100644 --- a/miner/src/memory_pool.rs +++ b/miner/src/memory_pool.rs @@ -5,11 +5,8 @@ //! transactions. //! It also guarantees that ancestor-descendant relation won't break during ordered removal (ancestors always removed //! before descendants). Removal using `remove_by_hash` can break this rule. -use chain::{IndexedTransaction, OutPoint, Transaction, TransactionOutput}; use fee::MemoryPoolFeeCalculator; use heapsize::HeapSizeOf; -use primitives::bytes::Bytes; -use primitives::hash::H256; use ser::{serialize, Serializable}; use std::cmp::Ordering; use std::collections::BTreeSet; @@ -17,7 +14,10 @@ use std::collections::HashMap; use std::collections::HashSet; use std::collections::VecDeque; use std::hash::{Hash, Hasher}; -use storage::{TransactionOutputProvider, TransactionProvider}; +use zebra_chain::{IndexedTransaction, OutPoint, Transaction, TransactionOutput}; +use zebra_primitives::bytes::Bytes; +use zebra_primitives::hash::H256; +use zebra_storage::{TransactionOutputProvider, TransactionProvider}; /// Transactions ordering strategy #[cfg_attr(feature = "cargo-clippy", allow(enum_variant_names))] @@ -1070,13 +1070,13 @@ impl<'a> Iterator for MemoryPoolIterator<'a> { #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; - use self::test_data::{ChainBuilder, TransactionBuilder}; + use self::zebra_test_data::{ChainBuilder, TransactionBuilder}; use super::{DoubleSpendCheckResult, MemoryPool, OrderingStrategy}; - use chain::{OutPoint, Transaction}; use fee::NonZeroFeeCalculator; use heapsize::HeapSizeOf; + use zebra_chain::{OutPoint, Transaction}; fn to_memory_pool(chain: &mut ChainBuilder) -> MemoryPool { let mut pool = MemoryPool::new(); diff --git a/network/Cargo.toml b/network/Cargo.toml index e26163b6..da29f3f1 100644 --- a/network/Cargo.toml +++ b/network/Cargo.toml @@ -1,13 +1,14 @@ [package] -name = "network" +name = "zebra-network" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] lazy_static = "1.3" -chain = { path = "../chain" } -keys = { path = "../keys" } -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } -bitcrypto = { path = "../crypto" } rustc-hex = "2" +zebra-chain = { path = "../chain" } +zebra-keys = { path = "../keys" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } +zebra-crypto = { path = "../crypto" } diff --git a/network/src/consensus.rs b/network/src/consensus.rs index 4b393d3c..bdcfcbf1 100644 --- a/network/src/consensus.rs +++ b/network/src/consensus.rs @@ -1,15 +1,16 @@ -use keys::Address; -use {crypto, Deployment, Magic, Network}; +use zebra_crypto; +use zebra_keys::Address; +use {Deployment, Magic, Network}; lazy_static! { - static ref SAPLING_SPEND_VK: crypto::Groth16VerifyingKey = - crypto::load_sapling_spend_verifying_key() + static ref SAPLING_SPEND_VK: zebra_crypto::Groth16VerifyingKey = + zebra_crypto::load_sapling_spend_verifying_key() .expect("hardcoded value should load without errors"); - static ref SAPLING_OUTPUT_VK: crypto::Groth16VerifyingKey = - crypto::load_sapling_output_verifying_key() + static ref SAPLING_OUTPUT_VK: zebra_crypto::Groth16VerifyingKey = + zebra_crypto::load_sapling_output_verifying_key() .expect("hardcoded value should load without errors"); - static ref JOINSPLIT_GROTH16_VK: crypto::Groth16VerifyingKey = - crypto::load_joinsplit_groth16_verifying_key() + static ref JOINSPLIT_GROTH16_VK: zebra_crypto::Groth16VerifyingKey = + zebra_crypto::load_joinsplit_groth16_verifying_key() .expect("hardcoded value should load without errors"); } @@ -76,19 +77,19 @@ pub struct ConsensusParams { pub equihash_params: Option<(u32, u32)>, /// Active key for pghr13 joinsplit verification - pub joinsplit_verification_key: crypto::Pghr13VerifyingKey, + pub joinsplit_verification_key: zebra_crypto::Pghr13VerifyingKey, /// Active key for groth16 joinsplit verification - pub joinsplit_groth16_verification_key: &'static crypto::Groth16VerifyingKey, + pub joinsplit_groth16_verification_key: &'static zebra_crypto::Groth16VerifyingKey, /// Sapling spend verification key. - pub sapling_spend_verifying_key: &'static crypto::Groth16VerifyingKey, + pub sapling_spend_verifying_key: &'static zebra_crypto::Groth16VerifyingKey, /// Sapling output verification key. - pub sapling_output_verifying_key: &'static crypto::Groth16VerifyingKey, + pub sapling_output_verifying_key: &'static zebra_crypto::Groth16VerifyingKey, } -fn mainnet_pghr_verification_key() -> crypto::Pghr13VerifyingKey { - crypto::json::pghr13::decode(include_bytes!("../../res/sprout-verifying-key.json")) +fn mainnet_pghr_verification_key() -> zebra_crypto::Pghr13VerifyingKey { + zebra_crypto::json::pghr13::decode(include_bytes!("../../res/sprout-verifying-key.json")) .expect("verifying key json invalid") .into() } diff --git a/network/src/lib.rs b/network/src/lib.rs index 57aad86f..29a11b8c 100644 --- a/network/src/lib.rs +++ b/network/src/lib.rs @@ -1,18 +1,18 @@ #[macro_use] extern crate lazy_static; -extern crate bitcrypto as crypto; -extern crate chain; -extern crate keys; -extern crate primitives; extern crate rustc_hex as hex; -extern crate serialization; +extern crate zebra_chain; +extern crate zebra_crypto; +extern crate zebra_keys; +extern crate zebra_primitives; +extern crate zebra_serialization; mod consensus; mod deployments; mod network; -pub use primitives::{compact, hash}; +pub use zebra_primitives::{compact, hash}; pub use consensus::ConsensusParams; pub use deployments::Deployment; diff --git a/network/src/network.rs b/network/src/network.rs index 7c7bedf6..b5f356b2 100644 --- a/network/src/network.rs +++ b/network/src/network.rs @@ -1,10 +1,10 @@ //! Bitcoin network //! https://www.anintegratedworld.com/unravelling-the-mysterious-block-chain-magic-number/ -use chain::IndexedBlock; use compact::Compact; -use primitives::bigint::U256; -use primitives::hash::H256; +use zebra_chain::IndexedBlock; +use zebra_primitives::bigint::U256; +use zebra_primitives::hash::H256; const ZCASH_MAGIC_MAINNET: u32 = 0x6427e924; const ZCASH_MAGIC_TESTNET: u32 = 0xbff91afa; diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml index e910763e..29c6ec6a 100644 --- a/p2p/Cargo.toml +++ b/p2p/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "p2p" +name = "zebra-p2p" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] tokio-core = "0.1.6" @@ -16,8 +17,8 @@ abstract-ns = "0.3" ns-dns-tokio = "0.3" csv = "1" -primitives = { path = "../primitives" } -bitcrypto = { path = "../crypto" } -message = { path = "../message" } -serialization = { path = "../serialization" } -network = { path = "../network" } +zebra-primitives = { path = "../primitives" } +zebra-crypto = { path = "../crypto" } +zebra-message = { path = "../message" } +zebra-serialization = { path = "../serialization" } +zebra-network = { path = "../network" } diff --git a/p2p/src/config.rs b/p2p/src/config.rs index ac6f7fe7..52c2f6ac 100644 --- a/p2p/src/config.rs +++ b/p2p/src/config.rs @@ -1,7 +1,7 @@ -use message::common::Services; use net::Config as NetConfig; use std::{net, path}; use util::InternetProtocol; +use zebra_message::common::Services; #[derive(Debug, Clone)] pub struct Config { diff --git a/p2p/src/io/handshake.rs b/p2p/src/io/handshake.rs index cdafae62..6fbda950 100644 --- a/p2p/src/io/handshake.rs +++ b/p2p/src/io/handshake.rs @@ -1,10 +1,10 @@ use futures::{Async, Future, Poll}; use io::{read_message, write_message, ReadMessage, WriteMessage}; -use message::types::{Verack, Version}; -use message::{Error, Message, MessageResult}; -use network::Magic; use std::{cmp, io}; use tokio_io::{AsyncRead, AsyncWrite}; +use zebra_message::types::{Verack, Version}; +use zebra_message::{Error, Message, MessageResult}; +use zebra_network::Magic; pub fn handshake(a: A, magic: Magic, version: Version, min_version: u32) -> Handshake where @@ -241,13 +241,13 @@ mod tests { use super::{accept_handshake, handshake, HandshakeResult}; use bytes::Bytes; use futures::{Future, Poll}; - use message::types::version::{Version, V0, V106, V70001}; - use message::types::Verack; - use message::{Error, Message}; - use network::Network; use ser::Stream; use std::io; use tokio_io::{AsyncRead, AsyncWrite}; + use zebra_message::types::version::{Version, V0, V106, V70001}; + use zebra_message::types::Verack; + use zebra_message::{Error, Message}; + use zebra_network::Network; pub struct TestIo { read: io::Cursor, diff --git a/p2p/src/io/read_any_message.rs b/p2p/src/io/read_any_message.rs index 44e94c3e..f94c5aaf 100644 --- a/p2p/src/io/read_any_message.rs +++ b/p2p/src/io/read_any_message.rs @@ -1,12 +1,12 @@ use bytes::Bytes; -use crypto::checksum; use futures::{Async, Future, Poll}; use io::{read_header, ReadHeader}; -use message::{Command, Error, MessageHeader, MessageResult}; -use network::Magic; use std::io; use tokio_io::io::{read_exact, ReadExact}; use tokio_io::AsyncRead; +use zebra_crypto::checksum; +use zebra_message::{Command, Error, MessageHeader, MessageResult}; +use zebra_network::Magic; pub fn read_any_message(a: A, magic: Magic) -> ReadAnyMessage where @@ -73,8 +73,8 @@ mod tests { use super::read_any_message; use bytes::Bytes; use futures::Future; - use message::Error; - use network::Network; + use zebra_message::Error; + use zebra_network::Network; #[test] fn test_read_any_message() { diff --git a/p2p/src/io/read_header.rs b/p2p/src/io/read_header.rs index 38b288fa..93abb16f 100644 --- a/p2p/src/io/read_header.rs +++ b/p2p/src/io/read_header.rs @@ -1,9 +1,9 @@ use futures::{Async, Future, Poll}; -use message::{MessageHeader, MessageResult}; -use network::Magic; use std::io; use tokio_io::io::{read_exact, ReadExact}; use tokio_io::AsyncRead; +use zebra_message::{MessageHeader, MessageResult}; +use zebra_network::Magic; pub fn read_header(a: A, magic: Magic) -> ReadHeader where @@ -39,8 +39,8 @@ mod tests { use super::read_header; use bytes::Bytes; use futures::Future; - use message::{Error, MessageHeader}; - use network::Network; + use zebra_message::{Error, MessageHeader}; + use zebra_network::Network; #[test] fn test_read_header() { diff --git a/p2p/src/io/read_message.rs b/p2p/src/io/read_message.rs index dfa651e8..e89ec9e0 100644 --- a/p2p/src/io/read_message.rs +++ b/p2p/src/io/read_message.rs @@ -1,10 +1,10 @@ use futures::{Async, Future, Poll}; use io::{read_header, read_payload, ReadHeader, ReadPayload}; -use message::{Error, MessageResult, Payload}; -use network::Magic; use std::io; use std::marker::PhantomData; use tokio_io::AsyncRead; +use zebra_message::{Error, MessageResult, Payload}; +use zebra_network::Magic; pub fn read_message(a: A, magic: Magic, version: u32) -> ReadMessage where @@ -72,9 +72,9 @@ mod tests { use super::read_message; use bytes::Bytes; use futures::Future; - use message::types::{Ping, Pong}; - use message::Error; - use network::Network; + use zebra_message::types::{Ping, Pong}; + use zebra_message::Error; + use zebra_network::Network; #[test] fn test_read_message() { diff --git a/p2p/src/io/read_payload.rs b/p2p/src/io/read_payload.rs index fc41a9e0..e01ac1f2 100644 --- a/p2p/src/io/read_payload.rs +++ b/p2p/src/io/read_payload.rs @@ -1,12 +1,12 @@ use bytes::Bytes; -use crypto::checksum; use futures::{Future, Poll}; use hash::H32; -use message::{deserialize_payload, Error, MessageResult, Payload}; use std::io; use std::marker::PhantomData; use tokio_io::io::{read_exact, ReadExact}; use tokio_io::AsyncRead; +use zebra_crypto::checksum; +use zebra_message::{deserialize_payload, Error, MessageResult, Payload}; pub fn read_payload(a: A, version: u32, len: usize, checksum: H32) -> ReadPayload where @@ -51,8 +51,8 @@ mod tests { use super::read_payload; use bytes::Bytes; use futures::Future; - use message::types::Ping; - use message::Error; + use zebra_message::types::Ping; + use zebra_message::Error; #[test] fn test_read_payload() { diff --git a/p2p/src/io/write_message.rs b/p2p/src/io/write_message.rs index 749ee109..06333660 100644 --- a/p2p/src/io/write_message.rs +++ b/p2p/src/io/write_message.rs @@ -1,8 +1,8 @@ use futures::{Future, Poll}; -use message::Message; use std::io; use tokio_io::io::{write_all, WriteAll}; use tokio_io::AsyncWrite; +use zebra_message::Message; pub fn write_message(a: A, message: Message) -> WriteMessage where diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs index 95c7aa04..927aa5a2 100644 --- a/p2p/src/lib.rs +++ b/p2p/src/lib.rs @@ -12,11 +12,11 @@ extern crate abstract_ns; extern crate csv; extern crate ns_dns_tokio; -extern crate bitcrypto as crypto; -extern crate message; -extern crate network; -extern crate primitives; -extern crate serialization as ser; +extern crate zebra_crypto; +extern crate zebra_message; +extern crate zebra_network; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; mod config; mod event_loop; @@ -27,7 +27,7 @@ mod protocol; mod session; mod util; -pub use primitives::{bytes, hash}; +pub use zebra_primitives::{bytes, hash}; pub use config::Config; pub use event_loop::{event_loop, forever}; diff --git a/p2p/src/net/accept_connection.rs b/p2p/src/net/accept_connection.rs index a93baa3f..c8bbed04 100644 --- a/p2p/src/net/accept_connection.rs +++ b/p2p/src/net/accept_connection.rs @@ -1,12 +1,12 @@ use futures::{Future, Poll}; use io::{accept_handshake, deadline, AcceptHandshake, Deadline}; -use message::MessageResult; use net::{Config, Connection}; -use network::Magic; use std::time::Duration; use std::{io, net}; use tokio_core::net::TcpStream; use tokio_core::reactor::Handle; +use zebra_message::MessageResult; +use zebra_network::Magic; pub fn accept_connection( stream: TcpStream, diff --git a/p2p/src/net/config.rs b/p2p/src/net/config.rs index 0639cf72..89c6a11e 100644 --- a/p2p/src/net/config.rs +++ b/p2p/src/net/config.rs @@ -1,9 +1,9 @@ -use message::common::{NetAddress, Services}; -use message::types::version::{Version, V0, V106, V70001}; -use network::Magic; use std::net::SocketAddr; use util::nonce::{NonceGenerator, RandomNonce}; use util::time::{RealTime, Time}; +use zebra_message::common::{NetAddress, Services}; +use zebra_message::types::version::{Version, V0, V106, V70001}; +use zebra_network::Magic; #[derive(Debug, Clone)] pub struct Config { diff --git a/p2p/src/net/connect.rs b/p2p/src/net/connect.rs index 8d957108..7c7754be 100644 --- a/p2p/src/net/connect.rs +++ b/p2p/src/net/connect.rs @@ -1,14 +1,14 @@ use futures::{Async, Future, Poll}; use io::{deadline, handshake, Deadline, Handshake}; -use message::types::Version; -use message::Error; use net::{Config, Connection}; -use network::Magic; use std::io; use std::net::SocketAddr; use std::time::Duration; use tokio_core::net::{TcpStream, TcpStreamNew}; use tokio_core::reactor::Handle; +use zebra_message::types::Version; +use zebra_message::Error; +use zebra_network::Magic; pub fn connect(address: &SocketAddr, handle: &Handle, config: &Config) -> Deadline { let connect = Connect { diff --git a/p2p/src/net/connection.rs b/p2p/src/net/connection.rs index 42cdd1df..547b7077 100644 --- a/p2p/src/net/connection.rs +++ b/p2p/src/net/connection.rs @@ -1,8 +1,8 @@ use io::SharedTcpStream; -use message::common::Services; -use message::types; -use network::Magic; use std::net; +use zebra_message::common::Services; +use zebra_message::types; +use zebra_network::Magic; pub struct Connection { pub stream: SharedTcpStream, diff --git a/p2p/src/net/peer_context.rs b/p2p/src/net/peer_context.rs index a097710c..559e785d 100644 --- a/p2p/src/net/peer_context.rs +++ b/p2p/src/net/peer_context.rs @@ -1,10 +1,10 @@ use futures::{finished, lazy}; -use message::{Message, Payload}; use net::PeerStats; use p2p::Context; use parking_lot::Mutex; use std::sync::Arc; use util::{ConfigurableSynchronizer, PeerInfo, ResponseQueue, Responses, Synchronizer}; +use zebra_message::{Message, Payload}; pub struct PeerContext { context: Arc, diff --git a/p2p/src/net/stats.rs b/p2p/src/net/stats.rs index 10190f87..1263e785 100644 --- a/p2p/src/net/stats.rs +++ b/p2p/src/net/stats.rs @@ -3,8 +3,8 @@ use std::collections::HashMap; use std::time::Instant; use util::interval::{Interval, RealInterval}; -use message::types::{Ping, Pong}; -use message::{Command, Payload}; +use zebra_message::types::{Ping, Pong}; +use zebra_message::{Command, Payload}; // delay somewhere near communication timeout const ENORMOUS_PING_DELAY: f64 = 10f64; diff --git a/p2p/src/p2p.rs b/p2p/src/p2p.rs index 2258be2c..14f6bc2f 100644 --- a/p2p/src/p2p.rs +++ b/p2p/src/p2p.rs @@ -3,9 +3,6 @@ use futures::stream::Stream; use futures::{failed, finished, Future}; use futures_cpupool::{Builder as CpuPoolBuilder, CpuPool}; use io::DeadlineStatus; -use message::common::Services; -use message::types::addr::AddressEntry; -use message::{Message, MessageResult, Payload}; use net::{ accept_connection, connect, Channel, Config as NetConfig, ConnectionCounter, Connections, }; @@ -20,6 +17,9 @@ use tokio_core::net::{TcpListener, TcpStream}; use tokio_core::reactor::{Handle, Interval, Remote, Timeout}; use tokio_io::IoFuture; use util::{Direction, Node, NodeTable, NodeTableError}; +use zebra_message::common::Services; +use zebra_message::types::addr::AddressEntry; +use zebra_message::{Message, MessageResult, Payload}; use {Config, PeerId}; pub type BoxedEmptyFuture = Box + Send>; diff --git a/p2p/src/protocol/addr.rs b/p2p/src/protocol/addr.rs index cc080795..1cf30b4a 100644 --- a/p2p/src/protocol/addr.rs +++ b/p2p/src/protocol/addr.rs @@ -1,11 +1,11 @@ use bytes::Bytes; -use message::types::{Addr, GetAddr}; -use message::{deserialize_payload, Command, Error, Payload}; use net::PeerContext; use protocol::Protocol; use std::sync::Arc; use std::time::Duration; use util::Direction; +use zebra_message::types::{Addr, GetAddr}; +use zebra_message::{deserialize_payload, Command, Error, Payload}; pub struct AddrProtocol { /// Context diff --git a/p2p/src/protocol/mod.rs b/p2p/src/protocol/mod.rs index e9c2e9f5..3baac993 100644 --- a/p2p/src/protocol/mod.rs +++ b/p2p/src/protocol/mod.rs @@ -3,8 +3,8 @@ mod ping; mod sync; use bytes::Bytes; -use message::common::Command; -use message::Error; +use zebra_message::common::Command; +use zebra_message::Error; pub use self::addr::{AddrProtocol, SeednodeProtocol}; pub use self::ping::PingProtocol; diff --git a/p2p/src/protocol/ping.rs b/p2p/src/protocol/ping.rs index dfc10184..b0c33cdf 100644 --- a/p2p/src/protocol/ping.rs +++ b/p2p/src/protocol/ping.rs @@ -1,12 +1,12 @@ use bytes::Bytes; -use message::common::Command; -use message::types::{Ping, Pong}; -use message::{deserialize_payload, Error, Payload}; use net::PeerContext; use protocol::Protocol; use std::sync::Arc; use time; use util::nonce::{NonceGenerator, RandomNonce}; +use zebra_message::common::Command; +use zebra_message::types::{Ping, Pong}; +use zebra_message::{deserialize_payload, Error, Payload}; /// Time that must pass since last message from this peer, before we send ping request const PING_INTERVAL_S: f64 = 60f64; diff --git a/p2p/src/protocol/sync.rs b/p2p/src/protocol/sync.rs index 8c809030..aa0ddb13 100644 --- a/p2p/src/protocol/sync.rs +++ b/p2p/src/protocol/sync.rs @@ -1,8 +1,8 @@ use bytes::Bytes; -use message::{deserialize_payload, types, Command, Error, Payload, Services}; use net::PeerContext; use protocol::Protocol; use std::sync::Arc; +use zebra_message::{deserialize_payload, types, Command, Error, Payload, Services}; pub type InboundSyncConnectionRef = Box; pub type OutboundSyncConnectionRef = Arc; diff --git a/p2p/src/session.rs b/p2p/src/session.rs index 5392fca1..1baf4acc 100644 --- a/p2p/src/session.rs +++ b/p2p/src/session.rs @@ -1,11 +1,11 @@ use bytes::Bytes; -use message::{Command, Error}; use net::{PeerContext, PeerStats}; use p2p::Context; use parking_lot::Mutex; use protocol::{AddrProtocol, PingProtocol, Protocol, SeednodeProtocol, SyncProtocol}; use std::sync::Arc; use util::PeerInfo; +use zebra_message::{Command, Error}; pub trait SessionFactory { fn new_session(context: Arc, info: PeerInfo, synchronous: bool) -> Session; diff --git a/p2p/src/util/node_table.rs b/p2p/src/util/node_table.rs index 9a9d9598..14e9b620 100644 --- a/p2p/src/util/node_table.rs +++ b/p2p/src/util/node_table.rs @@ -1,6 +1,4 @@ use csv; -use message::common::{NetAddress, Services}; -use message::types::addr::AddressEntry; use std::cmp::{Ord, Ordering, PartialOrd}; use std::collections::hash_map::Entry; use std::collections::{BTreeSet, HashMap, HashSet}; @@ -8,6 +6,8 @@ use std::net::SocketAddr; use std::{fs, io, net, path}; use util::time::{RealTime, Time}; use util::InternetProtocol; +use zebra_message::common::{NetAddress, Services}; +use zebra_message::types::addr::AddressEntry; #[derive(Debug, PartialEq, Eq, Clone)] pub struct Node { @@ -462,11 +462,11 @@ where #[cfg(test)] mod tests { use super::NodeTable; - use message::common::Services; use std::collections::HashSet; use std::net::SocketAddr; use util::time::{IncrementalTime, ZeroTime}; use util::InternetProtocol; + use zebra_message::common::Services; #[test] fn test_node_table_insert() { diff --git a/p2p/src/util/peer.rs b/p2p/src/util/peer.rs index b7f20117..ea677df3 100644 --- a/p2p/src/util/peer.rs +++ b/p2p/src/util/peer.rs @@ -1,6 +1,6 @@ -use message::types; -use network::Magic; use std::net::SocketAddr; +use zebra_message::types; +use zebra_network::Magic; pub type PeerId = usize; diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 09e219e0..055907bc 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "primitives" +name = "zebra-primitives" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] heapsize = "0.4" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 23022615..791819fb 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "rpc" +name = "zebra-rpc" version = "0.1.0" -authors = ["Ethcore "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [lib] @@ -18,18 +19,18 @@ jsonrpc-derive = "10.0" jsonrpc-pubsub = "10.0" jsonrpc-http-server = "10.0" -sync = { path = "../sync" } -serialization = { path = "../serialization" } -chain = { path = "../chain" } -primitives = { path = "../primitives" } -p2p = { path = "../p2p" } -network = { path = "../network" } -storage = { path = "../storage" } -db = { path = "../db" } -miner = { path = "../miner" } -verification = { path = "../verification" } -script = { path = "../script" } -keys = { path = "../keys" } +zebra-sync = { path = "../sync" } +zebra-serialization = { path = "../serialization" } +zebra-chain = { path = "../chain" } +zebra-primitives = { path = "../primitives" } +zebra-p2p = { path = "../p2p" } +zebra-network = { path = "../network" } +zebra-storage = { path = "../storage" } +zebra-db = { path = "../db" } +zebra-miner = { path = "../miner" } +zebra-verification = { path = "../verification" } +zebra-script = { path = "../script" } +zebra-keys = { path = "../keys" } [dev-dependencies] -test-data = { path = "../test-data" } +zebra-test-data = { path = "../test-data" } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 6dffc656..a25a3fee 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -7,21 +7,21 @@ extern crate serde_derive; extern crate jsonrpc_core; #[macro_use] extern crate jsonrpc_derive; -extern crate chain; -extern crate db; extern crate jsonrpc_http_server; -extern crate keys; -extern crate miner; -extern crate network; -extern crate p2p; -extern crate primitives; -extern crate script as global_script; -extern crate serialization as ser; -extern crate storage; -extern crate sync; extern crate time; extern crate tokio_core; -extern crate verification; +extern crate zebra_chain; +extern crate zebra_db; +extern crate zebra_keys; +extern crate zebra_miner; +extern crate zebra_network; +extern crate zebra_p2p; +extern crate zebra_primitives; +extern crate zebra_script as global_script; +extern crate zebra_serialization as ser; +extern crate zebra_storage; +extern crate zebra_sync; +extern crate zebra_verification; pub mod rpc_server; pub mod v1; diff --git a/rpc/src/v1/impls/blockchain.rs b/rpc/src/v1/impls/blockchain.rs index bf216de0..201dede5 100644 --- a/rpc/src/v1/impls/blockchain.rs +++ b/rpc/src/v1/impls/blockchain.rs @@ -1,11 +1,6 @@ -use chain::OutPoint; use global_script::Script; use jsonrpc_core::Error; -use keys::{self, Address}; -use network::{ConsensusParams, Network}; -use primitives::hash::H256 as GlobalH256; use ser::serialize; -use storage; use v1::helpers::errors::{ block_at_height_not_found, block_not_found, invalid_params, transaction_not_found, transaction_of_side_branch, transaction_output_not_found, @@ -15,7 +10,12 @@ use v1::types::GetTxOutSetInfoResponse; use v1::types::H256; use v1::types::{BlockRef, GetBlockResponse, RawBlock, VerboseBlock}; use v1::types::{GetTxOutResponse, TransactionOutputScript}; -use verification; +use zebra_chain::OutPoint; +use zebra_keys::{self, Address}; +use zebra_network::{ConsensusParams, Network}; +use zebra_primitives::hash::H256 as GlobalH256; +use zebra_storage; +use zebra_verification; pub struct BlockChainClient { core: T, @@ -33,11 +33,11 @@ pub trait BlockChainClientCoreApi: Send + Sync + 'static { pub struct BlockChainClientCore { consensus: ConsensusParams, - storage: storage::SharedStore, + storage: zebra_storage::SharedStore, } impl BlockChainClientCore { - pub fn new(consensus: ConsensusParams, storage: storage::SharedStore) -> Self { + pub fn new(consensus: ConsensusParams, storage: zebra_storage::SharedStore) -> Self { BlockChainClientCore { consensus: consensus, storage: storage, @@ -62,7 +62,7 @@ impl BlockChainClientCoreApi for BlockChainClientCore { let best_block = self.storage.best_block(); let now = ::time::get_time().sec as u32; - let next_work_required = verification::work_required( + let next_work_required = zebra_verification::work_required( best_block.hash, now, best_block.number + 1, @@ -163,10 +163,10 @@ impl BlockChainClientCoreApi for BlockChainClientCore { .into_iter() .map(|a| Address { network: match self.consensus.network { - Network::Mainnet => keys::Network::Mainnet, + Network::Mainnet => zebra_keys::Network::Mainnet, // there's no correct choices for Regtests && Other networks // => let's just make Testnet key - _ => keys::Network::Testnet, + _ => zebra_keys::Network::Testnet, }, hash: a.hash, kind: a.kind, @@ -280,16 +280,11 @@ where #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::*; - use chain::OutPoint; - use db::BlockChainDatabase; use jsonrpc_core::Error; use jsonrpc_core::IoHandler; - use network::Network; - use primitives::bytes::Bytes as GlobalBytes; - use primitives::hash::H256 as GlobalH256; use std::sync::Arc; use v1::helpers::errors::block_not_found; use v1::traits::BlockChain; @@ -298,6 +293,11 @@ pub mod tests { use v1::types::H256; use v1::types::{GetTxOutResponse, TransactionOutputScript}; use v1::types::{RawBlock, VerboseBlock}; + use zebra_chain::OutPoint; + use zebra_db::BlockChainDatabase; + use zebra_network::Network; + use zebra_primitives::bytes::Bytes as GlobalBytes; + use zebra_primitives::hash::H256 as GlobalH256; #[derive(Default)] struct SuccessBlockChainClientCore; @@ -306,7 +306,7 @@ pub mod tests { impl BlockChainClientCoreApi for SuccessBlockChainClientCore { fn best_block_hash(&self) -> GlobalH256 { - test_data::genesis().hash() + zebra_test_data::genesis().hash() } fn block_count(&self) -> u32 { @@ -314,7 +314,7 @@ pub mod tests { } fn block_hash(&self, _height: u32) -> Option { - Some(test_data::genesis().hash()) + Some(zebra_test_data::genesis().hash()) } fn difficulty(&self) -> f64 { @@ -375,7 +375,7 @@ pub mod tests { impl BlockChainClientCoreApi for ErrorBlockChainClientCore { fn best_block_hash(&self) -> GlobalH256 { - test_data::genesis().hash() + zebra_test_data::genesis().hash() } fn block_count(&self) -> u32 { @@ -511,9 +511,9 @@ pub mod tests { #[test] fn verbose_block_contents() { let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), - test_data::block_h1().into(), - test_data::block_h2().into(), + zebra_test_data::genesis().into(), + zebra_test_data::block_h1().into(), + zebra_test_data::block_h2().into(), ])); let core = BlockChainClientCore::new(ConsensusParams::new(Network::Mainnet), storage); @@ -683,8 +683,8 @@ pub mod tests { #[test] fn verbose_transaction_out_contents() { let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), - test_data::block_h1().into(), + zebra_test_data::genesis().into(), + zebra_test_data::block_h1().into(), ])); let core = BlockChainClientCore::new(ConsensusParams::new(Network::Mainnet), storage); diff --git a/rpc/src/v1/impls/miner.rs b/rpc/src/v1/impls/miner.rs index 2e84cd2a..36567acf 100644 --- a/rpc/src/v1/impls/miner.rs +++ b/rpc/src/v1/impls/miner.rs @@ -1,26 +1,26 @@ use jsonrpc_core::Error; -use keys::Address; -use miner; -use sync; use v1::helpers::errors::execution; use v1::traits::Miner; use v1::types::{BlockTemplate, BlockTemplateRequest}; +use zebra_keys::Address; +use zebra_miner; +use zebra_sync; pub struct MinerClient { core: T, } pub trait MinerClientCoreApi: Send + Sync + 'static { - fn get_block_template(&self) -> Result; + fn get_block_template(&self) -> Result; } pub struct MinerClientCore { - local_sync_node: sync::LocalNodeRef, + local_sync_node: zebra_sync::LocalNodeRef, miner_address: Option
, } impl MinerClientCore { - pub fn new(local_sync_node: sync::LocalNodeRef, miner_address: Option
) -> Self { + pub fn new(local_sync_node: zebra_sync::LocalNodeRef, miner_address: Option
) -> Self { MinerClientCore { local_sync_node: local_sync_node, miner_address: miner_address, @@ -29,7 +29,7 @@ impl MinerClientCore { } impl MinerClientCoreApi for MinerClientCore { - fn get_block_template(&self) -> Result { + fn get_block_template(&self) -> Result { self.miner_address .as_ref() .ok_or_else(|| "miner address not set".into()) @@ -61,19 +61,19 @@ where #[cfg(test)] pub mod tests { use super::*; - use chain; use jsonrpc_core::IoHandler; - use miner; - use primitives::hash::H256; use v1::traits::Miner; + use zebra_chain; + use zebra_miner; + use zebra_primitives::hash::H256; #[derive(Default)] struct SuccessMinerClientCore; impl MinerClientCoreApi for SuccessMinerClientCore { - fn get_block_template(&self) -> Result { - let tx: chain::Transaction = "00000000013ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a0000000000000000000101000000000000000000000000".into(); - Ok(miner::BlockTemplate { + fn get_block_template(&self) -> Result { + let tx: zebra_chain::Transaction = "00000000013ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a0000000000000000000101000000000000000000000000".into(); + Ok(zebra_miner::BlockTemplate { version: 777, previous_header_hash: H256::from(1), final_sapling_root_hash: H256::from(2), diff --git a/rpc/src/v1/impls/network.rs b/rpc/src/v1/impls/network.rs index d28b134a..e9ba5d49 100644 --- a/rpc/src/v1/impls/network.rs +++ b/rpc/src/v1/impls/network.rs @@ -1,16 +1,16 @@ use jsonrpc_core::Error; -use p2p; use std::net::{IpAddr, SocketAddr}; use std::sync::Arc; use v1::helpers::errors; use v1::traits::Network as NetworkRpc; use v1::types::{AddNodeOperation, NodeInfo}; +use zebra_p2p; pub trait NetworkApi: Send + Sync + 'static { - fn add_node(&self, socket_addr: SocketAddr) -> Result<(), p2p::NodeTableError>; - fn remove_node(&self, socket_addr: SocketAddr) -> Result<(), p2p::NodeTableError>; + fn add_node(&self, socket_addr: SocketAddr) -> Result<(), zebra_p2p::NodeTableError>; + fn remove_node(&self, socket_addr: SocketAddr) -> Result<(), zebra_p2p::NodeTableError>; fn connect(&self, socket_addr: SocketAddr); - fn node_info(&self, node_addr: IpAddr) -> Result; + fn node_info(&self, node_addr: IpAddr) -> Result; fn nodes_info(&self) -> Vec; fn connection_count(&self) -> usize; } @@ -77,38 +77,38 @@ where } pub struct NetworkClientCore { - p2p: Arc, + p2p: Arc, } impl NetworkClientCore { - pub fn new(p2p: Arc) -> Self { + pub fn new(p2p: Arc) -> Self { NetworkClientCore { p2p: p2p } } } impl NetworkApi for NetworkClientCore { - fn add_node(&self, socket_addr: SocketAddr) -> Result<(), p2p::NodeTableError> { + fn add_node(&self, socket_addr: SocketAddr) -> Result<(), zebra_p2p::NodeTableError> { self.p2p.add_node(socket_addr) } - fn remove_node(&self, socket_addr: SocketAddr) -> Result<(), p2p::NodeTableError> { + fn remove_node(&self, socket_addr: SocketAddr) -> Result<(), zebra_p2p::NodeTableError> { self.p2p.remove_node(socket_addr) } fn connect(&self, socket_addr: SocketAddr) { - p2p::Context::connect_normal(self.p2p.clone(), socket_addr); + zebra_p2p::Context::connect_normal(self.p2p.clone(), socket_addr); } - fn node_info(&self, node_addr: IpAddr) -> Result { + fn node_info(&self, node_addr: IpAddr) -> Result { let exact_node = try!(self .p2p .nodes() .iter() .find(|n| n.address().ip() == node_addr) .cloned() - .ok_or(p2p::NodeTableError::NoAddressInTable)); + .ok_or(zebra_p2p::NodeTableError::NoAddressInTable)); - let peers: Vec = self + let peers: Vec = self .p2p .connections() .info() @@ -124,13 +124,13 @@ impl NetworkApi for NetworkClientCore { } fn nodes_info(&self) -> Vec { - let peers: Vec = self.p2p.connections().info(); + let peers: Vec = self.p2p.connections().info(); self.p2p .nodes() .iter() .map(|n| { - let node_peers: Vec = peers + let node_peers: Vec = peers .iter() .filter(|p| p.address == n.address()) .cloned() diff --git a/rpc/src/v1/impls/raw.rs b/rpc/src/v1/impls/raw.rs index dc4b9fe1..d4567e26 100644 --- a/rpc/src/v1/impls/raw.rs +++ b/rpc/src/v1/impls/raw.rs @@ -1,12 +1,5 @@ -use chain::{ - IndexedTransaction as GlobalIndexedTransaction, Transaction as GlobalTransaction, - SAPLING_TX_VERSION, SAPLING_TX_VERSION_GROUP_ID, -}; use jsonrpc_core::Error; -use primitives::bytes::Bytes as GlobalBytes; -use primitives::hash::H256 as GlobalH256; use ser::{deserialize, serialize, Reader}; -use sync; use v1::helpers::errors::{execution, invalid_params}; use v1::traits::Raw; use v1::types::H256; @@ -14,6 +7,13 @@ use v1::types::{ GetRawTransactionResponse, RawTransaction, Transaction, TransactionInput, TransactionOutput, TransactionOutputs, }; +use zebra_chain::{ + IndexedTransaction as GlobalIndexedTransaction, Transaction as GlobalTransaction, + SAPLING_TX_VERSION, SAPLING_TX_VERSION_GROUP_ID, +}; +use zebra_primitives::bytes::Bytes as GlobalBytes; +use zebra_primitives::hash::H256 as GlobalH256; +use zebra_sync; /// Default expiry height delta (best blocks number + height in blocks) for transactions /// created by `createrawtransaction` RPC. @@ -35,11 +35,11 @@ pub trait RawClientCoreApi: Send + Sync + 'static { } pub struct RawClientCore { - local_sync_node: sync::LocalNodeRef, + local_sync_node: zebra_sync::LocalNodeRef, } impl RawClientCore { - pub fn new(local_sync_node: sync::LocalNodeRef) -> Self { + pub fn new(local_sync_node: zebra_sync::LocalNodeRef) -> Self { RawClientCore { local_sync_node: local_sync_node, } @@ -61,9 +61,9 @@ impl RawClientCore { // to make lock_time work at least one input must have sequence < SEQUENCE_FINAL let lock_time = lock_time.unwrap_or_default(); let default_sequence = if lock_time != 0 { - chain::constants::SEQUENCE_FINAL - 1 + zebra_chain::constants::SEQUENCE_FINAL - 1 } else { - chain::constants::SEQUENCE_FINAL + zebra_chain::constants::SEQUENCE_FINAL }; // by default we're creating transactions that are expired in DEFAULT_TX_EXPIRY_DELTA blocks @@ -73,8 +73,8 @@ impl RawClientCore { // prepare inputs let inputs: Vec<_> = inputs .into_iter() - .map(|input| chain::TransactionInput { - previous_output: chain::OutPoint { + .map(|input| zebra_chain::TransactionInput { + previous_output: zebra_chain::OutPoint { hash: Into::::into(input.txid).reversed(), index: input.vout, }, @@ -89,14 +89,19 @@ impl RawClientCore { .into_iter() .map(|output| match output { TransactionOutput::Address(with_address) => { - let amount_in_satoshis = - (with_address.amount * (chain::constants::SATOSHIS_IN_COIN as f64)) as u64; + let amount_in_satoshis = (with_address.amount + * (zebra_chain::constants::SATOSHIS_IN_COIN as f64)) + as u64; let script = match with_address.address.kind { - keys::Type::P2PKH => ScriptBuilder::build_p2pkh(&with_address.address.hash), - keys::Type::P2SH => ScriptBuilder::build_p2sh(&with_address.address.hash), + zebra_keys::Type::P2PKH => { + ScriptBuilder::build_p2pkh(&with_address.address.hash) + } + zebra_keys::Type::P2SH => { + ScriptBuilder::build_p2sh(&with_address.address.hash) + } }; - chain::TransactionOutput { + zebra_chain::TransactionOutput { value: amount_in_satoshis, script_pubkey: script.to_bytes(), } @@ -106,7 +111,7 @@ impl RawClientCore { .return_bytes(&*with_script_data.script_data) .into_script(); - chain::TransactionOutput { + zebra_chain::TransactionOutput { value: 0, script_pubkey: script.to_bytes(), } @@ -217,11 +222,11 @@ where #[cfg(test)] pub mod tests { use super::*; - use chain::Transaction; use jsonrpc_core::IoHandler; - use primitives::hash::H256 as GlobalH256; use v1::traits::Raw; use v1::types::{TransactionInput, TransactionOutputs}; + use zebra_chain::Transaction; + use zebra_primitives::hash::H256 as GlobalH256; #[derive(Default)] struct SuccessRawClientCore; diff --git a/rpc/src/v1/types/address.rs b/rpc/src/v1/types/address.rs index 64982a3e..48591cfd 100644 --- a/rpc/src/v1/types/address.rs +++ b/rpc/src/v1/types/address.rs @@ -1,7 +1,7 @@ -use keys::Address; use serde::de::{Unexpected, Visitor}; use serde::{Deserializer, Serialize, Serializer}; use std::fmt; +use zebra_keys::Address; pub fn serialize(address: &Address, serializer: S) -> Result where @@ -39,9 +39,9 @@ impl<'b> Visitor<'b> for AddressVisitor { pub mod vec { use super::AddressVisitor; - use keys::Address; use serde::de::Visitor; use serde::{Deserialize, Deserializer, Serialize, Serializer}; + use zebra_keys::Address; pub fn serialize(addresses: &Vec
, serializer: S) -> Result where @@ -67,9 +67,9 @@ pub mod vec { #[cfg(test)] mod tests { - use keys::Address; use serde_json; use v1::types; + use zebra_keys::Address; #[derive(Debug, PartialEq, Serialize, Deserialize)] struct TestStruct { diff --git a/rpc/src/v1/types/block_template.rs b/rpc/src/v1/types/block_template.rs index 4bc74ab9..f172f027 100644 --- a/rpc/src/v1/types/block_template.rs +++ b/rpc/src/v1/types/block_template.rs @@ -1,7 +1,7 @@ use super::hash::H256; use super::transaction::RawTransaction; -use chain; -use miner; +use zebra_chain; +use zebra_miner; /// Block template as described in: /// https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki @@ -57,8 +57,8 @@ pub struct BlockTemplateTransaction { pub required: bool, } -impl From for BlockTemplate { - fn from(block: miner::BlockTemplate) -> Self { +impl From for BlockTemplate { + fn from(block: zebra_miner::BlockTemplate) -> Self { BlockTemplate { version: block.version, previousblockhash: block.previous_header_hash.reversed().into(), @@ -74,8 +74,8 @@ impl From for BlockTemplate { } } -impl From for BlockTemplateTransaction { - fn from(transaction: chain::IndexedTransaction) -> Self { +impl From for BlockTemplateTransaction { + fn from(transaction: zebra_chain::IndexedTransaction) -> Self { use ser::serialize; let serialize = serialize(&transaction.raw); BlockTemplateTransaction { diff --git a/rpc/src/v1/types/bytes.rs b/rpc/src/v1/types/bytes.rs index de308244..25109663 100644 --- a/rpc/src/v1/types/bytes.rs +++ b/rpc/src/v1/types/bytes.rs @@ -1,9 +1,9 @@ use hex::{FromHex, ToHex}; -use primitives::bytes::Bytes as GlobalBytes; use serde::de::{Error, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; ///! Serializable wrapper around vector of bytes use std::{fmt, ops}; +use zebra_primitives::bytes::Bytes as GlobalBytes; /// Wrapper structure around vector of bytes. #[derive(Debug, PartialEq, Eq, Default, Hash, Clone)] diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs index ac3af74b..42bf5c56 100644 --- a/rpc/src/v1/types/hash.rs +++ b/rpc/src/v1/types/hash.rs @@ -1,12 +1,12 @@ use hex::{FromHex, ToHex}; -use primitives::hash::H160 as GlobalH160; -use primitives::hash::H256 as GlobalH256; use serde; use serde::de::Unexpected; use std::cmp::Ordering; use std::fmt; use std::hash::{Hash, Hasher}; use std::str::FromStr; +use zebra_primitives::hash::H160 as GlobalH160; +use zebra_primitives::hash::H256 as GlobalH256; macro_rules! impl_hash { ($name: ident, $other: ident, $size: expr) => { @@ -162,8 +162,8 @@ impl H256 { #[cfg(test)] mod tests { use super::H256; - use primitives::hash::H256 as GlobalH256; use std::str::FromStr; + use zebra_primitives::hash::H256 as GlobalH256; #[test] fn hash_debug() { diff --git a/rpc/src/v1/types/nodes.rs b/rpc/src/v1/types/nodes.rs index 277a6b2e..dcc5a850 100644 --- a/rpc/src/v1/types/nodes.rs +++ b/rpc/src/v1/types/nodes.rs @@ -1,7 +1,7 @@ -use p2p::{Direction, PeerInfo}; use serde::de::Unexpected; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::fmt; +use zebra_p2p::{Direction, PeerInfo}; #[derive(Debug, PartialEq)] pub enum AddNodeOperation { diff --git a/rpc/src/v1/types/transaction.rs b/rpc/src/v1/types/transaction.rs index 27407fce..48cfc358 100644 --- a/rpc/src/v1/types/transaction.rs +++ b/rpc/src/v1/types/transaction.rs @@ -1,11 +1,11 @@ use super::bytes::Bytes; use super::hash::H256; use super::script::ScriptType; -use keys::Address; use serde::ser::SerializeMap; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::fmt; use v1::types; +use zebra_keys::Address; /// Hex-encoded transaction pub type RawTransaction = Bytes; diff --git a/rpc/src/v1/types/uint.rs b/rpc/src/v1/types/uint.rs index 836c20c8..bf0b67d2 100644 --- a/rpc/src/v1/types/uint.rs +++ b/rpc/src/v1/types/uint.rs @@ -1,8 +1,8 @@ -use primitives::bigint::U256 as GlobalU256; use serde; use serde::de::Unexpected; use std::fmt; use std::str::FromStr; +use zebra_primitives::bigint::U256 as GlobalU256; macro_rules! impl_uint { ($name: ident, $other: ident, $size: expr) => { diff --git a/script/Cargo.toml b/script/Cargo.toml index e9824a37..1f0b7611 100644 --- a/script/Cargo.toml +++ b/script/Cargo.toml @@ -1,18 +1,19 @@ [package] -name = "script" +name = "zebra-script" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] -bitcrypto = { path = "../crypto" } byteorder = "1.0" -chain = { path = "../chain" } -keys = { path = "../keys" } -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } log = "0.4" +zebra-crypto = { path = "../crypto" } +zebra-chain = { path = "../chain" } +zebra-keys = { path = "../keys" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } [dev-dependencies] rustc-hex = "2" serde_json = "1.0" -chain = { path = "../chain", features = ["test-helpers"] } +zebra-chain = { path = "../chain", features = ["test-helpers"] } diff --git a/script/src/builder.rs b/script/src/builder.rs index 570fd4bf..4e2786ff 100644 --- a/script/src/builder.rs +++ b/script/src/builder.rs @@ -1,7 +1,7 @@ //! Script builder use bytes::Bytes; -use keys::AddressHash; +use zebra_keys::AddressHash; use {Num, Opcode, Script}; /// Script builder diff --git a/script/src/interpreter.rs b/script/src/interpreter.rs index e4ec0704..1f98ca04 100644 --- a/script/src/interpreter.rs +++ b/script/src/interpreter.rs @@ -1,9 +1,9 @@ use bytes::Bytes; -use chain::constants::SEQUENCE_LOCKTIME_DISABLE_FLAG; -use crypto::{dhash160, dhash256, ripemd160, sha1, sha256}; -use keys::{Public, Signature}; use sign::Sighash; use std::{cmp, mem}; +use zebra_chain::constants::SEQUENCE_LOCKTIME_DISABLE_FLAG; +use zebra_crypto::{dhash160, dhash256, ripemd160, sha1, sha256}; +use zebra_keys::{Public, Signature}; use {script, Error, Num, Opcode, Script, SignatureChecker, Stack, VerificationFlags}; /// Helper function. @@ -892,7 +892,7 @@ pub fn eval_script( mod tests { use super::{eval_script, is_public_key, verify_script}; use bytes::Bytes; - use chain::Transaction; + use zebra_chain::Transaction; use { Builder, Error, NoopSignatureChecker, Num, Opcode, Script, Stack, TransactionInputSigner, TransactionSignatureChecker, VerificationFlags, diff --git a/script/src/lib.rs b/script/src/lib.rs index 8cd3cfb6..e170dcc8 100644 --- a/script/src/lib.rs +++ b/script/src/lib.rs @@ -1,10 +1,10 @@ -extern crate bitcrypto as crypto; extern crate byteorder; -extern crate chain; -extern crate keys; extern crate log; -extern crate primitives; -extern crate serialization as ser; +extern crate zebra_chain; +extern crate zebra_crypto; +extern crate zebra_keys; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; #[cfg(test)] extern crate rustc_hex as hex; @@ -22,7 +22,7 @@ mod sign; mod stack; mod verify; -pub use primitives::{bytes, hash}; +pub use zebra_primitives::{bytes, hash}; pub use self::builder::Builder; pub use self::error::Error; diff --git a/script/src/script.rs b/script/src/script.rs index 71e27840..ad3c52c2 100644 --- a/script/src/script.rs +++ b/script/src/script.rs @@ -1,8 +1,8 @@ //! Serialized script, used inside transaction inputs and outputs. use bytes::Bytes; -use keys::{self, AddressHash, Public}; use std::{fmt, ops}; +use zebra_keys::{self, AddressHash, Public}; use {Error, Opcode}; /// Maximum number of bytes pushable to the stack @@ -32,7 +32,7 @@ pub enum ScriptType { #[derive(PartialEq, Debug)] pub struct ScriptAddress { /// The type of the address. - pub kind: keys::Type, + pub kind: zebra_keys::Type, /// Public key hash. pub hash: AddressHash, } @@ -41,7 +41,7 @@ impl ScriptAddress { /// Creates P2PKH-type ScriptAddress pub fn new_p2pkh(hash: AddressHash) -> Self { ScriptAddress { - kind: keys::Type::P2PKH, + kind: zebra_keys::Type::P2PKH, hash: hash, } } @@ -49,7 +49,7 @@ impl ScriptAddress { /// Creates P2SH-type ScriptAddress pub fn new_p2sh(hash: AddressHash) -> Self { ScriptAddress { - kind: keys::Type::P2SH, + kind: zebra_keys::Type::P2SH, hash: hash, } } @@ -327,7 +327,7 @@ impl Script { return 1; } - pub fn extract_destinations(&self) -> Result, keys::Error> { + pub fn extract_destinations(&self) -> Result, zebra_keys::Error> { match self.script_type() { ScriptType::NonStandard => Ok(vec![]), ScriptType::PubKey => { @@ -488,7 +488,7 @@ impl fmt::Display for Script { #[cfg(test)] mod tests { use super::{Script, ScriptAddress, ScriptType, MAX_SCRIPT_ELEMENT_SIZE}; - use keys::{Address, Public}; + use zebra_keys::{Address, Public}; use {Builder, Opcode}; #[test] diff --git a/script/src/sign.rs b/script/src/sign.rs index 1bcba012..17a845b8 100644 --- a/script/src/sign.rs +++ b/script/src/sign.rs @@ -2,13 +2,13 @@ use byteorder::{ByteOrder, LittleEndian}; use bytes::Bytes; -use chain::{ +use hash::H256; +use ser::Stream; +use zebra_chain::{ JoinSplit, OutPoint, Sapling, Transaction, TransactionInput, TransactionOutput, SAPLING_TX_VERSION_GROUP_ID, }; -use crypto::{blake2b_personal, dhash256}; -use hash::H256; -use ser::Stream; +use zebra_crypto::{blake2b_personal, dhash256}; use Script; #[derive(Debug, PartialEq, Clone, Copy)] @@ -516,13 +516,13 @@ fn compute_hash_sapling_outputs( mod tests { use super::{Sighash, SighashBase, TransactionInputSigner, UnsignedTransactionInput}; use bytes::Bytes; - use chain::{OutPoint, Transaction, TransactionOutput}; use hash::H256; use hex::FromHex; - use keys::{Address, KeyPair, Private}; use script::Script; use ser::deserialize; use serde_json::{from_slice, Value}; + use zebra_chain::{OutPoint, Transaction, TransactionOutput}; + use zebra_keys::{Address, KeyPair, Private}; use {verify_script, TransactionSignatureChecker, VerificationFlags}; #[test] diff --git a/script/src/verify.rs b/script/src/verify.rs index 50076826..8da61e2e 100644 --- a/script/src/verify.rs +++ b/script/src/verify.rs @@ -1,8 +1,8 @@ -use chain::constants::{ +use zebra_chain::constants::{ LOCKTIME_THRESHOLD, SEQUENCE_FINAL, SEQUENCE_LOCKTIME_DISABLE_FLAG, SEQUENCE_LOCKTIME_MASK, SEQUENCE_LOCKTIME_TYPE_FLAG, }; -use keys::{Message, Public, Signature}; +use zebra_keys::{Message, Public, Signature}; use {Num, Script, SighashCache, TransactionInputSigner}; /// Checks transaction signature diff --git a/serialization/Cargo.toml b/serialization/Cargo.toml index 229d7671..4de1cdb0 100644 --- a/serialization/Cargo.toml +++ b/serialization/Cargo.toml @@ -1,9 +1,10 @@ [package] -name = "serialization" +name = "zebra-serialization" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] byteorder = "1.0" -primitives = { path = "../primitives" } rustc-hex = "2" +zebra-primitives = { path = "../primitives" } diff --git a/serialization/src/lib.rs b/serialization/src/lib.rs index b6a73675..c8f678a8 100644 --- a/serialization/src/lib.rs +++ b/serialization/src/lib.rs @@ -1,6 +1,6 @@ extern crate byteorder; -extern crate primitives; extern crate rustc_hex as hex; +extern crate zebra_primitives; mod compact_integer; mod fixed_array; @@ -11,6 +11,6 @@ mod stream; pub use compact_integer::CompactInteger; pub use list::List; -pub use primitives::{bytes, compact, hash}; pub use reader::{deserialize, deserialize_iterator, Deserializable, Error, ReadIterator, Reader}; pub use stream::{serialize, serialize_list, serialized_list_size, Serializable, Stream}; +pub use zebra_primitives::{bytes, compact, hash}; diff --git a/serialization_derive/Cargo.toml b/serialization_derive/Cargo.toml index 3e039592..bf567503 100644 --- a/serialization_derive/Cargo.toml +++ b/serialization_derive/Cargo.toml @@ -1,10 +1,11 @@ [package] -name = "serialization_derive" +name = "zebra-serialization_derive" version = "0.1.0" -authors = ["debris "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [lib] -name = "serialization_derive" +name = "zebra_serialization_derive" proc-macro = true [dependencies] @@ -12,4 +13,4 @@ syn = "0.11.11" quote = "0.3.15" [dev-dependencies] -serialization = { path = "../serialization" } +zebra-serialization = { path = "../serialization" } diff --git a/serialization_derive/src/de.rs b/serialization_derive/src/de.rs index aea3c16a..d7ee0665 100644 --- a/serialization_derive/src/de.rs +++ b/serialization_derive/src/de.rs @@ -26,8 +26,8 @@ pub fn impl_deserializable(ast: &syn::DeriveInput) -> quote::Tokens { let dummy_const = syn::Ident::new(format!("_IMPL_DESERIALIZABLE_FOR_{}", name)); let impl_block = quote! { - impl serialization::Deserializable for #name { - fn deserialize(reader: &mut serialization::Reader) -> Result where T: io::Read { + impl zebra_serialization::Deserializable for #name { + fn deserialize(reader: &mut zebra_serialization::Reader) -> Result where T: io::Read { let result = #name { #(#stmts)* }; @@ -40,7 +40,7 @@ pub fn impl_deserializable(ast: &syn::DeriveInput) -> quote::Tokens { quote! { #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const #dummy_const: () = { - extern crate serialization; + extern crate zebra_serialization; use std::io; #impl_block }; diff --git a/serialization_derive/src/ser.rs b/serialization_derive/src/ser.rs index d598139d..d1a30bb7 100644 --- a/serialization_derive/src/ser.rs +++ b/serialization_derive/src/ser.rs @@ -38,8 +38,8 @@ pub fn impl_serializable(ast: &syn::DeriveInput) -> quote::Tokens { let dummy_const = syn::Ident::new(format!("_IMPL_SERIALIZABLE_FOR_{}", name)); let impl_block = quote! { - impl serialization::Serializable for #name { - fn serialize(&self, stream: &mut serialization::Stream) { + impl zebra_serialization::Serializable for #name { + fn serialize(&self, stream: &mut zebra_serialization::Stream) { #(#stmts)* } @@ -52,7 +52,7 @@ pub fn impl_serializable(ast: &syn::DeriveInput) -> quote::Tokens { quote! { #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const #dummy_const: () = { - extern crate serialization; + extern crate zebra_serialization; #impl_block }; } @@ -78,7 +78,7 @@ fn serialize_field_size(index: usize, field: &syn::Field) -> quote::Tokens { .expect("there must be at least 1 segment") .ident; if &ident.to_string() == "Vec" { - quote! { serialization::serialized_list_size(&#id) } + quote! { zebra_serialization::serialized_list_size(&#id) } } else { quote! { #id.serialized_size() } } diff --git a/serialization_derive/tests/raw.rs b/serialization_derive/tests/raw.rs index f6ceebfe..85e9e30e 100644 --- a/serialization_derive/tests/raw.rs +++ b/serialization_derive/tests/raw.rs @@ -1,8 +1,8 @@ -extern crate serialization; +extern crate zebra_serialization; #[macro_use] -extern crate serialization_derive; +extern crate zebra_serialization_derive; -use serialization::{deserialize, serialize}; +use zebra_serialization::{deserialize, serialize}; #[derive(Debug, PartialEq, Serializable, Deserializable)] struct Foo { diff --git a/storage/Cargo.toml b/storage/Cargo.toml index e264b9b2..1afc855a 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -1,17 +1,18 @@ [package] -name = "storage" +name = "zebra-storage" version = "0.1.0" -authors = ["Parity Technologies "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] elastic-array = "0.10" parking_lot = "0.8" bit-vec = "0.4" lru-cache = "0.1" -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } -chain = { path = "../chain" } display_derive = "0.0.0" -bitcrypto = { path = "../crypto" } lazy_static = "*" -network = { path = "../network" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } +zebra-chain = { path = "../chain" } +zebra-crypto = { path = "../crypto" } +zebra-network = { path = "../network" } diff --git a/storage/src/block_ancestors.rs b/storage/src/block_ancestors.rs index 90054837..fabdc013 100644 --- a/storage/src/block_ancestors.rs +++ b/storage/src/block_ancestors.rs @@ -1,4 +1,4 @@ -use chain::IndexedBlockHeader; +use zebra_chain::IndexedBlockHeader; use {BlockHeaderProvider, BlockRef}; pub struct BlockAncestors<'a> { diff --git a/storage/src/block_chain.rs b/storage/src/block_chain.rs index c1c308cf..c1f80678 100644 --- a/storage/src/block_chain.rs +++ b/storage/src/block_chain.rs @@ -1,5 +1,5 @@ -use chain::{IndexedBlock, IndexedBlockHeader}; use hash::H256; +use zebra_chain::{IndexedBlock, IndexedBlockHeader}; use {BlockOrigin, Error, SideChainOrigin, Store}; pub trait ForkChain { diff --git a/storage/src/block_impls.rs b/storage/src/block_impls.rs index 35f3d00a..dbac7883 100644 --- a/storage/src/block_impls.rs +++ b/storage/src/block_impls.rs @@ -1,5 +1,5 @@ -use chain::{IndexedBlock, IndexedTransaction, OutPoint, TransactionOutput}; use std::cmp; +use zebra_chain::{IndexedBlock, IndexedTransaction, OutPoint, TransactionOutput}; use TransactionOutputProvider; fn transaction_output( diff --git a/storage/src/block_iterator.rs b/storage/src/block_iterator.rs index ae83b79a..2c7caf4b 100644 --- a/storage/src/block_iterator.rs +++ b/storage/src/block_iterator.rs @@ -1,4 +1,4 @@ -use chain::IndexedBlockHeader; +use zebra_chain::IndexedBlockHeader; use {BlockHeaderProvider, BlockRef}; pub struct BlockIterator<'a> { diff --git a/storage/src/block_provider.rs b/storage/src/block_provider.rs index 42f37277..d8c30638 100644 --- a/storage/src/block_provider.rs +++ b/storage/src/block_provider.rs @@ -1,6 +1,6 @@ use bytes::Bytes; -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; use hash::H256; +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; use BlockRef; pub trait BlockHeaderProvider { diff --git a/storage/src/duplex_store.rs b/storage/src/duplex_store.rs index ec86e04e..4c7dc860 100644 --- a/storage/src/duplex_store.rs +++ b/storage/src/duplex_store.rs @@ -1,7 +1,7 @@ //! Some transaction validation rules, //! require sophisticated (in more than one source) previous transaction lookups -use chain::{OutPoint, TransactionOutput}; +use zebra_chain::{OutPoint, TransactionOutput}; use TransactionOutputProvider; #[derive(Clone, Copy)] diff --git a/storage/src/lib.rs b/storage/src/lib.rs index 883ad9dd..ac545a79 100644 --- a/storage/src/lib.rs +++ b/storage/src/lib.rs @@ -5,13 +5,13 @@ extern crate parking_lot; #[macro_use] extern crate display_derive; -extern crate bitcrypto as crypto; -extern crate chain; -extern crate primitives; -extern crate serialization as ser; +extern crate zebra_chain; +extern crate zebra_crypto; +extern crate zebra_primitives; +extern crate zebra_serialization as ser; #[macro_use] extern crate lazy_static; -extern crate network; +extern crate zebra_network; mod best_block; mod block_ancestors; @@ -30,7 +30,7 @@ mod transaction_provider; mod tree_state; mod tree_state_provider; -pub use primitives::{bytes, hash}; +pub use zebra_primitives::{bytes, hash}; pub use best_block::BestBlock; pub use block_ancestors::BlockAncestors; diff --git a/storage/src/store.rs b/storage/src/store.rs index 2f02251e..fef58908 100644 --- a/storage/src/store.rs +++ b/storage/src/store.rs @@ -1,5 +1,5 @@ -use chain::IndexedBlockHeader; use std::sync::Arc; +use zebra_chain::IndexedBlockHeader; use { BestBlock, BlockChain, BlockHeaderProvider, BlockProvider, Forkable, NullifierTracker, TransactionMetaProvider, TransactionOutputProvider, TransactionProvider, TreeStateProvider, diff --git a/storage/src/transaction_provider.rs b/storage/src/transaction_provider.rs index 28f162e2..049d0bf0 100644 --- a/storage/src/transaction_provider.rs +++ b/storage/src/transaction_provider.rs @@ -1,8 +1,8 @@ use bytes::Bytes; -use chain::{IndexedTransaction, OutPoint, TransactionOutput}; use hash::H256; use parking_lot::RwLock; use std::collections::HashMap; +use zebra_chain::{IndexedTransaction, OutPoint, TransactionOutput}; use TransactionMeta; /// Should be used to obtain all transactions from canon chain and forks. diff --git a/storage/src/tree_state.rs b/storage/src/tree_state.rs index 9b7905e2..76817a17 100644 --- a/storage/src/tree_state.rs +++ b/storage/src/tree_state.rs @@ -1,5 +1,5 @@ -use crypto::{pedersen_hash, sha256_compress}; use hash::H256; +use zebra_crypto::{pedersen_hash, sha256_compress}; lazy_static! { static ref SPROUT_EMPTY_ROOTS: Vec = [ @@ -276,18 +276,18 @@ impl TreeState { pub type SproutTreeState = TreeState; pub type SaplingTreeState = TreeState; -impl serialization::Serializable for TreeState { - fn serialize(&self, stream: &mut serialization::Stream) { +impl zebra_serialization::Serializable for TreeState { + fn serialize(&self, stream: &mut zebra_serialization::Stream) { stream.append(&self.left); stream.append(&self.right); stream.append_list(&self.parents); } } -impl serialization::Deserializable for TreeState { +impl zebra_serialization::Deserializable for TreeState { fn deserialize( - reader: &mut serialization::Reader, - ) -> Result { + reader: &mut zebra_serialization::Reader, + ) -> Result { let mut tree_state = TreeState::new(); tree_state.left = reader.read()?; tree_state.right = reader.read()?; @@ -622,12 +622,12 @@ mod tests { H256::from("0bf622cb9f901b7532433ea2e7c1b7632f5935899b62dcf897a71551997dc8cc") ); - let mut stream = serialization::Stream::new(); + let mut stream = zebra_serialization::Stream::new(); stream.append(&tree); let bytes = stream.out(); - let mut reader = serialization::Reader::new(&bytes[..]); + let mut reader = zebra_serialization::Reader::new(&bytes[..]); let deserialized_tree: TestSproutTreeState = reader.read().expect("Failed to deserialize"); assert!(!tree.is_empty); @@ -640,13 +640,13 @@ mod tests { #[test] fn serde_empty() { let tree = TestSproutTreeState::new(); - let mut stream = serialization::Stream::new(); + let mut stream = zebra_serialization::Stream::new(); assert!(tree.is_empty); stream.append(&tree); let bytes = stream.out(); - let mut reader = serialization::Reader::new(&bytes[..]); + let mut reader = zebra_serialization::Reader::new(&bytes[..]); let deserialized_tree: TestSproutTreeState = reader.read().expect("Failed to deserialize"); assert!(deserialized_tree.is_empty); } diff --git a/sync/Cargo.toml b/sync/Cargo.toml index df670177..1fe274da 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "sync" +name = "zebra-sync" version = "0.1.0" -authors = ["Ethcore "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] parking_lot = "0.8" @@ -14,21 +15,21 @@ murmur3 = "0.4" rand = "0.4" byteorder = "1.0" -chain = { path = "../chain" } -bitcrypto = { path = "../crypto" } -storage = { path = "../storage" } -db = { path = "../db" } -keys = { path = "../keys" } -message = { path = "../message" } -miner = { path = "../miner" } -p2p = { path = "../p2p" } -primitives = { path = "../primitives" } -script = { path = "../script" } -serialization = { path = "../serialization" } -verification = { path = "../verification" } -network = { path = "../network" } +zebra-chain = { path = "../chain" } +zebra-crypto = { path = "../crypto" } +zebra-storage = { path = "../storage" } +zebra-db = { path = "../db" } +zebra-keys = { path = "../keys" } +zebra-message = { path = "../message" } +zebra-miner = { path = "../miner" } +zebra-p2p = { path = "../p2p" } +zebra-primitives = { path = "../primitives" } +zebra-script = { path = "../script" } +zebra-serialization = { path = "../serialization" } +zebra-verification = { path = "../verification" } +zebra-network = { path = "../network" } [dev-dependencies] -test-data = { path = "../test-data" } -miner = { path = "../miner", features = ["test-helpers"] } -chain = { path = "../chain", features = ["test-helpers"] } +zebra-test-data = { path = "../test-data" } +zebra-miner = { path = "../miner", features = ["test-helpers"] } +zebra-chain = { path = "../chain", features = ["test-helpers"] } diff --git a/sync/src/blocks_writer.rs b/sync/src/blocks_writer.rs index 1abad743..30d77907 100644 --- a/sync/src/blocks_writer.rs +++ b/sync/src/blocks_writer.rs @@ -1,11 +1,7 @@ use super::Error; -use chain; -use network::ConsensusParams; use parking_lot::Mutex; -use primitives::hash::H256; use std::collections::VecDeque; use std::sync::Arc; -use storage; use synchronization_chain::Chain; use synchronization_verifier::{ BlockVerificationSink, HeadersVerificationSink, PartiallyVerifiedBlock, SyncVerifier, @@ -13,6 +9,10 @@ use synchronization_verifier::{ }; use types::{PeerIndex, StorageRef}; use utils::OrphanBlocksPool; +use zebra_chain; +use zebra_network::ConsensusParams; +use zebra_primitives::hash::H256; +use zebra_storage; use VerificationParameters; /// Maximum number of orphaned in-memory blocks @@ -63,17 +63,17 @@ impl BlocksWriter { } /// Append new block - pub fn append_block(&mut self, block: chain::IndexedBlock) -> Result<(), Error> { + pub fn append_block(&mut self, block: zebra_chain::IndexedBlock) -> Result<(), Error> { // do not append block if it is already there if self .storage - .contains_block(storage::BlockRef::Hash(block.hash().clone())) + .contains_block(zebra_storage::BlockRef::Hash(block.hash().clone())) { return Ok(()); } // verify && insert only if parent block is already in the storage - if !self.storage.contains_block(storage::BlockRef::Hash( + if !self.storage.contains_block(zebra_storage::BlockRef::Hash( block.header.raw.previous_header_hash.clone(), )) { self.orphaned_blocks_pool.insert_orphaned_block(block); @@ -85,7 +85,7 @@ impl BlocksWriter { } // verify && insert block && all its orphan children - let mut verification_queue: VecDeque = self + let mut verification_queue: VecDeque = self .orphaned_blocks_pool .remove_blocks_for_parent(block.hash()); verification_queue.push_front(block); @@ -128,7 +128,7 @@ impl VerificationSink for BlocksWriterSink {} impl BlockVerificationSink for BlocksWriterSink { fn on_block_verification_success( &self, - block: chain::IndexedBlock, + block: zebra_chain::IndexedBlock, ) -> Option> { let mut data = self.data.lock(); if let Err(err) = data.chain.insert_best_block(block) { @@ -144,7 +144,7 @@ impl BlockVerificationSink for BlocksWriterSink { } impl TransactionVerificationSink for BlocksWriterSink { - fn on_transaction_verification_success(&self, _transaction: chain::IndexedTransaction) { + fn on_transaction_verification_success(&self, _transaction: zebra_chain::IndexedTransaction) { unreachable!("not intended to verify transactions") } @@ -154,7 +154,7 @@ impl TransactionVerificationSink for BlocksWriterSink { } impl HeadersVerificationSink for BlocksWriterSink { - fn on_headers_verification_success(&self, _headers: Vec) { + fn on_headers_verification_success(&self, _headers: Vec) { unreachable!("not intended to verify headers") } @@ -163,7 +163,7 @@ impl HeadersVerificationSink for BlocksWriterSink { _peer: PeerIndex, _err: String, _hash: H256, - _headers: Vec, + _headers: Vec, ) { unreachable!("not intended to verify headers") } @@ -171,14 +171,14 @@ impl HeadersVerificationSink for BlocksWriterSink { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::super::Error; use super::{BlocksWriter, MAX_ORPHANED_BLOCKS}; - use db::BlockChainDatabase; - use network::{ConsensusParams, Network}; use std::sync::Arc; - use verification::VerificationLevel; + use zebra_db::BlockChainDatabase; + use zebra_network::{ConsensusParams, Network}; + use zebra_verification::VerificationLevel; use VerificationParameters; fn default_verification_params() -> VerificationParameters { @@ -191,7 +191,7 @@ mod tests { #[test] fn blocks_writer_appends_blocks() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let mut blocks_target = BlocksWriter::new( db.clone(), @@ -199,7 +199,7 @@ mod tests { default_verification_params(), ); blocks_target - .append_block(test_data::block_h1().into()) + .append_block(zebra_test_data::block_h1().into()) .expect("Expecting no error"); assert_eq!(db.best_block().number, 1); } @@ -207,10 +207,10 @@ mod tests { #[test] fn blocks_writer_verification_error() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let blocks = - test_data::build_n_empty_blocks_from_genesis((MAX_ORPHANED_BLOCKS + 2) as u32, 1); + zebra_test_data::build_n_empty_blocks_from_genesis((MAX_ORPHANED_BLOCKS + 2) as u32, 1); let mut blocks_target = BlocksWriter::new( db.clone(), ConsensusParams::new(Network::Testnet), @@ -229,7 +229,7 @@ mod tests { #[test] fn blocks_writer_out_of_order_block() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let mut blocks_target = BlocksWriter::new( db.clone(), @@ -237,9 +237,9 @@ mod tests { default_verification_params(), ); - let wrong_block = test_data::block_builder() + let wrong_block = zebra_test_data::block_builder() .header() - .parent(test_data::genesis().hash()) + .parent(zebra_test_data::genesis().hash()) .build() .build(); match blocks_target.append_block(wrong_block.into()).unwrap_err() { @@ -252,7 +252,7 @@ mod tests { #[test] fn blocks_writer_append_to_existing_db() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let mut blocks_target = BlocksWriter::new( db.clone(), @@ -261,7 +261,7 @@ mod tests { ); assert!(blocks_target - .append_block(test_data::block_h1().into()) + .append_block(zebra_test_data::block_h1().into()) .is_ok()); assert_eq!(db.best_block().number, 1); } @@ -270,20 +270,20 @@ mod tests { fn blocks_write_able_to_reorganize() { // (1) b0 ---> (2) b1 // \--> (3) b2 ---> (4 - reorg) b3 - let b0 = test_data::block_builder().header().build().build(); - let b1 = test_data::block_builder() + let b0 = zebra_test_data::block_builder().header().build().build(); + let b1 = zebra_test_data::block_builder() .header() .nonce(1.into()) .parent(b0.hash()) .build() .build(); - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .nonce(2.into()) .parent(b0.hash()) .build() .build(); - let b3 = test_data::block_builder() + let b3 = zebra_test_data::block_builder() .header() .parent(b2.hash()) .build() diff --git a/sync/src/inbound_connection.rs b/sync/src/inbound_connection.rs index efbc8af9..d4828cdd 100644 --- a/sync/src/inbound_connection.rs +++ b/sync/src/inbound_connection.rs @@ -1,8 +1,8 @@ -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; -use message::types; -use p2p::{InboundSyncConnection, InboundSyncConnectionRef, InboundSyncConnectionStateRef}; use types::{LocalNodeRef, PeerIndex, PeersRef, RequestId}; use utils::KnownHashType; +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; +use zebra_message::types; +use zebra_p2p::{InboundSyncConnection, InboundSyncConnectionRef, InboundSyncConnectionStateRef}; /// Inbound synchronization connection pub struct InboundConnection { @@ -198,12 +198,12 @@ impl InboundSyncConnection for InboundConnection { #[cfg(test)] pub mod tests { - use message::types; - use p2p::OutboundSyncConnection; use parking_lot::Mutex; use std::collections::HashMap; use std::sync::Arc; use types::RequestId; + use zebra_message::types; + use zebra_p2p::OutboundSyncConnection; pub struct DummyOutboundSyncConnection { pub messages: Mutex>, diff --git a/sync/src/inbound_connection_factory.rs b/sync/src/inbound_connection_factory.rs index 42f80807..bd8347bd 100644 --- a/sync/src/inbound_connection_factory.rs +++ b/sync/src/inbound_connection_factory.rs @@ -1,8 +1,10 @@ use inbound_connection::InboundConnection; -use message::Services; -use p2p::{InboundSyncConnectionRef, LocalSyncNode, LocalSyncNodeRef, OutboundSyncConnectionRef}; use std::sync::atomic::{AtomicUsize, Ordering}; use types::{LocalNodeRef, PeersRef}; +use zebra_message::Services; +use zebra_p2p::{ + InboundSyncConnectionRef, LocalSyncNode, LocalSyncNodeRef, OutboundSyncConnectionRef, +}; /// Inbound synchronization connection factory pub struct InboundConnectionFactory { diff --git a/sync/src/lib.rs b/sync/src/lib.rs index 12a17bcb..3cdd65a9 100644 --- a/sync/src/lib.rs +++ b/sync/src/lib.rs @@ -1,26 +1,26 @@ -extern crate bitcrypto; extern crate byteorder; -extern crate chain; -extern crate db; -extern crate storage; +extern crate zebra_chain; +extern crate zebra_crypto; +extern crate zebra_db; +extern crate zebra_storage; #[macro_use] extern crate log; extern crate bit_vec; extern crate futures; -extern crate keys; extern crate linked_hash_map; -extern crate message; -extern crate miner; extern crate murmur3; -extern crate network; -extern crate p2p; extern crate parking_lot; -extern crate primitives; extern crate rand; -extern crate script; -extern crate serialization as ser; extern crate time; -extern crate verification; +extern crate zebra_keys; +extern crate zebra_message; +extern crate zebra_miner; +extern crate zebra_network; +extern crate zebra_p2p; +extern crate zebra_primitives; +extern crate zebra_script; +extern crate zebra_serialization as ser; +extern crate zebra_verification; mod blocks_writer; mod inbound_connection; @@ -41,11 +41,11 @@ mod utils; pub use types::LocalNodeRef; pub use types::PeersRef; -use network::{ConsensusParams, Network}; use parking_lot::RwLock; -use primitives::hash::H256; use std::sync::Arc; -use verification::BackwardsCompatibleChainVerifier as ChainVerifier; +use zebra_network::{ConsensusParams, Network}; +use zebra_primitives::hash::H256; +use zebra_verification::BackwardsCompatibleChainVerifier as ChainVerifier; /// Sync errors. #[derive(Debug, PartialEq)] @@ -53,7 +53,7 @@ pub enum Error { /// Too many orphan blocks. TooManyOrphanBlocks, /// Database error. - Database(storage::Error), + Database(zebra_storage::Error), /// Block verification error. Verification(String), } @@ -62,7 +62,7 @@ pub enum Error { /// Verification parameters. pub struct VerificationParameters { /// Blocks verification level. - pub verification_level: verification::VerificationLevel, + pub verification_level: zebra_verification::VerificationLevel, /// Blocks verification edge: all blocks before this are validated using verification_level. /// All blocks after this (inclusive) are validated using VerificationLevel::Full level. pub verification_edge: H256, @@ -78,7 +78,7 @@ pub trait SyncListener: Send + 'static { /// Create blocks writer. pub fn create_sync_blocks_writer( - db: storage::SharedStore, + db: zebra_storage::SharedStore, consensus: ConsensusParams, verification_params: VerificationParameters, ) -> blocks_writer::BlocksWriter { @@ -95,12 +95,11 @@ pub fn create_sync_peers() -> PeersRef { /// Creates local sync node for given `db` pub fn create_local_sync_node( consensus: ConsensusParams, - db: storage::SharedStore, + db: zebra_storage::SharedStore, peers: PeersRef, verification_params: VerificationParameters, ) -> LocalNodeRef { use local_node::LocalNode as SyncNode; - use miner::MemoryPool; use synchronization_chain::Chain as SyncChain; use synchronization_client::SynchronizationClient; use synchronization_client_core::{ @@ -111,6 +110,7 @@ pub fn create_local_sync_node( use synchronization_verifier::AsyncVerifier; use types::SynchronizationStateRef; use utils::SynchronizationState; + use zebra_miner::MemoryPool; let network = consensus.network; let sync_client_config = SynchronizationConfig { @@ -176,7 +176,7 @@ pub fn create_local_sync_node( pub fn create_sync_connection_factory( peers: PeersRef, local_sync_node: LocalNodeRef, -) -> p2p::LocalSyncNodeRef { +) -> zebra_p2p::LocalSyncNodeRef { use inbound_connection_factory::InboundConnectionFactory as SyncConnectionFactory; SyncConnectionFactory::new(peers, local_sync_node).boxed() diff --git a/sync/src/local_node.rs b/sync/src/local_node.rs index c1f4492a..249f49ef 100644 --- a/sync/src/local_node.rs +++ b/sync/src/local_node.rs @@ -1,12 +1,5 @@ -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; use futures::{finished, lazy}; -use keys::Address; -use message::types; -use miner::BlockAssembler; -use miner::BlockTemplate; -use network::ConsensusParams; use parking_lot::{Condvar, Mutex}; -use primitives::hash::H256; use std::sync::Arc; use synchronization_client::Client; use synchronization_peers::{BlockAnnouncementType, TransactionAnnouncementType}; @@ -17,6 +10,13 @@ use types::{ BlockHeight, ClientRef, MemoryPoolRef, PeerIndex, PeersRef, RequestId, ServerRef, StorageRef, SyncListenerRef, SynchronizationStateRef, }; +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; +use zebra_keys::Address; +use zebra_message::types; +use zebra_miner::BlockAssembler; +use zebra_miner::BlockTemplate; +use zebra_network::ConsensusParams; +use zebra_primitives::hash::H256; /// Local synchronization node pub struct LocalNode { @@ -286,17 +286,10 @@ impl TransactionVerificationSink for TransactionAcceptSink { #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::LocalNode; - use chain::Transaction; - use db::BlockChainDatabase; - use message::common::{InventoryType, InventoryVector}; - use message::types; - use miner::MemoryPool; - use network::{ConsensusParams, Network}; use parking_lot::RwLock; - use primitives::bytes::Bytes; use std::iter::repeat; use std::sync::Arc; use synchronization_chain::Chain; @@ -310,6 +303,13 @@ pub mod tests { use synchronization_verifier::tests::DummyVerifier; use types::SynchronizationStateRef; use utils::SynchronizationState; + use zebra_chain::Transaction; + use zebra_db::BlockChainDatabase; + use zebra_message::common::{InventoryType, InventoryVector}; + use zebra_message::types; + use zebra_miner::MemoryPool; + use zebra_network::{ConsensusParams, Network}; + use zebra_primitives::bytes::Bytes; pub fn default_filterload() -> types::FilterLoad { types::FilterLoad { @@ -333,7 +333,7 @@ pub mod tests { ) { let memory_pool = Arc::new(RwLock::new(MemoryPool::new())); let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let sync_state = SynchronizationStateRef::new(SynchronizationState::with_storage(storage.clone())); @@ -382,7 +382,7 @@ pub mod tests { let peer_index = 0; local_node.on_connect(peer_index, "test".into(), types::Version::default()); // peer requests genesis block - let genesis_block_hash = test_data::genesis().hash(); + let genesis_block_hash = zebra_test_data::genesis().hash(); let inventory = vec![InventoryVector { inv_type: InventoryType::MessageBlock, hash: genesis_block_hash.clone(), @@ -413,8 +413,8 @@ pub mod tests { local_node.on_connect(peer_index1, "test".into(), types::Version::default()); executor.take_tasks(); - let genesis = test_data::genesis(); - let transaction: Transaction = test_data::TransactionBuilder::with_output(1) + let genesis = zebra_test_data::genesis(); + let transaction: Transaction = zebra_test_data::TransactionBuilder::with_output(1) .add_input(&genesis.transactions[0], 0) .into(); let transaction_hash = transaction.hash(); @@ -430,8 +430,8 @@ pub mod tests { #[test] fn local_node_discards_local_transaction() { - let genesis = test_data::genesis(); - let transaction: Transaction = test_data::TransactionBuilder::with_output(1) + let genesis = zebra_test_data::genesis(); + let transaction: Transaction = zebra_test_data::TransactionBuilder::with_output(1) .add_input(&genesis.transactions[0], 0) .into(); let transaction_hash = transaction.hash(); diff --git a/sync/src/synchronization_chain.rs b/sync/src/synchronization_chain.rs index ff82b384..b93a3970 100644 --- a/sync/src/synchronization_chain.rs +++ b/sync/src/synchronization_chain.rs @@ -1,13 +1,15 @@ -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction, OutPoint, TransactionOutput}; use linked_hash_map::LinkedHashMap; -use miner::{FeeCalculator, MemoryPoolInformation, MemoryPoolOrderingStrategy}; -use primitives::bytes::Bytes; -use primitives::hash::H256; use std::collections::{HashSet, VecDeque}; use std::fmt; -use storage; use types::{BlockHeight, MemoryPoolRef, StorageRef}; use utils::{BestHeadersChain, BestHeadersChainInformation, HashPosition, HashQueueChain}; +use zebra_chain::{ + IndexedBlock, IndexedBlockHeader, IndexedTransaction, OutPoint, TransactionOutput, +}; +use zebra_miner::{FeeCalculator, MemoryPoolInformation, MemoryPoolOrderingStrategy}; +use zebra_primitives::bytes::Bytes; +use zebra_primitives::hash::H256; +use zebra_storage; /// Index of 'verifying' queue const VERIFYING_QUEUE: usize = 0; @@ -112,7 +114,7 @@ pub struct Chain { /// Genesis block hash (stored for optimizations) genesis_block_hash: H256, /// Best storage block (stored for optimizations) - best_storage_block: storage::BestBlock, + best_storage_block: zebra_storage::BestBlock, /// Local blocks storage storage: StorageRef, /// The set of headers we currently verifying. @@ -215,9 +217,9 @@ impl Chain { } /// Get best block - pub fn best_block(&self) -> storage::BestBlock { + pub fn best_block(&self) -> zebra_storage::BestBlock { match self.hash_chain.back() { - Some(hash) => storage::BestBlock { + Some(hash) => zebra_storage::BestBlock { number: self.best_storage_block.number + self.hash_chain.len(), hash: hash.clone(), }, @@ -226,17 +228,17 @@ impl Chain { } /// Get best storage block - pub fn best_storage_block(&self) -> storage::BestBlock { + pub fn best_storage_block(&self) -> zebra_storage::BestBlock { self.best_storage_block.clone() } /// Get best block header - pub fn best_block_header(&self) -> storage::BestBlock { + pub fn best_block_header(&self) -> zebra_storage::BestBlock { let headers_chain_information = self.headers_chain.information(); if headers_chain_information.best == 0 { return self.best_storage_block(); } - storage::BestBlock { + zebra_storage::BestBlock { number: self.best_storage_block.number + headers_chain_information.best, hash: self .headers_chain @@ -269,7 +271,8 @@ impl Chain { /// Get block header by number pub fn block_header_by_number(&self, number: BlockHeight) -> Option { if number <= self.best_storage_block.number { - self.storage.block_header(storage::BlockRef::Number(number)) + self.storage + .block_header(zebra_storage::BlockRef::Number(number)) } else { self.headers_chain .at(number - self.best_storage_block.number) @@ -280,7 +283,7 @@ impl Chain { pub fn block_header_by_hash(&self, hash: &H256) -> Option { if let Some(header) = self .storage - .block_header(storage::BlockRef::Hash(hash.clone())) + .block_header(zebra_storage::BlockRef::Hash(hash.clone())) { return Some(header); } @@ -298,7 +301,7 @@ impl Chain { None => { if self .storage - .contains_block(storage::BlockRef::Hash(hash.clone())) + .contains_block(zebra_storage::BlockRef::Hash(hash.clone())) { BlockState::Stored } else if self.dead_end_blocks.contains(hash) { @@ -399,7 +402,7 @@ impl Chain { pub fn insert_best_block( &mut self, block: IndexedBlock, - ) -> Result { + ) -> Result { assert_eq!( Some(self.storage.best_block().hash), self.storage.block_hash(self.storage.best_block().number) @@ -407,7 +410,7 @@ impl Chain { let block_origin = self.storage.block_origin(&block.header)?; trace!(target: "sync", "insert_best_block {:?} origin: {:?}", block.hash().reversed(), block_origin); match block_origin { - storage::BlockOrigin::KnownBlock => { + zebra_storage::BlockOrigin::KnownBlock => { // there should be no known blocks at this point unreachable!( "Trying to re-insert known block: {}", @@ -415,7 +418,7 @@ impl Chain { ); } // case 1: block has been added to the main branch - storage::BlockOrigin::CanonChain { .. } => { + zebra_storage::BlockOrigin::CanonChain { .. } => { self.storage.insert(block.clone())?; self.storage.canonize(block.hash())?; @@ -449,7 +452,7 @@ impl Chain { }) } // case 2: block has been added to the side branch with reorganization to this branch - storage::BlockOrigin::SideChainBecomingCanonChain(origin) => { + zebra_storage::BlockOrigin::SideChainBecomingCanonChain(origin) => { let fork = self.storage.fork(origin.clone())?; fork.store().insert(block.clone())?; fork.store().canonize(block.hash())?; @@ -533,7 +536,7 @@ impl Chain { Ok(result) } // case 3: block has been added to the side branch without reorganization to this branch - storage::BlockOrigin::SideChain(_origin) => { + zebra_storage::BlockOrigin::SideChain(_origin) => { let block_hash = block.hash().clone(); self.storage.insert(block)?; @@ -768,7 +771,7 @@ impl Chain { } } -impl storage::TransactionProvider for Chain { +impl zebra_storage::TransactionProvider for Chain { fn transaction_bytes(&self, hash: &H256) -> Option { self.memory_pool .read() @@ -784,7 +787,7 @@ impl storage::TransactionProvider for Chain { } } -impl storage::TransactionOutputProvider for Chain { +impl zebra_storage::TransactionOutputProvider for Chain { fn transaction_output( &self, outpoint: &OutPoint, @@ -801,16 +804,16 @@ impl storage::TransactionOutputProvider for Chain { } } -impl storage::BlockHeaderProvider for Chain { - fn block_header_bytes(&self, block_ref: storage::BlockRef) -> Option { +impl zebra_storage::BlockHeaderProvider for Chain { + fn block_header_bytes(&self, block_ref: zebra_storage::BlockRef) -> Option { use ser::serialize; self.block_header(block_ref).map(|h| serialize(&h.raw)) } - fn block_header(&self, block_ref: storage::BlockRef) -> Option { + fn block_header(&self, block_ref: zebra_storage::BlockRef) -> Option { match block_ref { - storage::BlockRef::Hash(hash) => self.block_header_by_hash(&hash), - storage::BlockRef::Number(n) => self.block_header_by_number(n), + zebra_storage::BlockRef::Hash(hash) => self.block_header_by_hash(&hash), + zebra_storage::BlockRef::Number(n) => self.block_header_by_number(n), } } } @@ -884,21 +887,21 @@ impl fmt::Debug for Chain { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{BlockInsertionResult, BlockState, Chain, TransactionState}; - use chain::{IndexedBlockHeader, Transaction}; - use db::BlockChainDatabase; - use miner::MemoryPool; use parking_lot::RwLock; - use primitives::hash::H256; use std::sync::Arc; use utils::HashPosition; + use zebra_chain::{IndexedBlockHeader, Transaction}; + use zebra_db::BlockChainDatabase; + use zebra_miner::MemoryPool; + use zebra_primitives::hash::H256; #[test] fn chain_empty() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let db_best_block = db.best_block(); let chain = Chain::new(db.clone(), Arc::new(RwLock::new(MemoryPool::new()))); @@ -918,12 +921,12 @@ mod tests { #[test] fn chain_block_path() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let mut chain = Chain::new(db.clone(), Arc::new(RwLock::new(MemoryPool::new()))); // add 6 blocks to scheduled queue - let blocks = test_data::build_n_empty_blocks_from_genesis(6, 0); + let blocks = zebra_test_data::build_n_empty_blocks_from_genesis(6, 0); let headers: Vec = blocks.into_iter().map(|b| b.block_header.into()).collect(); let hashes: Vec<_> = headers.iter().map(|h| h.hash.clone()).collect(); @@ -1009,7 +1012,7 @@ mod tests { ); // insert new best block to the chain chain - .insert_best_block(test_data::block_h1().into()) + .insert_best_block(zebra_test_data::block_h1().into()) .expect("Db error"); assert!( chain.information().scheduled == 3 @@ -1023,13 +1026,13 @@ mod tests { #[test] fn chain_block_locator_hashes() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let mut chain = Chain::new(db, Arc::new(RwLock::new(MemoryPool::new()))); let genesis_hash = chain.best_block().hash; assert_eq!(chain.block_locator_hashes(), vec![genesis_hash.clone()]); - let block1 = test_data::block_h1(); + let block1 = zebra_test_data::block_h1(); let block1_hash = block1.hash(); chain @@ -1040,7 +1043,7 @@ mod tests { vec![block1_hash.clone(), genesis_hash.clone()] ); - let block2 = test_data::block_h2(); + let block2 = zebra_test_data::block_h2(); let block2_hash = block2.hash(); chain @@ -1055,7 +1058,7 @@ mod tests { ] ); - let blocks0 = test_data::build_n_empty_blocks_from_genesis(11, 0); + let blocks0 = zebra_test_data::build_n_empty_blocks_from_genesis(11, 0); let headers0: Vec = blocks0.into_iter().map(|b| b.block_header.into()).collect(); let hashes0: Vec<_> = headers0.iter().map(|h| h.hash.clone()).collect(); @@ -1081,7 +1084,7 @@ mod tests { ] ); - let blocks1 = test_data::build_n_empty_blocks_from(6, 0, &headers0[10].raw); + let blocks1 = zebra_test_data::build_n_empty_blocks_from(6, 0, &headers0[10].raw); let headers1: Vec = blocks1.into_iter().map(|b| b.block_header.into()).collect(); let hashes1: Vec<_> = headers1.iter().map(|h| h.hash.clone()).collect(); @@ -1107,7 +1110,7 @@ mod tests { ] ); - let blocks2 = test_data::build_n_empty_blocks_from(3, 0, &headers1[5].raw); + let blocks2 = zebra_test_data::build_n_empty_blocks_from(3, 0, &headers1[5].raw); let headers2: Vec = blocks2.into_iter().map(|b| b.block_header.into()).collect(); let hashes2: Vec<_> = headers2.iter().map(|h| h.hash.clone()).collect(); @@ -1136,16 +1139,18 @@ mod tests { #[test] fn chain_transaction_state() { let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), - test_data::block_h1().into(), + zebra_test_data::genesis().into(), + zebra_test_data::block_h1().into(), ])); let mut chain = Chain::new(db, Arc::new(RwLock::new(MemoryPool::new()))); - let genesis_block = test_data::genesis(); - let block2 = test_data::block_h2(); - let tx1: Transaction = test_data::TransactionBuilder::with_version(1).into(); - let tx2: Transaction = - test_data::TransactionBuilder::with_input(&test_data::block_h1().transactions[0], 0) - .into(); + let genesis_block = zebra_test_data::genesis(); + let block2 = zebra_test_data::block_h2(); + let tx1: Transaction = zebra_test_data::TransactionBuilder::with_version(1).into(); + let tx2: Transaction = zebra_test_data::TransactionBuilder::with_input( + &zebra_test_data::block_h1().transactions[0], + 0, + ) + .into(); let tx1_hash = tx1.hash(); let tx2_hash = tx2.hash(); chain.verify_transaction(tx1.into()); @@ -1171,7 +1176,7 @@ mod tests { #[test] fn chain_block_transaction_is_removed_from_on_block_insert() { - let b0 = test_data::block_builder() + let b0 = zebra_test_data::block_builder() .header() .build() .transaction() @@ -1181,7 +1186,7 @@ mod tests { .build() .build() .build(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() @@ -1221,8 +1226,8 @@ mod tests { #[test] fn chain_forget_verifying_transaction_with_children() { - let test_chain = &mut test_data::ChainBuilder::new(); - test_data::TransactionBuilder::with_output(100) + let test_chain = &mut zebra_test_data::ChainBuilder::new(); + zebra_test_data::TransactionBuilder::with_output(100) .store(test_chain) // t1 .into_input(0) .add_output(200) @@ -1235,7 +1240,7 @@ mod tests { .store(test_chain); // t4 let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let mut chain = Chain::new(db, Arc::new(RwLock::new(MemoryPool::new()))); chain.verify_transaction(test_chain.at(0).into()); @@ -1252,10 +1257,10 @@ mod tests { #[test] fn chain_transactions_hashes_with_state() { - let input_tx1 = test_data::block_h1().transactions[0].clone(); - let input_tx2 = test_data::block_h2().transactions[0].clone(); - let test_chain = &mut test_data::ChainBuilder::new(); - test_data::TransactionBuilder::with_input(&input_tx1, 0) + let input_tx1 = zebra_test_data::block_h1().transactions[0].clone(); + let input_tx2 = zebra_test_data::block_h2().transactions[0].clone(); + let test_chain = &mut zebra_test_data::ChainBuilder::new(); + zebra_test_data::TransactionBuilder::with_input(&input_tx1, 0) .add_output(1_000) .store(test_chain) // t1 .into_input(0) @@ -1269,9 +1274,9 @@ mod tests { .store(test_chain); // t4 let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), - test_data::block_h1().into(), - test_data::block_h2().into(), + zebra_test_data::genesis().into(), + zebra_test_data::block_h1().into(), + zebra_test_data::block_h2().into(), ])); let mut chain = Chain::new(db, Arc::new(RwLock::new(MemoryPool::new()))); chain.insert_verified_transaction(test_chain.at(0).into()); @@ -1288,7 +1293,7 @@ mod tests { #[test] fn memory_pool_transactions_are_reverified_after_reorganization() { - let b0 = test_data::block_builder() + let b0 = zebra_test_data::block_builder() .header() .build() .transaction() @@ -1298,30 +1303,30 @@ mod tests { .build() .build() .build(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .nonce(1.into()) .parent(b0.hash()) .build() .build(); - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .nonce(2.into()) .parent(b0.hash()) .build() .build(); - let b3 = test_data::block_builder() + let b3 = zebra_test_data::block_builder() .header() .parent(b2.hash()) .build() .build(); let input_tx = b0.transactions[0].clone(); - let tx1: Transaction = test_data::TransactionBuilder::with_version(1) + let tx1: Transaction = zebra_test_data::TransactionBuilder::with_version(1) .set_input(&input_tx, 0) .into(); let tx1_hash = tx1.hash(); - let tx2: Transaction = test_data::TransactionBuilder::with_input(&input_tx, 0).into(); + let tx2: Transaction = zebra_test_data::TransactionBuilder::with_input(&input_tx, 0).into(); let tx2_hash = tx2.hash(); let db = Arc::new(BlockChainDatabase::init_test_chain(vec![b0.into()])); @@ -1352,14 +1357,14 @@ mod tests { #[test] fn fork_chain_block_transaction_is_removed_from_on_block_insert() { - let genesis = test_data::block_h1(); + let genesis = zebra_test_data::block_h1(); let input_tx = genesis.transactions[0].clone(); - let b0 = test_data::block_builder() + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); // genesis -> b0 - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .nonce(1.into()) .parent(b0.hash()) @@ -1370,7 +1375,7 @@ mod tests { .build() .build() .build(); // genesis -> b0 -> b1[tx1] - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() @@ -1380,7 +1385,7 @@ mod tests { .build() .build() .build(); // genesis -> b0 -> b1[tx1] -> b2[tx2] - let b3 = test_data::block_builder() + let b3 = zebra_test_data::block_builder() .header() .nonce(2.into()) .parent(b0.hash()) @@ -1395,7 +1400,7 @@ mod tests { .build() .build() .build(); // genesis -> b0 -> b3[tx3] - let b4 = test_data::block_builder() + let b4 = zebra_test_data::block_builder() .header() .parent(b3.hash()) .build() @@ -1409,7 +1414,7 @@ mod tests { .build() .build() .build(); // genesis -> b0 -> b3[tx3] -> b4[tx4] - let b5 = test_data::block_builder() + let b5 = zebra_test_data::block_builder() .header() .parent(b4.hash()) .build() @@ -1433,7 +1438,7 @@ mod tests { let tx5 = b5.transactions[0].clone(); let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), genesis.into(), ])); let mut chain = Chain::new(db, Arc::new(RwLock::new(MemoryPool::new()))); @@ -1497,9 +1502,9 @@ mod tests { #[test] fn double_spend_transaction_is_removed_from_memory_pool_when_output_is_spent_in_block_transaction( ) { - let genesis = test_data::genesis(); + let genesis = zebra_test_data::genesis(); let tx0 = genesis.transactions[0].clone(); - let b0 = test_data::block_builder() + let b0 = zebra_test_data::block_builder() .header() .nonce(1.into()) .parent(genesis.hash()) @@ -1513,13 +1518,13 @@ mod tests { .build() .build(); // genesis -> b0[tx1] // tx from b0 && tx2 are spending same output - let tx2: Transaction = test_data::TransactionBuilder::with_output(20) + let tx2: Transaction = zebra_test_data::TransactionBuilder::with_output(20) .add_input(&tx0, 0) .into(); // insert tx2 to memory pool let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let mut chain = Chain::new(db, Arc::new(RwLock::new(MemoryPool::new()))); chain.insert_verified_transaction(tx2.clone().into()); @@ -1531,9 +1536,9 @@ mod tests { #[test] fn update_memory_pool_transaction() { - use self::test_data::{ChainBuilder, TransactionBuilder}; + use self::zebra_test_data::{ChainBuilder, TransactionBuilder}; - let input_tx = test_data::block_h1().transactions[0].clone(); + let input_tx = zebra_test_data::block_h1().transactions[0].clone(); let data_chain = &mut ChainBuilder::new(); TransactionBuilder::with_input(&input_tx, 0) .set_output(100) @@ -1549,8 +1554,8 @@ mod tests { .store(data_chain); // transaction0 -> transaction2 let db = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), - test_data::block_h1().into(), + zebra_test_data::genesis().into(), + zebra_test_data::block_h1().into(), ])); let mut chain = Chain::new(db, Arc::new(RwLock::new(MemoryPool::new()))); chain.insert_verified_transaction(data_chain.at(0).into()); diff --git a/sync/src/synchronization_client.rs b/sync/src/synchronization_client.rs index 05559106..295ae24b 100644 --- a/sync/src/synchronization_client.rs +++ b/sync/src/synchronization_client.rs @@ -1,11 +1,11 @@ -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; -use message::types; use parking_lot::Mutex; use std::sync::Arc; use synchronization_client_core::{ClientCore, SynchronizationClientCore}; use synchronization_executor::TaskExecutor; use synchronization_verifier::{TransactionVerificationSink, Verifier}; use types::{ClientCoreRef, EmptyBoxFuture, PeerIndex, SyncListenerRef, SynchronizationStateRef}; +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; +use zebra_message::types; #[cfg_attr(feature = "cargo-clippy", allow(doc_markdown))] ///! TODO: update with headers-first corrections diff --git a/sync/src/synchronization_client_core.rs b/sync/src/synchronization_client_core.rs index 206be436..89690b2d 100644 --- a/sync/src/synchronization_client_core.rs +++ b/sync/src/synchronization_client_core.rs @@ -1,10 +1,5 @@ -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; use futures::Future; -use message::common::{InventoryType, InventoryVector}; -use message::types; -use miner::transaction_fee_rate; use parking_lot::Mutex; -use primitives::hash::H256; use rand::{thread_rng, Rng}; use std::cmp::{max, min}; use std::collections::hash_map::Entry; @@ -28,6 +23,11 @@ use types::{ SynchronizationStateRef, }; use utils::{AverageSpeedMeter, HashPosition, OrphanBlocksPool, OrphanTransactionsPool}; +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; +use zebra_message::common::{InventoryType, InventoryVector}; +use zebra_message::types; +use zebra_miner::transaction_fee_rate; +use zebra_primitives::hash::H256; /// Approximate maximal number of blocks hashes in scheduled queue. const MAX_SCHEDULED_HASHES: BlockHeight = 4 * 1024; @@ -1628,19 +1628,12 @@ impl Default for BlocksRequestLimits { #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::super::SyncListener; use super::{ClientCore, Config, CoreVerificationSink, SynchronizationClientCore}; - use chain::{Block, IndexedBlock, Transaction}; - use db::BlockChainDatabase; use inbound_connection::tests::DummyOutboundSyncConnection; - use message::common::InventoryVector; - use message::{types, Services}; - use miner::MemoryPool; - use network::{ConsensusParams, Network}; use parking_lot::{Mutex, RwLock}; - use primitives::hash::H256; use std::sync::Arc; use synchronization_chain::{BlockState, Chain}; use synchronization_client::{Client, SynchronizationClient}; @@ -1650,7 +1643,14 @@ pub mod tests { use synchronization_verifier::tests::DummyVerifier; use types::{ClientCoreRef, PeerIndex, StorageRef, SynchronizationStateRef}; use utils::SynchronizationState; - use verification::BackwardsCompatibleChainVerifier as ChainVerifier; + use zebra_chain::{Block, IndexedBlock, Transaction}; + use zebra_db::BlockChainDatabase; + use zebra_message::common::InventoryVector; + use zebra_message::{types, Services}; + use zebra_miner::MemoryPool; + use zebra_network::{ConsensusParams, Network}; + use zebra_primitives::hash::H256; + use zebra_verification::BackwardsCompatibleChainVerifier as ChainVerifier; #[derive(Default)] struct DummySyncListenerData { @@ -1680,8 +1680,8 @@ pub mod tests { fn storage_with_block1() -> StorageRef { Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), - test_data::block_h1().into(), + zebra_test_data::genesis().into(), + zebra_test_data::block_h1().into(), ])) } @@ -1697,7 +1697,7 @@ pub mod tests { let storage = match storage { Some(storage) => storage, None => Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])), }; let sync_state = @@ -1740,12 +1740,12 @@ pub mod tests { fn request_block_headers_genesis(peer_index: PeerIndex) -> Task { Task::GetHeaders( peer_index, - types::GetHeaders::with_block_locator_hashes(vec![test_data::genesis().hash()]), + types::GetHeaders::with_block_locator_hashes(vec![zebra_test_data::genesis().hash()]), ) } fn request_block_headers_genesis_and(peer_index: PeerIndex, mut hashes: Vec) -> Task { - hashes.push(test_data::genesis().hash()); + hashes.push(zebra_test_data::genesis().hash()); Task::GetHeaders( peer_index, types::GetHeaders::with_block_locator_hashes(hashes), @@ -1784,8 +1784,8 @@ pub mod tests { fn synchronization_in_order_block_path_nearly_saturated() { let (executor, core, sync) = create_sync(None, None); - let block1: Block = test_data::block_h1(); - let block2: Block = test_data::block_h2(); + let block1: Block = zebra_test_data::block_h1(); + let block2: Block = zebra_test_data::block_h2(); sync.on_headers(5, vec![block1.block_header.clone().into()]); let tasks = executor.take_tasks(); @@ -1833,11 +1833,11 @@ pub mod tests { sync.on_headers( 5, vec![ - test_data::block_h1().block_header.into(), - test_data::block_h2().block_header.into(), + zebra_test_data::block_h1().block_header.into(), + zebra_test_data::block_h2().block_header.into(), ], ); - sync.on_block(5, test_data::block_h169().into()); + sync.on_block(5, zebra_test_data::block_h169().into()); // out-of-order block was presented by the peer assert!(core.lock().information().state.is_synchronizing()); @@ -1855,8 +1855,8 @@ pub mod tests { fn synchronization_parallel_peers() { let (executor, core, sync) = create_sync(None, None); - let block1: Block = test_data::block_h1(); - let block2: Block = test_data::block_h2(); + let block1: Block = zebra_test_data::block_h1(); + let block2: Block = zebra_test_data::block_h2(); { // not synchronizing after start @@ -1921,7 +1921,7 @@ pub mod tests { // request new blocks { - sync.on_headers(1, vec![test_data::block_h1().block_header.into()]); + sync.on_headers(1, vec![zebra_test_data::block_h1().block_header.into()]); assert!(core.lock().information().state.is_nearly_saturated()); } @@ -1936,7 +1936,7 @@ pub mod tests { fn synchronization_not_starting_when_receiving_known_blocks() { let (executor, core, sync) = create_sync(None, None); // saturated => receive inventory with known blocks only - sync.on_headers(1, vec![test_data::genesis().block_header.into()]); + sync.on_headers(1, vec![zebra_test_data::genesis().block_header.into()]); // => no need to start synchronization assert!(!core.lock().information().state.is_nearly_saturated()); // => no synchronization tasks are scheduled @@ -1947,7 +1947,7 @@ pub mod tests { #[test] fn synchronization_asks_for_inventory_after_saturating() { let (executor, _, sync) = create_sync(None, None); - let block = test_data::block_h1(); + let block = zebra_test_data::block_h1(); sync.on_headers(1, vec![block.block_header.clone().into()]); sync.on_headers(2, vec![block.block_header.clone().into()]); executor.take_tasks(); @@ -1972,8 +1972,8 @@ pub mod tests { fn synchronization_remembers_correct_block_headers_in_order() { let (executor, core, sync) = create_sync(None, None); - let b1 = test_data::block_h1(); - let b2 = test_data::block_h2(); + let b1 = zebra_test_data::block_h1(); + let b2 = zebra_test_data::block_h2(); sync.on_headers( 1, vec![ @@ -2033,8 +2033,8 @@ pub mod tests { fn synchronization_remembers_correct_block_headers_out_of_order() { let (executor, core, sync) = create_sync(None, None); - let b1 = test_data::block_h1(); - let b2 = test_data::block_h2(); + let b1 = zebra_test_data::block_h1(); + let b2 = zebra_test_data::block_h2(); sync.on_headers( 1, vec![ @@ -2094,7 +2094,7 @@ pub mod tests { fn synchronization_ignores_unknown_block_headers() { let (executor, core, sync) = create_sync(None, None); - let b169 = test_data::block_h169(); + let b169 = zebra_test_data::block_h169(); sync.on_headers(1, vec![b169.block_header.into()]); let tasks = executor.take_tasks(); @@ -2108,15 +2108,15 @@ pub mod tests { #[test] fn synchronization_works_for_forks_from_db_best_block() { - let genesis = test_data::genesis(); + let genesis = zebra_test_data::genesis(); let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let (executor, core, sync) = create_sync(Some(storage), None); let genesis_header = &genesis.block_header; - let fork1 = test_data::build_n_empty_blocks_from(2, 100, &genesis_header); - let fork2 = test_data::build_n_empty_blocks_from(3, 200, &genesis_header); + let fork1 = zebra_test_data::build_n_empty_blocks_from(2, 100, &genesis_header); + let fork2 = zebra_test_data::build_n_empty_blocks_from(3, 200, &genesis_header); sync.on_headers( 1, @@ -2197,19 +2197,19 @@ pub mod tests { #[test] fn synchronization_works_for_forks_long_after_short() { - let genesis = test_data::genesis(); + let genesis = zebra_test_data::genesis(); let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let (executor, core, sync) = create_sync(Some(storage), None); - let common_block = test_data::block_builder() + let common_block = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); - let fork1 = test_data::build_n_empty_blocks_from(2, 100, &common_block.block_header); - let fork2 = test_data::build_n_empty_blocks_from(3, 200, &common_block.block_header); + let fork1 = zebra_test_data::build_n_empty_blocks_from(2, 100, &common_block.block_header); + let fork2 = zebra_test_data::build_n_empty_blocks_from(3, 200, &common_block.block_header); sync.on_headers( 1, @@ -2284,7 +2284,7 @@ pub mod tests { fn accept_out_of_order_blocks_when_saturated() { let (_, core, sync) = create_sync(None, None); - sync.on_block(1, test_data::block_h2().into()); + sync.on_block(1, zebra_test_data::block_h2().into()); assert_eq!(core.lock().information().orphaned_blocks, 1); { @@ -2293,7 +2293,7 @@ pub mod tests { assert_eq!(chain.best_storage_block().number, 0); } - sync.on_block(1, test_data::block_h1().into()); + sync.on_block(1, zebra_test_data::block_h1().into()); assert_eq!(core.lock().information().orphaned_blocks, 0); { @@ -2307,12 +2307,12 @@ pub mod tests { fn do_not_rerequest_unknown_block_in_inventory() { let (executor, _, sync) = create_sync(None, None); - sync.on_block(1, test_data::block_h2().into()); + sync.on_block(1, zebra_test_data::block_h2().into()); sync.on_inventory( 1, types::Inv::with_inventory(vec![ - InventoryVector::block(test_data::block_h1().hash()), - InventoryVector::block(test_data::block_h2().hash()), + InventoryVector::block(zebra_test_data::block_h1().hash()), + InventoryVector::block(zebra_test_data::block_h2().hash()), ]), ); @@ -2322,7 +2322,7 @@ pub mod tests { vec![Task::GetData( 1, types::GetData::with_inventory(vec![InventoryVector::block( - test_data::block_h1().hash() + zebra_test_data::block_h1().hash() )]) )] ); @@ -2332,8 +2332,8 @@ pub mod tests { fn blocks_rerequested_on_peer_disconnect() { let (executor, _, sync) = create_sync(None, None); - let block1: Block = test_data::block_h1(); - let block2: Block = test_data::block_h2(); + let block1: Block = zebra_test_data::block_h1(); + let block2: Block = zebra_test_data::block_h2(); { // receive inventory from new peer#1 @@ -2383,9 +2383,9 @@ pub mod tests { #[test] fn sync_after_db_insert_nonfatal_fail() { - let block = test_data::block_h2(); - let storage = BlockChainDatabase::init_test_chain(vec![test_data::genesis().into()]); - assert!(storage.insert(test_data::block_h2().into()).is_err()); + let block = zebra_test_data::block_h2(); + let storage = BlockChainDatabase::init_test_chain(vec![zebra_test_data::genesis().into()]); + assert!(storage.insert(zebra_test_data::block_h2().into()).is_err()); let best_genesis = storage.best_block(); let (_, core, sync) = create_sync(Some(Arc::new(storage)), None); @@ -2401,8 +2401,8 @@ pub mod tests { fn peer_removed_from_sync_after_responding_with_requested_block_notfound() { let (executor, core, sync) = create_sync(None, None); - let b1 = test_data::block_h1(); - let b2 = test_data::block_h2(); + let b1 = zebra_test_data::block_h1(); + let b2 = zebra_test_data::block_h2(); sync.on_headers( 1, vec![ @@ -2444,8 +2444,8 @@ pub mod tests { fn peer_not_removed_from_sync_after_responding_with_non_requested_block_notfound() { let (executor, core, sync) = create_sync(None, None); - let b1 = test_data::block_h1(); - let b2 = test_data::block_h2(); + let b1 = zebra_test_data::block_h1(); + let b2 = zebra_test_data::block_h2(); sync.on_headers( 1, vec![ @@ -2470,7 +2470,7 @@ pub mod tests { sync.on_notfound( 1, types::NotFound::with_inventory(vec![InventoryVector::block( - test_data::block_h170().hash(), + zebra_test_data::block_h170().hash(), )]), ); @@ -2502,7 +2502,7 @@ pub mod tests { ); } - let b1 = test_data::block_h1(); + let b1 = zebra_test_data::block_h1(); sync.on_headers(1, vec![b1.block_header.clone().into()]); assert!(core.lock().information().state.is_nearly_saturated()); @@ -2565,7 +2565,7 @@ pub mod tests { sync.on_inventory( 0, types::Inv::with_inventory(vec![ - InventoryVector::tx(test_data::genesis().transactions[0].hash()), + InventoryVector::tx(zebra_test_data::genesis().transactions[0].hash()), InventoryVector::tx(H256::from(0)), ]), ); @@ -2582,8 +2582,8 @@ pub mod tests { fn transaction_is_not_accepted_when_synchronizing() { let (_, core, sync) = create_sync(None, None); - let b1 = test_data::block_h1(); - let b2 = test_data::block_h2(); + let b1 = zebra_test_data::block_h1(); + let b2 = zebra_test_data::block_h2(); sync.on_headers(1, vec![b1.block_header.into(), b2.block_header.into()]); assert!(core.lock().information().state.is_synchronizing()); @@ -2603,9 +2603,9 @@ pub mod tests { #[test] fn transaction_is_accepted_when_not_synchronizing() { let (_, core, sync) = create_sync(Some(storage_with_block1()), None); - let input_tx = test_data::block_h1().transactions[0].clone(); + let input_tx = zebra_test_data::block_h1().transactions[0].clone(); - let tx1: Transaction = test_data::TransactionBuilder::with_input(&input_tx, 0) + let tx1: Transaction = zebra_test_data::TransactionBuilder::with_input(&input_tx, 0) .set_output(100) .into(); sync.on_transaction(1, tx1.clone().into()); @@ -2618,12 +2618,15 @@ pub mod tests { 1 ); - let b2 = test_data::block_h2(); + let b2 = zebra_test_data::block_h2(); sync.on_headers(1, vec![b2.block_header.into()]); assert!(core.lock().information().state.is_nearly_saturated()); - sync.on_transaction(1, test_data::TransactionBuilder::with_input(&tx1, 0).into()); + sync.on_transaction( + 1, + zebra_test_data::TransactionBuilder::with_input(&tx1, 0).into(), + ); assert_eq!( core.lock() .information() @@ -2640,7 +2643,7 @@ pub mod tests { sync.on_transaction( 1, - test_data::TransactionBuilder::with_default_input(0).into(), + zebra_test_data::TransactionBuilder::with_default_input(0).into(), ); assert_eq!( core.lock() @@ -2655,9 +2658,9 @@ pub mod tests { #[test] fn orphaned_transaction_is_verified_when_input_is_received() { - let input_tx = test_data::block_h1().transactions[0].clone(); - let chain = &mut test_data::ChainBuilder::new(); - test_data::TransactionBuilder::with_input(&input_tx, 0) + let input_tx = zebra_test_data::block_h1().transactions[0].clone(); + let chain = &mut zebra_test_data::ChainBuilder::new(); + zebra_test_data::TransactionBuilder::with_input(&input_tx, 0) .set_output(100) .store(chain) // t0 .set_input(&chain.at(0), 0) @@ -2707,37 +2710,37 @@ pub mod tests { // => do not trust first intersection point - check each hash when scheduling hashes. // If at least one hash is known => previous verification failed => drop all headers. - let genesis = test_data::genesis(); - let b10 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b10 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); - let b11 = test_data::block_builder() + let b11 = zebra_test_data::block_builder() .header() .nonce(1.into()) .parent(b10.hash()) .build() .build(); - let b12 = test_data::block_builder() + let b12 = zebra_test_data::block_builder() .header() .parent(b11.hash()) .build() .build(); - let b21 = test_data::block_builder() + let b21 = zebra_test_data::block_builder() .header() .nonce(2.into()) .parent(b10.hash()) .build() .build(); - let b22 = test_data::block_builder() + let b22 = zebra_test_data::block_builder() .header() .parent(b21.hash()) .build() .build(); - let b23 = test_data::block_builder() + let b23 = zebra_test_data::block_builder() .header() .parent(b22.hash()) .build() @@ -2787,23 +2790,23 @@ pub mod tests { #[test] fn relay_new_block_when_in_saturated_state() { let (executor, _, sync) = create_sync(None, None); - let genesis = test_data::genesis(); - let b0 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() .build(); - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() .build(); - let b3 = test_data::block_builder() + let b3 = zebra_test_data::block_builder() .header() .parent(b2.hash()) .build() @@ -2863,7 +2866,7 @@ pub mod tests { fn relay_new_transaction_when_in_saturated_state() { let (executor, _, sync) = create_sync(None, None); - let tx: Transaction = test_data::TransactionBuilder::with_output(20).into(); + let tx: Transaction = zebra_test_data::TransactionBuilder::with_output(20).into(); sync.on_connect(1); executor.take_tasks(); @@ -2878,15 +2881,15 @@ pub mod tests { fn receive_same_unknown_block_twice() { let (_, _, sync) = create_sync(None, None); - sync.on_block(1, test_data::block_h2().into()); + sync.on_block(1, zebra_test_data::block_h2().into()); // should not panic here - sync.on_block(2, test_data::block_h2().into()); + sync.on_block(2, zebra_test_data::block_h2().into()); } #[test] fn collection_closed_on_block_verification_error() { - let genesis = test_data::genesis(); - let b0 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() @@ -2910,18 +2913,18 @@ pub mod tests { #[test] fn collection_closed_on_begin_dead_end_block_header() { - let genesis = test_data::genesis(); - let b0 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() .build(); - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() @@ -2953,18 +2956,18 @@ pub mod tests { #[test] fn collection_closed_on_in_middle_dead_end_block_header() { - let genesis = test_data::genesis(); - let b0 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() .build(); - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() @@ -2997,8 +3000,8 @@ pub mod tests { #[test] fn collection_closed_on_providing_dead_end_block() { - let genesis = test_data::genesis(); - let b0 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() @@ -3023,13 +3026,13 @@ pub mod tests { #[test] fn collection_closed_on_providing_child_dead_end_block() { - let genesis = test_data::genesis(); - let b0 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() @@ -3054,18 +3057,18 @@ pub mod tests { #[test] fn when_peer_does_not_respond_to_block_requests() { - let genesis = test_data::genesis(); - let b0 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b0 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); // block we will stuck with - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() .build(); // another branch - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() @@ -3112,7 +3115,7 @@ pub mod tests { sync.on_transaction( 1, - test_data::TransactionBuilder::with_default_input(0).into(), + zebra_test_data::TransactionBuilder::with_default_input(0).into(), ); assert_eq!( core.lock() @@ -3127,7 +3130,7 @@ pub mod tests { // should not panic sync.on_transaction( 1, - test_data::TransactionBuilder::with_default_input(0).into(), + zebra_test_data::TransactionBuilder::with_default_input(0).into(), ); } @@ -3140,7 +3143,7 @@ pub mod tests { fn when_transaction_double_spends_during_reorg() { let consensus = ConsensusParams::new(Network::Unitest); - let b0 = test_data::block_builder() + let b0 = zebra_test_data::block_builder() .header() .build() .transaction() @@ -3172,7 +3175,7 @@ pub mod tests { .build(); // in-storage spends b0[1] && b0[2] - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .transaction() .coinbase() .founder_reward(&consensus, 1) @@ -3206,7 +3209,7 @@ pub mod tests { .build(); // in-memory spends b0[3] // in-memory spends b0[4] - let future_block = test_data::block_builder() + let future_block = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() @@ -3235,7 +3238,7 @@ pub mod tests { let tx3: Transaction = future_block.transactions[1].clone(); // in-storage [side] spends b0[3] - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() @@ -3258,7 +3261,7 @@ pub mod tests { .build() .build(); // in-storage [causes reorg to b2 + b3] spends b0[1] - let b3 = test_data::block_builder() + let b3 = zebra_test_data::block_builder() .transaction() .coinbase() .founder_reward(&consensus, 2) @@ -3349,7 +3352,7 @@ pub mod tests { assert_eq!(data.lock().best_blocks.len(), 0); // supply with new block header => is_synchronizing is still false - sync.on_headers(0, vec![test_data::block_h1().block_header.into()]); + sync.on_headers(0, vec![zebra_test_data::block_h1().block_header.into()]); assert_eq!(data.lock().is_synchronizing, false); assert_eq!(data.lock().best_blocks.len(), 0); @@ -3357,25 +3360,25 @@ pub mod tests { sync.on_headers( 0, vec![ - test_data::block_h2().block_header.into(), - test_data::block_h3().block_header.into(), + zebra_test_data::block_h2().block_header.into(), + zebra_test_data::block_h3().block_header.into(), ], ); assert_eq!(data.lock().is_synchronizing, true); assert_eq!(data.lock().best_blocks.len(), 0); // supply with block 3 => no new best block is informed - sync.on_block(0, test_data::block_h3().into()); + sync.on_block(0, zebra_test_data::block_h3().into()); assert_eq!(data.lock().is_synchronizing, true); assert_eq!(data.lock().best_blocks.len(), 0); // supply with block 1 => new best block is informed - sync.on_block(0, test_data::block_h1().into()); + sync.on_block(0, zebra_test_data::block_h1().into()); assert_eq!(data.lock().is_synchronizing, true); assert_eq!(data.lock().best_blocks.len(), 1); // supply with block 2 => 2 new best block is informed - sync.on_block(0, test_data::block_h2().into()); + sync.on_block(0, zebra_test_data::block_h2().into()); assert_eq!(data.lock().is_synchronizing, false); assert_eq!(data.lock().best_blocks.len(), 3); } @@ -3385,8 +3388,8 @@ pub mod tests { let (_, sync, _) = create_sync(None, None); let mut sync = sync.lock(); - let block1: IndexedBlock = test_data::block_h1().into(); - let block2: IndexedBlock = test_data::block_h2().into(); + let block1: IndexedBlock = zebra_test_data::block_h1().into(); + let block2: IndexedBlock = zebra_test_data::block_h2().into(); let header1 = block1.header.clone(); let header2 = block2.header.clone(); let hash1 = *block1.hash(); diff --git a/sync/src/synchronization_executor.rs b/sync/src/synchronization_executor.rs index 9625fcda..9d12b300 100644 --- a/sync/src/synchronization_executor.rs +++ b/sync/src/synchronization_executor.rs @@ -1,11 +1,11 @@ -use chain::{IndexedBlock, IndexedTransaction}; -use message::common::InventoryVector; -use message::types; -use primitives::hash::H256; use std::sync::Arc; use synchronization_peers::{BlockAnnouncementType, TransactionAnnouncementType}; use types::{PeerIndex, PeersRef, RequestId}; use utils::KnownHashType; +use zebra_chain::{IndexedBlock, IndexedTransaction}; +use zebra_message::common::InventoryVector; +use zebra_message::types; +use zebra_primitives::hash::H256; /// Synchronization task executor pub trait TaskExecutor: Send + Sync + 'static { @@ -215,19 +215,19 @@ impl TaskExecutor for LocalSynchronizationTaskExecutor { #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::*; - use chain::Transaction; use inbound_connection::tests::DummyOutboundSyncConnection; use local_node::tests::{default_filterload, make_filteradd}; - use message::{types, Services}; use parking_lot::{Condvar, Mutex}; use std::sync::Arc; use std::time; use synchronization_peers::{ BlockAnnouncementType, PeersContainer, PeersFilters, PeersImpl, PeersOptions, }; + use zebra_chain::Transaction; + use zebra_message::{types, Services}; pub struct DummyTaskExecutor { tasks: Mutex>, @@ -284,7 +284,7 @@ pub mod tests { peers.insert(2, Services::default(), c2.clone()); peers.set_block_announcement_type(2, BlockAnnouncementType::SendHeaders); - executor.execute(Task::RelayNewBlock(test_data::genesis().into())); + executor.execute(Task::RelayNewBlock(zebra_test_data::genesis().into())); assert_eq!( *c1.messages .lock() @@ -303,9 +303,9 @@ pub mod tests { let peers = Arc::new(PeersImpl::default()); let executor = LocalSynchronizationTaskExecutor::new(peers.clone()); - let tx1: Transaction = test_data::TransactionBuilder::with_output(10).into(); - let tx2: Transaction = test_data::TransactionBuilder::with_output(20).into(); - let tx3: Transaction = test_data::TransactionBuilder::with_output(30).into(); + let tx1: Transaction = zebra_test_data::TransactionBuilder::with_output(10).into(); + let tx2: Transaction = zebra_test_data::TransactionBuilder::with_output(20).into(); + let tx3: Transaction = zebra_test_data::TransactionBuilder::with_output(30).into(); let tx1_hash = tx1.hash(); let tx2_hash = tx2.hash(); let tx3_hash = tx3.hash(); @@ -415,7 +415,7 @@ pub mod tests { peers.insert(4, Services::default(), c4.clone()); executor.execute(Task::RelayNewTransaction( - test_data::genesis().transactions[0].clone().into(), + zebra_test_data::genesis().transactions[0].clone().into(), 3500, )); diff --git a/sync/src/synchronization_manager.rs b/sync/src/synchronization_manager.rs index 2af9cd4d..db00ac32 100644 --- a/sync/src/synchronization_manager.rs +++ b/sync/src/synchronization_manager.rs @@ -1,5 +1,4 @@ use parking_lot::{Condvar, Mutex}; -use primitives::hash::H256; use std::collections::HashSet; use std::sync::{Arc, Weak}; use std::thread; @@ -10,6 +9,7 @@ use synchronization_peers_tasks::{PeersTasks, TrustLevel}; use time::precise_time_s; use types::PeersRef; use utils::{OrphanBlocksPool, OrphanTransactionsPool}; +use zebra_primitives::hash::H256; /// Management interval (in ms) const MANAGEMENT_INTERVAL_MS: u64 = 10 * 1000; @@ -396,19 +396,19 @@ pub fn manage_orphaned_transactions( #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{ manage_orphaned_transactions, manage_synchronization_peers_blocks, manage_unknown_orphaned_blocks, ManageOrphanTransactionsConfig, ManagePeersConfig, ManageUnknownBlocksConfig, }; - use primitives::hash::H256; use std::collections::HashSet; use std::sync::Arc; use synchronization_peers::PeersImpl; use synchronization_peers_tasks::{PeersTasks, TrustLevel}; use utils::{OrphanBlocksPool, OrphanTransactionsPool}; + use zebra_primitives::hash::H256; #[test] fn manage_good_peer() { @@ -472,7 +472,7 @@ mod tests { max_number: 100, }; let mut pool = OrphanBlocksPool::new(); - let block = test_data::genesis(); + let block = zebra_test_data::genesis(); pool.insert_unknown_block(block.into()); assert_eq!(manage_unknown_orphaned_blocks(&config, &mut pool), None); assert_eq!(pool.len(), 1); @@ -487,7 +487,7 @@ mod tests { max_number: 100, }; let mut pool = OrphanBlocksPool::new(); - let block = test_data::genesis(); + let block = zebra_test_data::genesis(); let block_hash = block.hash(); pool.insert_unknown_block(block.into()); sleep(Duration::from_millis(1)); @@ -506,9 +506,9 @@ mod tests { max_number: 1, }; let mut pool = OrphanBlocksPool::new(); - let block1 = test_data::genesis(); + let block1 = zebra_test_data::genesis(); let block1_hash = block1.hash(); - let block2 = test_data::block_h2(); + let block2 = zebra_test_data::block_h2(); pool.insert_unknown_block(block1.into()); pool.insert_unknown_block(block2.into()); assert_eq!( @@ -525,7 +525,7 @@ mod tests { max_number: 100, }; let mut pool = OrphanTransactionsPool::new(); - let transaction = test_data::block_h522().transactions[3].clone(); + let transaction = zebra_test_data::block_h522().transactions[3].clone(); let unknown_inputs: HashSet = transaction .inputs .iter() @@ -545,7 +545,7 @@ mod tests { max_number: 100, }; let mut pool = OrphanTransactionsPool::new(); - let transaction = test_data::block_h522().transactions[3].clone(); + let transaction = zebra_test_data::block_h522().transactions[3].clone(); let unknown_inputs: HashSet = transaction .inputs .iter() @@ -569,14 +569,14 @@ mod tests { max_number: 1, }; let mut pool = OrphanTransactionsPool::new(); - let transaction1 = test_data::block_h522().transactions[3].clone(); + let transaction1 = zebra_test_data::block_h522().transactions[3].clone(); let unknown_inputs1: HashSet = transaction1 .inputs .iter() .map(|i| i.previous_output.hash.clone()) .collect(); let transaction1_hash = transaction1.hash(); - let transaction2 = test_data::block_h567().transactions[1].clone(); + let transaction2 = zebra_test_data::block_h567().transactions[1].clone(); let unknown_inputs2: HashSet = transaction2 .inputs .iter() diff --git a/sync/src/synchronization_peers.rs b/sync/src/synchronization_peers.rs index 8ad8f780..64f8187c 100644 --- a/sync/src/synchronization_peers.rs +++ b/sync/src/synchronization_peers.rs @@ -1,11 +1,11 @@ -use chain::{IndexedBlock, IndexedTransaction}; -use message::{types, Services}; -use p2p::OutboundSyncConnectionRef; use parking_lot::RwLock; -use primitives::hash::H256; use std::collections::HashMap; use types::PeerIndex; use utils::{ConnectionFilter, KnownHashType}; +use zebra_chain::{IndexedBlock, IndexedTransaction}; +use zebra_message::{types, Services}; +use zebra_p2p::OutboundSyncConnectionRef; +use zebra_primitives::hash::H256; /// Block announcement type #[derive(Debug, Clone, Copy)] diff --git a/sync/src/synchronization_peers_tasks.rs b/sync/src/synchronization_peers_tasks.rs index e1b1b3d8..c4d0f173 100644 --- a/sync/src/synchronization_peers_tasks.rs +++ b/sync/src/synchronization_peers_tasks.rs @@ -1,11 +1,11 @@ use linked_hash_map::LinkedHashMap; -use primitives::hash::H256; use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use std::fmt; use time::precise_time_s; use types::PeerIndex; use utils::AverageSpeedMeter; +use zebra_primitives::hash::H256; /// Max peer failures # before excluding from sync process const MAX_PEER_FAILURES: usize = 4; @@ -427,8 +427,8 @@ impl fmt::Debug for Information { #[cfg(test)] mod tests { use super::{PeersTasks, MAX_BLOCKS_FAILURES, MAX_PEER_FAILURES}; - use primitives::hash::H256; use types::PeerIndex; + use zebra_primitives::hash::H256; #[test] fn peers_empty_on_start() { diff --git a/sync/src/synchronization_server.rs b/sync/src/synchronization_server.rs index 75aee852..415fd28a 100644 --- a/sync/src/synchronization_server.rs +++ b/sync/src/synchronization_server.rs @@ -1,7 +1,4 @@ -use chain::IndexedTransaction; -use message::{common, types}; use parking_lot::{Condvar, Mutex}; -use primitives::hash::H256; use std::collections::hash_map::Entry; use std::collections::{HashMap, VecDeque}; use std::sync::atomic::{AtomicBool, Ordering}; @@ -9,6 +6,9 @@ use std::sync::Arc; use std::thread; use synchronization_executor::{Task, TaskExecutor}; use types::{BlockHeight, ExecutorRef, MemoryPoolRef, PeerIndex, PeersRef, RequestId, StorageRef}; +use zebra_chain::IndexedTransaction; +use zebra_message::{common, types}; +use zebra_primitives::hash::H256; /// Synchronization server task #[derive(Debug, PartialEq)] @@ -462,24 +462,24 @@ where #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{Server, ServerImpl, ServerTask, ServerTaskExecutor}; - use chain::Transaction; - use db::BlockChainDatabase; use inbound_connection::tests::DummyOutboundSyncConnection; use local_node::tests::{default_filterload, make_filteradd}; - use message::common::{InventoryType, InventoryVector, Services}; - use message::types; - use miner::{MemoryPool, NonZeroFeeCalculator}; use parking_lot::{Mutex, RwLock}; - use primitives::hash::H256; use std::mem::replace; use std::sync::Arc; use synchronization_executor::tests::DummyTaskExecutor; use synchronization_executor::Task; use synchronization_peers::{PeersContainer, PeersFilters, PeersImpl}; use types::{ExecutorRef, MemoryPoolRef, PeerIndex, PeersRef, StorageRef}; + use zebra_chain::Transaction; + use zebra_db::BlockChainDatabase; + use zebra_message::common::{InventoryType, InventoryVector, Services}; + use zebra_message::types; + use zebra_miner::{MemoryPool, NonZeroFeeCalculator}; + use zebra_primitives::hash::H256; pub struct DummyServer { tasks: Mutex>, @@ -514,7 +514,7 @@ pub mod tests { ) { let peers = Arc::new(PeersImpl::default()); let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let memory_pool = Arc::new(RwLock::new(MemoryPool::new())); let executor = DummyTaskExecutor::new(); @@ -556,7 +556,7 @@ pub mod tests { // when asking for known block let inventory = vec![InventoryVector { inv_type: InventoryType::MessageBlock, - hash: test_data::genesis().hash(), + hash: zebra_test_data::genesis().hash(), }]; server.execute(ServerTask::GetData( 0, @@ -564,14 +564,17 @@ pub mod tests { )); // => respond with block let tasks = DummyTaskExecutor::wait_tasks(executor); - assert_eq!(tasks, vec![Task::Block(0, test_data::genesis().into())]); + assert_eq!( + tasks, + vec![Task::Block(0, zebra_test_data::genesis().into())] + ); } #[test] fn server_getblocks_do_not_responds_inventory_when_synchronized() { let (_, _, executor, _, server) = create_synchronization_server(); // when asking for blocks hashes - let genesis_block_hash = test_data::genesis().hash(); + let genesis_block_hash = zebra_test_data::genesis().hash(); server.execute(ServerTask::GetBlocks( 0, types::GetBlocks { @@ -589,22 +592,24 @@ pub mod tests { fn server_getblocks_responds_inventory_when_have_unknown_blocks() { let (storage, _, executor, _, server) = create_synchronization_server(); storage - .insert(test_data::block_h1().into()) + .insert(zebra_test_data::block_h1().into()) .expect("Db write error"); - storage.canonize(&test_data::block_h1().hash()).unwrap(); + storage + .canonize(&zebra_test_data::block_h1().hash()) + .unwrap(); // when asking for blocks hashes server.execute(ServerTask::GetBlocks( 0, types::GetBlocks { version: 0, - block_locator_hashes: vec![test_data::genesis().hash()], + block_locator_hashes: vec![zebra_test_data::genesis().hash()], hash_stop: H256::default(), }, )); // => responds with inventory let inventory = vec![InventoryVector { inv_type: InventoryType::MessageBlock, - hash: test_data::block_h1().hash(), + hash: zebra_test_data::block_h1().hash(), }]; let tasks = DummyTaskExecutor::wait_tasks(executor); assert_eq!( @@ -617,7 +622,7 @@ pub mod tests { fn server_getheaders_do_not_responds_headers_when_synchronized() { let (_, _, executor, _, server) = create_synchronization_server(); // when asking for blocks hashes - let genesis_block_hash = test_data::genesis().hash(); + let genesis_block_hash = zebra_test_data::genesis().hash(); let dummy_id = 6; server.execute(ServerTask::GetHeaders( 0, @@ -644,22 +649,24 @@ pub mod tests { fn server_getheaders_responds_headers_when_have_unknown_blocks() { let (storage, _, executor, _, server) = create_synchronization_server(); storage - .insert(test_data::block_h1().into()) + .insert(zebra_test_data::block_h1().into()) .expect("Db write error"); - storage.canonize(&test_data::block_h1().hash()).unwrap(); + storage + .canonize(&zebra_test_data::block_h1().hash()) + .unwrap(); // when asking for blocks hashes let dummy_id = 0; server.execute(ServerTask::GetHeaders( 0, types::GetHeaders { version: 0, - block_locator_hashes: vec![test_data::genesis().hash()], + block_locator_hashes: vec![zebra_test_data::genesis().hash()], hash_stop: H256::default(), }, dummy_id, )); // => responds with headers - let headers = vec![test_data::block_h1().block_header]; + let headers = vec![zebra_test_data::block_h1().block_header]; let tasks = DummyTaskExecutor::wait_tasks(executor); assert_eq!( tasks, @@ -715,7 +722,7 @@ pub mod tests { }, InventoryVector { inv_type: InventoryType::MessageTx, - hash: test_data::genesis().transactions[0].hash(), + hash: zebra_test_data::genesis().transactions[0].hash(), }, ]; server.execute(ServerTask::GetData( @@ -736,7 +743,7 @@ pub mod tests { #[test] fn server_getdata_responds_transaction_when_transaction_is_in_memory() { let (_, memory_pool, executor, _, server) = create_synchronization_server(); - let tx_verified: Transaction = test_data::TransactionBuilder::with_output(20).into(); + let tx_verified: Transaction = zebra_test_data::TransactionBuilder::with_output(20).into(); let tx_verified_hash = tx_verified.hash(); // given in-memory transaction { @@ -767,9 +774,11 @@ pub mod tests { let (storage, _, executor, _, server) = create_synchronization_server(); { storage - .insert(test_data::block_h1().into()) + .insert(zebra_test_data::block_h1().into()) .expect("no error"); - storage.canonize(&test_data::block_h1().hash()).unwrap(); + storage + .canonize(&zebra_test_data::block_h1().hash()) + .unwrap(); } // when asking with stop_hash server.execute(ServerTask::GetBlocks( @@ -777,13 +786,13 @@ pub mod tests { types::GetBlocks { version: 0, block_locator_hashes: vec![], - hash_stop: test_data::genesis().hash(), + hash_stop: zebra_test_data::genesis().hash(), }, )); // => respond with next block let inventory = vec![InventoryVector { inv_type: InventoryType::MessageBlock, - hash: test_data::block_h1().hash(), + hash: zebra_test_data::block_h1().hash(), }]; let tasks = DummyTaskExecutor::wait_tasks(executor); assert_eq!( @@ -797,9 +806,11 @@ pub mod tests { let (storage, _, executor, _, server) = create_synchronization_server(); { storage - .insert(test_data::block_h1().into()) + .insert(zebra_test_data::block_h1().into()) .expect("no error"); - storage.canonize(&test_data::block_h1().hash()).unwrap(); + storage + .canonize(&zebra_test_data::block_h1().hash()) + .unwrap(); } // when asking with stop_hash let dummy_id = 6; @@ -808,12 +819,12 @@ pub mod tests { types::GetHeaders { version: 0, block_locator_hashes: vec![], - hash_stop: test_data::genesis().hash(), + hash_stop: zebra_test_data::genesis().hash(), }, dummy_id, )); // => respond with next block - let headers = vec![test_data::block_h1().block_header]; + let headers = vec![zebra_test_data::block_h1().block_header]; let tasks = DummyTaskExecutor::wait_tasks(executor); assert_eq!( tasks, @@ -829,7 +840,7 @@ pub mod tests { fn server_serves_merkleblock() { let peers = Arc::new(PeersImpl::default()); let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let memory_pool = Arc::new(RwLock::new(MemoryPool::new())); let sync_executor = DummyTaskExecutor::new(); @@ -840,8 +851,8 @@ pub mod tests { sync_executor.clone(), ); - let genesis = test_data::genesis(); - let b1 = test_data::block_builder() + let genesis = zebra_test_data::genesis(); + let b1 = zebra_test_data::block_builder() .header() .parent(genesis.hash()) .build() @@ -851,7 +862,7 @@ pub mod tests { .build() .build() .build(); // genesis -> b1 - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() diff --git a/sync/src/synchronization_verifier.rs b/sync/src/synchronization_verifier.rs index 45ba7cef..1b87b296 100644 --- a/sync/src/synchronization_verifier.rs +++ b/sync/src/synchronization_verifier.rs @@ -1,7 +1,4 @@ -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; -use network::ConsensusParams; use parking_lot::Mutex; -use primitives::hash::H256; use std::collections::VecDeque; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{channel, Receiver, Sender}; @@ -10,7 +7,10 @@ use std::thread; use time::get_time; use types::{BlockHeight, MemoryPoolRef, PeerIndex, StorageRef}; use utils::MemoryPoolTransactionOutputProvider; -use verification::{ +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; +use zebra_network::ConsensusParams; +use zebra_primitives::hash::H256; +use zebra_verification::{ BackwardsCompatibleChainVerifier as ChainVerifier, Error as VerificationError, VerificationLevel, Verify as VerificationVerify, }; @@ -427,24 +427,24 @@ where #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{ AsyncVerifier, BlockVerificationSink, ChainVerifierWrapper, HeadersVerificationSink, PartiallyVerifiedBlock, TransactionVerificationSink, VerificationTask, Verifier, }; - use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; - use db::BlockChainDatabase; - use network::{ConsensusParams, Network}; - use primitives::hash::H256; - use script::Error as ScriptError; use std::collections::{HashMap, HashSet}; use std::sync::atomic::Ordering; use std::sync::Arc; use synchronization_client_core::CoreVerificationSink; use synchronization_executor::tests::DummyTaskExecutor; use types::{BlockHeight, MemoryPoolRef, PeerIndex, StorageRef}; - use verification::{ + use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; + use zebra_db::BlockChainDatabase; + use zebra_network::{ConsensusParams, Network}; + use zebra_primitives::hash::H256; + use zebra_script::Error as ScriptError; + use zebra_verification::{ BackwardsCompatibleChainVerifier as ChainVerifier, Error as VerificationError, TransactionError, VerificationLevel, }; @@ -551,7 +551,7 @@ pub mod tests { #[test] fn verifier_wrapper_switches_to_full_mode() { let storage: StorageRef = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let verifier = Arc::new(ChainVerifier::new( storage.clone(), @@ -565,7 +565,7 @@ pub mod tests { &storage, VerificationParameters { verification_level: VerificationLevel::NO_VERIFICATION, - verification_edge: test_data::genesis().hash(), + verification_edge: zebra_test_data::genesis().hash(), } ) .enforce_full_verification @@ -579,14 +579,14 @@ pub mod tests { &storage, VerificationParameters { verification_level: VerificationLevel::NO_VERIFICATION, - verification_edge: test_data::block_h1().hash(), + verification_edge: zebra_test_data::block_h1().hash(), }, ); assert_eq!( wrapper.enforce_full_verification.load(Ordering::Relaxed), false ); - let block: IndexedBlock = test_data::block_h1().into(); + let block: IndexedBlock = zebra_test_data::block_h1().into(); let _ = wrapper.verify_block(&block.into()); assert_eq!( wrapper.enforce_full_verification.load(Ordering::Relaxed), @@ -597,10 +597,10 @@ pub mod tests { #[test] fn verification_level_header_accept_incorrect_transaction() { let consensus = ConsensusParams::new(Network::Unitest); - let mut blocks: Vec = vec![test_data::genesis().into()]; + let mut blocks: Vec = vec![zebra_test_data::genesis().into()]; let mut rolling_hash = blocks[0].hash().clone(); for i in 1..101 { - let next_block = test_data::block_builder() + let next_block = zebra_test_data::block_builder() .transaction() .coinbase() .founder_reward(&consensus, i) @@ -626,7 +626,7 @@ pub mod tests { storage.clone(), ConsensusParams::new(Network::Unitest), )); - let bad_transaction_block: IndexedBlock = test_data::block_builder() + let bad_transaction_block: IndexedBlock = zebra_test_data::block_builder() .transaction() .coinbase() .founder_reward(&consensus, 101) @@ -685,13 +685,17 @@ pub mod tests { #[test] fn verification_level_none_accept_incorrect_block() { let storage: StorageRef = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let verifier = Arc::new(ChainVerifier::new( storage.clone(), ConsensusParams::new(Network::Unitest), )); - let bad_block: IndexedBlock = test_data::block_builder().header().build().build().into(); + let bad_block: IndexedBlock = zebra_test_data::block_builder() + .header() + .build() + .build() + .into(); // Ok(()) when nothing is verified let wrapper = ChainVerifierWrapper::new( diff --git a/sync/src/types.rs b/sync/src/types.rs index 6deadfc7..aa638303 100644 --- a/sync/src/types.rs +++ b/sync/src/types.rs @@ -1,16 +1,16 @@ use super::SyncListener; use futures::Future; use local_node::LocalNode; -use miner::MemoryPool; use parking_lot::{Mutex, RwLock}; use std::sync::Arc; -use storage; use synchronization_client::SynchronizationClient; use synchronization_executor::LocalSynchronizationTaskExecutor; use synchronization_peers::Peers; use synchronization_server::ServerImpl; use synchronization_verifier::AsyncVerifier; use utils::SynchronizationState; +use zebra_miner::MemoryPool; +use zebra_storage; pub use utils::BlockHeight; @@ -24,7 +24,7 @@ pub type PeerIndex = usize; pub type EmptyBoxFuture = Box + Send>; /// Reference to storage -pub type StorageRef = storage::SharedStore; +pub type StorageRef = zebra_storage::SharedStore; /// Reference to memory pool pub type MemoryPoolRef = Arc>; diff --git a/sync/src/utils/best_headers_chain.rs b/sync/src/utils/best_headers_chain.rs index 9fb4b59d..d917f291 100644 --- a/sync/src/utils/best_headers_chain.rs +++ b/sync/src/utils/best_headers_chain.rs @@ -1,7 +1,7 @@ use super::{HashPosition, HashQueue}; -use chain::IndexedBlockHeader; -use primitives::hash::H256; use std::collections::HashMap; +use zebra_chain::IndexedBlockHeader; +use zebra_primitives::hash::H256; /// Best headers chain information #[derive(Debug)] @@ -143,10 +143,10 @@ impl BestHeadersChain { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::BestHeadersChain; - use primitives::hash::H256; + use zebra_primitives::hash::H256; #[test] fn best_chain_empty() { @@ -160,11 +160,11 @@ mod tests { #[test] fn best_chain_insert() { - let mut chain = BestHeadersChain::new(test_data::genesis().hash()); - let b1 = test_data::block_h1().block_header; - let b2 = test_data::block_h2().block_header; - let b181 = test_data::block_h181().block_header; - let b182 = test_data::block_h182().block_header; + let mut chain = BestHeadersChain::new(zebra_test_data::genesis().hash()); + let b1 = zebra_test_data::block_h1().block_header; + let b2 = zebra_test_data::block_h2().block_header; + let b181 = zebra_test_data::block_h181().block_header; + let b182 = zebra_test_data::block_h182().block_header; chain.insert(b1.into()); chain.insert(b181.clone().into()); assert_eq!(chain.information().best, 1); @@ -188,26 +188,26 @@ mod tests { #[test] fn best_chain_remove() { - let b0 = test_data::block_builder().header().build().build(); - let b1 = test_data::block_builder() + let b0 = zebra_test_data::block_builder().header().build().build(); + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() .build() .block_header; - let b2 = test_data::block_builder() + let b2 = zebra_test_data::block_builder() .header() .parent(b1.hash()) .build() .build() .block_header; - let b3 = test_data::block_builder() + let b3 = zebra_test_data::block_builder() .header() .parent(b2.hash()) .build() .build() .block_header; - let b4 = test_data::block_builder() + let b4 = zebra_test_data::block_builder() .header() .parent(b3.hash()) .build() @@ -245,11 +245,11 @@ mod tests { #[test] fn best_chain_insert_to_db_no_reorg() { - let mut chain = BestHeadersChain::new(test_data::genesis().hash()); - let b1 = test_data::block_h1().block_header; + let mut chain = BestHeadersChain::new(zebra_test_data::genesis().hash()); + let b1 = zebra_test_data::block_h1().block_header; chain.insert(b1.clone().into()); assert_eq!(chain.at(0), Some(b1.clone().into())); - let b2 = test_data::block_h2().block_header; + let b2 = zebra_test_data::block_h2().block_header; chain.insert(b2.clone().into()); assert_eq!(chain.at(0), Some(b1.clone().into())); assert_eq!(chain.at(1), Some(b2.clone().into())); @@ -265,8 +265,8 @@ mod tests { #[test] fn insert_to_best_chain_returns_true_if_header_is_in_chain() { - let b0 = test_data::block_builder().header().build().build(); - let b1 = test_data::block_builder() + let b0 = zebra_test_data::block_builder().header().build().build(); + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash()) .build() diff --git a/sync/src/utils/bloom_filter.rs b/sync/src/utils/bloom_filter.rs index f781ca5d..9b5a29d5 100644 --- a/sync/src/utils/bloom_filter.rs +++ b/sync/src/utils/bloom_filter.rs @@ -1,10 +1,10 @@ use bit_vec::BitVec; -use chain::{IndexedTransaction, OutPoint}; -use message::types; use murmur3::murmur3_32; use parking_lot::Mutex; -use script::Script; use ser::serialize; +use zebra_chain::{IndexedTransaction, OutPoint}; +use zebra_message::types; +use zebra_script::Script; /// Constant optimized to create large differences in the seed for different values of `hash_functions_num`. const SEED_OFFSET: u32 = 0xFBA4C795; @@ -155,8 +155,13 @@ impl BloomFilterData { .0 .overflowing_add(self.tweak) .0; - let murmur_hash = - murmur3_32(&mut data.as_ref(), murmur_seed) as usize % self.filter.len(); + // This API is terrible and doesn't accept a byte slice, + // but only a &mut R where R: Read. This means that we + // need to create a mutable copy of the slice object (not + // a copy of the data it points to), then allow the Murmur + // API to consume the newly created slice to Read over it. + let input = &mut data.clone(); + let murmur_hash = murmur3_32(input, murmur_seed) as usize % self.filter.len(); let index = (murmur_hash & !7usize) | ((murmur_hash & 7) ^ 7); if !self .filter @@ -177,8 +182,13 @@ impl BloomFilterData { .0 .overflowing_add(self.tweak) .0; - let murmur_hash = - murmur3_32(&mut data.as_ref(), murmur_seed) as usize % self.filter.len(); + // This API is terrible and doesn't accept a byte slice, + // but only a &mut R where R: Read. This means that we + // need to create a mutable copy of the slice object (not + // a copy of the data it points to), then allow the Murmur + // API to consume the newly created slice to Read over it. + let input = &mut data.clone(); + let murmur_hash = murmur3_32(input, murmur_seed) as usize % self.filter.len(); let index = (murmur_hash & !7usize) | ((murmur_hash & 7) ^ 7); self.filter.set(index, true); } @@ -204,15 +214,15 @@ fn contains_any_instruction_data(bloom: &BloomFilterData, script: Script) -> boo #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{BloomFilter, BloomFilterData}; - use chain::IndexedTransaction; - use message::types; - use primitives::bytes::Bytes; - use primitives::hash::H256; use ser::serialize; use std::iter::repeat; + use zebra_chain::IndexedTransaction; + use zebra_message::types; + use zebra_primitives::bytes::Bytes; + use zebra_primitives::hash::H256; fn default_filterload() -> types::FilterLoad { types::FilterLoad { @@ -239,8 +249,8 @@ mod tests { #[test] fn bloom_filter_matches_transaction_by_hash() { - let tx1: IndexedTransaction = test_data::TransactionBuilder::with_output(10).into(); - let tx2: IndexedTransaction = test_data::TransactionBuilder::with_output(20).into(); + let tx1: IndexedTransaction = zebra_test_data::TransactionBuilder::with_output(10).into(); + let tx2: IndexedTransaction = zebra_test_data::TransactionBuilder::with_output(20).into(); let filter = BloomFilter::with_filter_load(default_filterload()); @@ -311,7 +321,7 @@ mod tests { #[test] fn bloom_filter_data_works_on_address() { - use message::{deserialize_payload, types}; + use zebra_message::{deserialize_payload, types}; // real world message let payload: Bytes = "fd77078732c06c257f2818a0d14738804d6a18a0f0a9800e039be473286d591f48040c99e96d2e0cd8480b03c0823fdd79310e0e04c86314ae24cabaa931f39852c813172e524c4b231020557dda2023130b0f1f309de822014bf6d4305d238ea013b8539e9c138053076a22020335bc1042e543f260787993a07a155a7a560c1475f75ec109b73822491c5880924303a5545ffc465132960fe40a8822010f919c38910f31c546be6940090f0476a02570de8d28258ee8081dea073829386a9de01b0070348f0f2fb48c6a1b4e92292de7b60dbafb8df3a6cab6a824e50005744018b384f080c8265152e406b1c85906d5325d1c83ac880d02214ad401ddc07657002c47708e338020bd14fcc147bfe49335647062074a4d3276e0d3a5110826a05d4fb025129f48c26e5819dd878d851b84802b7a211097813ef952410390c95bb294a7a8faca3667f0068489a69d9c9e8405c035442874a6a8c448c60600834a22041ce36a8065b086469bbb1b46d326b7a9923054ad4e32e4b7231aa203c5acab1f5821b92d2f00728819e587e1e6ff9fa6e66ff52fb54bce3648a7b043cbd19469aa5af0891eb4979def822f06522f080830b411545b4240e01195b0f0962e628050f0f8290269c45c20aa16559d17ceca68b81a21370909a1086614531577600ad8480ae1023c9173260bc6385c0e2d46806c05401a17ac969edfe65fd4000007e1c8a13ac651922edfa5a3235a0bcc10cc0067b4404d64260aea022391b007d3010c8380fda9c821d37258e47a0ab6485baff88876ba55cd190edf730970875f75522010e40f8c28e4872a2065c96390041bef9273a6a1c05d2bd28193b205b2cf25e44c5290926a4d392450b3135a0db7cc2c0696384eee68a65a4280ac3c44207264243fd18795c69588f4e418a26d4e21d1cee894325a2fc869b03fec68fd3e86b31998f9f9a6402dd672227451b1b5419a89c90ae96b9292a1ca83848bc026dcd00ec740342496730a7ab8e48200c7ea240d0e34a07890a9203938ee188475b3d6dd2f50399019c249536955894917fa3acc400ce04ec42d5e89e2d48aa085ae129226d0ea2a4d0038db88fd5ec0688768cea449171280438e8f5164d8682c40b91a2dab042800b1f312b22460e4905dccee59842a2bc9f807d542e08388fec013696d281c0356880040b0610ac4cb148a95a5924875891b2217040bbab7bba21f14898203ae87153206601c20c484f072216c1714ac5ded41a6d213fc09962f195129ac09d85dc05501a773163646021100481cb385a0fdb1609e8d1bc042942f169884e60482ae2004924fc2eb0b7061855858b5e54a4517352084778f38c09f1f004431da4531059c1296436d4c89e8839d34506a27b07c94fa80d2a0a9b73208a79982f0a5d16e0b723d38816a6a666c09bceae5a46d8a032248302224ae43c7e4801004ea6671c6d08142b67e27269a4ac6418748d74f481fc2dbbac5852afc645026cb462f790347d32a26e0b88209f2168110eb4e88394dd0f3bc27958994803238059d581d8cda73493a994c433fad902e20093ad40b1570543af928bc4830c3976d2802635400c0ac5a25833008f00b8bb691c1d9ce026373d05ac03fa6851402e05c6f109fa1754da54a20aa9f4f4782e68966a5113ae141d495d2a53d64bb6a023616b243e0333e2e0c65f2078559a98f48e8637f7b2ff326572a32532e2ec9e9651c092c52a522a5120249a159fa49d56d304806b502c425e3981275409f38b20418bc8206d21e884401c05c3c7d0b7404cf2a97706092b5a818638122ce750ce8780812900f501f4f02cb90fd5ea615e611006e010920072d08ca01b535741460c9aa1ab567ac2f79a004400e523fdcf95320bc08a37f54aaa01b2a2d0aa343ec13205131124b445a2c1b9a7542c63c6ced549447462099c12a9c613838995d718849650300056845311b2c93a1d35a66622466e0a3cef68594faa11021751c0e5358027721d2a2362fc9353655680c80fa5cad35685a0454932251aa121cb50583ae987c2a6e8009f3342048019509760b7e233de62cdcb636344d8a012af9f61a539ec66801c46a56b3d8ea6825e95430d1cc71fcc0bc977e4ea27f83e284cab0aea0a5085e67039901252a722054e33168a89d160a5908a325b63654016da1e94450548bac84a1b22fcc92ce7e2018967755711480e9048f5ded20b5d3960f21b559f1a0be84a53721f7b0f283d7d1bc2bd7f5d7550d3213814eb56e13f0b106acc07b05ece2c518117e934409843f1f889c2d84845c540514badb4ca00864e8bde78e50b0837478104c018cd5996977196e4f064002480a2761489000984d44d0077df65696f306930c893c50b08516e9ea82e02eb0400bc3d1adade23161b45e5210e08e981568f8af232bdf0f3c460349a8800c9f2c510eecc8ccee39e8b0898d329560aaf4d9594a551186423f79aa6806ce8c541506283a54e8859a840814012cad0289627f8659658218f6e58926af0849b4b23b40ac76280061b90c940f71617e0397ea145968250b1060608e4002432021195635dc52e0495c69fa67768a4a89ec32206fa30f62a85503de8c79df940f808c0de2f1723c0c84d89f317c4c1287a40759946d9cc8c43044a817dd6bb8ed326e4ab800fd8815482910de3cc360d40080a8d956e049ec6d1000000000943a3102".parse().unwrap(); diff --git a/sync/src/utils/connection_filter.rs b/sync/src/utils/connection_filter.rs index 277fbc6b..4ed95c19 100644 --- a/sync/src/utils/connection_filter.rs +++ b/sync/src/utils/connection_filter.rs @@ -1,12 +1,12 @@ use bit_vec::BitVec; -use chain::{IndexedBlock, IndexedTransaction}; -use message::types; -use primitives::bytes::Bytes; -use primitives::hash::H256; use synchronization_peers::MerkleBlockArtefacts; use utils::{ build_partial_merkle_tree, BloomFilter, FeeRateFilter, KnownHashFilter, KnownHashType, }; +use zebra_chain::{IndexedBlock, IndexedTransaction}; +use zebra_message::types; +use zebra_primitives::bytes::Bytes; +use zebra_primitives::hash::H256; /// Filter, which controls data relayed over connection. #[derive(Debug, Default)] @@ -131,24 +131,24 @@ impl ConnectionFilter { #[cfg(test)] pub mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::ConnectionFilter; - use chain::IndexedTransaction; - use message::types; - use primitives::bytes::Bytes; use std::iter::repeat; use utils::KnownHashType; + use zebra_chain::IndexedTransaction; + use zebra_message::types; + use zebra_primitives::bytes::Bytes; #[test] fn filter_default_accepts_block() { - assert!(ConnectionFilter::default().filter_block(&test_data::genesis().hash())); + assert!(ConnectionFilter::default().filter_block(&zebra_test_data::genesis().hash())); } #[test] fn filter_default_accepts_transaction() { assert!(ConnectionFilter::default().filter_transaction( - &test_data::genesis().transactions[0].clone().into(), + &zebra_test_data::genesis().transactions[0].clone().into(), Some(0) )); } @@ -156,41 +156,44 @@ pub mod tests { #[test] fn filter_rejects_block_known() { let mut filter = ConnectionFilter::default(); - filter.hash_known_as(test_data::block_h1().hash(), KnownHashType::Block); - filter.hash_known_as(test_data::block_h2().hash(), KnownHashType::Block); - assert!(!filter.filter_block(&test_data::block_h1().hash())); - assert!(!filter.filter_block(&test_data::block_h2().hash())); - assert!(filter.filter_block(&test_data::genesis().hash())); + filter.hash_known_as(zebra_test_data::block_h1().hash(), KnownHashType::Block); + filter.hash_known_as(zebra_test_data::block_h2().hash(), KnownHashType::Block); + assert!(!filter.filter_block(&zebra_test_data::block_h1().hash())); + assert!(!filter.filter_block(&zebra_test_data::block_h2().hash())); + assert!(filter.filter_block(&zebra_test_data::genesis().hash())); } #[test] fn filter_rejects_transaction_known() { let mut filter = ConnectionFilter::default(); filter.hash_known_as( - test_data::block_h1().transactions[0].hash(), + zebra_test_data::block_h1().transactions[0].hash(), KnownHashType::Transaction, ); - assert!( - !filter.filter_transaction(&test_data::block_h1().transactions[0].clone().into(), None) - ); - assert!( - filter.filter_transaction(&test_data::block_h2().transactions[0].clone().into(), None) - ); + assert!(!filter.filter_transaction( + &zebra_test_data::block_h1().transactions[0].clone().into(), + None + )); + assert!(filter.filter_transaction( + &zebra_test_data::block_h2().transactions[0].clone().into(), + None + )); } #[test] fn filter_rejects_transaction_feerate() { let mut filter = ConnectionFilter::default(); filter.set_fee_rate(types::FeeFilter::with_fee_rate(1000)); - assert!( - filter.filter_transaction(&test_data::block_h1().transactions[0].clone().into(), None) - ); assert!(filter.filter_transaction( - &test_data::block_h1().transactions[0].clone().into(), + &zebra_test_data::block_h1().transactions[0].clone().into(), + None + )); + assert!(filter.filter_transaction( + &zebra_test_data::block_h1().transactions[0].clone().into(), Some(1500) )); assert!(!filter.filter_transaction( - &test_data::block_h1().transactions[0].clone().into(), + &zebra_test_data::block_h1().transactions[0].clone().into(), Some(500) )); } @@ -198,7 +201,7 @@ pub mod tests { #[test] fn filter_rejects_transaction_bloomfilter() { let mut filter = ConnectionFilter::default(); - let tx: IndexedTransaction = test_data::block_h1().transactions[0].clone().into(); + let tx: IndexedTransaction = zebra_test_data::block_h1().transactions[0].clone().into(); filter.load(types::FilterLoad { filter: Bytes::from(repeat(0u8).take(1024).collect::>()), hash_functions: 10, diff --git a/sync/src/utils/fee_rate_filter.rs b/sync/src/utils/fee_rate_filter.rs index 30e0a73f..0e581284 100644 --- a/sync/src/utils/fee_rate_filter.rs +++ b/sync/src/utils/fee_rate_filter.rs @@ -1,4 +1,4 @@ -use message::types; +use zebra_message::types; /// Connection fee rate filter #[derive(Debug, Default)] @@ -24,7 +24,7 @@ impl FeeRateFilter { #[cfg(test)] mod tests { use super::FeeRateFilter; - use message::types; + use zebra_message::types; #[test] fn fee_rate_filter_empty() { diff --git a/sync/src/utils/hash_queue.rs b/sync/src/utils/hash_queue.rs index c3ace248..a35ffaed 100644 --- a/sync/src/utils/hash_queue.rs +++ b/sync/src/utils/hash_queue.rs @@ -1,7 +1,7 @@ -use primitives::hash::H256; use std::collections::{HashSet, VecDeque}; use std::iter::repeat; use std::ops::Index; +use zebra_primitives::hash::H256; /// Block position #[derive(Debug, Copy, Clone, Eq, PartialEq)] @@ -314,7 +314,7 @@ impl Index for HashQueueChain { #[cfg(test)] mod tests { use super::{HashPosition, HashQueue, HashQueueChain}; - use primitives::hash::H256; + use zebra_primitives::hash::H256; #[test] fn hash_queue_empty() { diff --git a/sync/src/utils/known_hash_filter.rs b/sync/src/utils/known_hash_filter.rs index 62492033..0c2d8c73 100644 --- a/sync/src/utils/known_hash_filter.rs +++ b/sync/src/utils/known_hash_filter.rs @@ -1,5 +1,5 @@ use linked_hash_map::LinkedHashMap; -use primitives::hash::H256; +use zebra_primitives::hash::H256; /// Maximal number of hashes to store in known-hashes filter pub const MAX_KNOWN_HASHES_LEN: usize = 2048; @@ -66,7 +66,7 @@ impl KnownHashFilter { #[cfg(test)] mod tests { use super::{KnownHashFilter, KnownHashType, MAX_KNOWN_HASHES_LEN}; - use primitives::hash::H256; + use zebra_primitives::hash::H256; #[test] fn known_hash_filter_empty() { diff --git a/sync/src/utils/memory_pool_transaction_provider.rs b/sync/src/utils/memory_pool_transaction_provider.rs index 11ecce93..40ebc9b2 100644 --- a/sync/src/utils/memory_pool_transaction_provider.rs +++ b/sync/src/utils/memory_pool_transaction_provider.rs @@ -1,9 +1,9 @@ use super::super::types::{MemoryPoolRef, StorageRef}; -use chain::{OutPoint, Transaction, TransactionOutput}; -use miner::{DoubleSpendCheckResult, HashedOutPoint, NonFinalDoubleSpendSet}; use std::collections::HashMap; -use storage::TransactionOutputProvider; -use verification::TransactionError; +use zebra_chain::{OutPoint, Transaction, TransactionOutput}; +use zebra_miner::{DoubleSpendCheckResult, HashedOutPoint, NonFinalDoubleSpendSet}; +use zebra_storage::TransactionOutputProvider; +use zebra_verification::TransactionError; /// Transaction output observer, which looks into both storage && into memory pool. /// It also allows to replace non-final transactions in the memory pool. @@ -119,21 +119,21 @@ impl TransactionOutputProvider for MemoryPoolTransactionOutputProvider { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::MemoryPoolTransactionOutputProvider; - use chain::OutPoint; - use db::BlockChainDatabase; - use miner::{MemoryPool, NonZeroFeeCalculator}; use parking_lot::RwLock; use std::sync::Arc; - use storage::TransactionOutputProvider; + use zebra_chain::OutPoint; + use zebra_db::BlockChainDatabase; + use zebra_miner::{MemoryPool, NonZeroFeeCalculator}; + use zebra_storage::TransactionOutputProvider; #[test] fn when_transaction_depends_on_removed_nonfinal_transaction() { - let dchain = &mut test_data::ChainBuilder::new(); + let dchain = &mut zebra_test_data::ChainBuilder::new(); - test_data::TransactionBuilder::with_output(10) + zebra_test_data::TransactionBuilder::with_output(10) .store(dchain) // t0 .reset() .set_input(&dchain.at(0), 0) @@ -150,7 +150,7 @@ mod tests { .store(dchain); // good replacement: t0[0] -> t3 let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); let memory_pool = Arc::new(RwLock::new(MemoryPool::new())); { diff --git a/sync/src/utils/orphan_blocks_pool.rs b/sync/src/utils/orphan_blocks_pool.rs index 26d4440a..2460e1d4 100644 --- a/sync/src/utils/orphan_blocks_pool.rs +++ b/sync/src/utils/orphan_blocks_pool.rs @@ -1,9 +1,9 @@ -use chain::IndexedBlock; use linked_hash_map::LinkedHashMap; -use primitives::hash::H256; use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet, VecDeque}; use time; +use zebra_chain::IndexedBlock; +use zebra_primitives::hash::H256; #[derive(Debug)] /// Storage for blocks, for which we have no parent yet. @@ -126,11 +126,11 @@ impl OrphanBlocksPool { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::OrphanBlocksPool; - use primitives::hash::H256; use std::collections::HashSet; + use zebra_primitives::hash::H256; #[test] fn orphan_block_pool_empty_on_start() { @@ -141,7 +141,7 @@ mod tests { #[test] fn orphan_block_pool_insert_orphan_block() { let mut pool = OrphanBlocksPool::new(); - let b1 = test_data::block_h1(); + let b1 = zebra_test_data::block_h1(); let b1_hash = b1.hash(); pool.insert_orphaned_block(b1.into()); @@ -154,7 +154,7 @@ mod tests { #[test] fn orphan_block_pool_insert_unknown_block() { let mut pool = OrphanBlocksPool::new(); - let b1 = test_data::block_h1(); + let b1 = zebra_test_data::block_h1(); let b1_hash = b1.hash(); pool.insert_unknown_block(b1.into()); @@ -167,9 +167,9 @@ mod tests { #[test] fn orphan_block_pool_remove_known_blocks() { let mut pool = OrphanBlocksPool::new(); - let b1 = test_data::block_h1(); + let b1 = zebra_test_data::block_h1(); let b1_hash = b1.hash(); - let b2 = test_data::block_h169(); + let b2 = zebra_test_data::block_h169(); let b2_hash = b2.hash(); pool.insert_orphaned_block(b1.into()); @@ -191,18 +191,18 @@ mod tests { #[test] fn orphan_block_pool_remove_blocks_for_parent() { let mut pool = OrphanBlocksPool::new(); - let b1 = test_data::block_h1(); + let b1 = zebra_test_data::block_h1(); let b1_hash = b1.hash(); - let b2 = test_data::block_h169(); + let b2 = zebra_test_data::block_h169(); let b2_hash = b2.hash(); - let b3 = test_data::block_h2(); + let b3 = zebra_test_data::block_h2(); let b3_hash = b3.hash(); pool.insert_orphaned_block(b1.into()); pool.insert_unknown_block(b2.into()); pool.insert_orphaned_block(b3.into()); - let removed = pool.remove_blocks_for_parent(&test_data::genesis().hash()); + let removed = pool.remove_blocks_for_parent(&zebra_test_data::genesis().hash()); assert_eq!(removed.len(), 2); assert_eq!(removed[0].hash(), &b1_hash); assert_eq!(removed[1].hash(), &b3_hash); @@ -217,15 +217,15 @@ mod tests { #[test] fn orphan_block_pool_remove_blocks() { let mut pool = OrphanBlocksPool::new(); - let b1 = test_data::block_h1(); + let b1 = zebra_test_data::block_h1(); let b1_hash = b1.hash(); - let b2 = test_data::block_h2(); + let b2 = zebra_test_data::block_h2(); let b2_hash = b2.hash(); - let b3 = test_data::block_h169(); + let b3 = zebra_test_data::block_h169(); let b3_hash = b3.hash(); - let b4 = test_data::block_h170(); + let b4 = zebra_test_data::block_h170(); let b4_hash = b4.hash(); - let b5 = test_data::block_h181(); + let b5 = zebra_test_data::block_h181(); pool.insert_orphaned_block(b1.into()); pool.insert_orphaned_block(b2.into()); diff --git a/sync/src/utils/orphan_transactions_pool.rs b/sync/src/utils/orphan_transactions_pool.rs index 5b4d68e8..933dc513 100644 --- a/sync/src/utils/orphan_transactions_pool.rs +++ b/sync/src/utils/orphan_transactions_pool.rs @@ -1,9 +1,9 @@ -use chain::IndexedTransaction; use linked_hash_map::LinkedHashMap; -use primitives::hash::H256; use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet, VecDeque}; use time; +use zebra_chain::IndexedTransaction; +use zebra_primitives::hash::H256; #[derive(Debug)] /// Storage for transactions, for which we have no parent transactions yet. @@ -143,12 +143,12 @@ impl OrphanTransaction { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; - use self::test_data::{ChainBuilder, TransactionBuilder}; + use self::zebra_test_data::{ChainBuilder, TransactionBuilder}; use super::OrphanTransactionsPool; - use primitives::hash::H256; use std::collections::HashSet; + use zebra_primitives::hash::H256; #[test] fn orphan_transaction_pool_empty_on_start() { diff --git a/sync/src/utils/partial_merkle_tree.rs b/sync/src/utils/partial_merkle_tree.rs index 565c1888..f9d95ea1 100644 --- a/sync/src/utils/partial_merkle_tree.rs +++ b/sync/src/utils/partial_merkle_tree.rs @@ -1,7 +1,7 @@ use bit_vec::BitVec; -use chain::merkle_node_hash; -use primitives::hash::H256; use std::cmp::min; +use zebra_chain::merkle_node_hash; +use zebra_primitives::hash::H256; /// Partial merkle tree pub struct PartialMerkleTree { @@ -249,11 +249,11 @@ impl PartialMerkleTreeBuilder { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{build_partial_merkle_tree, parse_partial_merkle_tree}; - use chain::{merkle_root, Transaction}; - use primitives::hash::H256; + use zebra_chain::{merkle_root, Transaction}; + use zebra_primitives::hash::H256; #[test] // test from core implementation (slow) @@ -270,7 +270,7 @@ mod tests { for tx_count in tx_counts { // build block with given transactions number let transactions: Vec = (0..tx_count) - .map(|n| test_data::TransactionBuilder::with_version(n as i32).into()) + .map(|n| zebra_test_data::TransactionBuilder::with_version(n as i32).into()) .collect(); let hashes: Vec<_> = transactions.iter().map(|t| t.hash()).collect(); let merkle_root = merkle_root(&hashes); diff --git a/sync/src/utils/synchronization_state.rs b/sync/src/utils/synchronization_state.rs index 639ef725..aa8fcbe4 100644 --- a/sync/src/utils/synchronization_state.rs +++ b/sync/src/utils/synchronization_state.rs @@ -1,6 +1,6 @@ use super::super::types::{BlockHeight, StorageRef}; -use p2p::InboundSyncConnectionState; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; +use zebra_p2p::InboundSyncConnectionState; // AtomicU32 is unstable => using AtomicUsize here diff --git a/test-data/Cargo.toml b/test-data/Cargo.toml index f47f9eb7..fca4f0ae 100644 --- a/test-data/Cargo.toml +++ b/test-data/Cargo.toml @@ -1,13 +1,14 @@ [package] -name = "test-data" +name = "zebra-test-data" version = "0.1.0" -authors = ["Nikolay Volf "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] time = "0.1" -chain = { path = "../chain" } -network = { path = "../network" } -primitives = { path = "../primitives" } -serialization = { path = "../serialization" } -script = { path = "../script" } +zebra-chain = { path = "../chain" } +zebra-network = { path = "../network" } +zebra-primitives = { path = "../primitives" } +zebra-serialization = { path = "../serialization" } +zebra-script = { path = "../script" } diff --git a/test-data/src/block.rs b/test-data/src/block.rs index 32b0b076..174a58eb 100644 --- a/test-data/src/block.rs +++ b/test-data/src/block.rs @@ -1,15 +1,15 @@ //! Block builder use super::genesis; -use chain; use invoke::{Identity, Invoke}; -use network::ConsensusParams; -use primitives::bytes::Bytes; -use primitives::compact::Compact; -use primitives::hash::H256; -use script::{Builder as ScriptBuilder, Opcode}; use ser::{serialized_list_size, Serializable}; use std::cell::Cell; +use zebra_chain; +use zebra_network::ConsensusParams; +use zebra_primitives::bytes::Bytes; +use zebra_primitives::compact::Compact; +use zebra_primitives::hash::H256; +use zebra_script::{Builder as ScriptBuilder, Opcode}; thread_local! { pub static TIMESTAMP_COUNTER: Cell = Cell::new(0); @@ -17,7 +17,7 @@ thread_local! { pub struct BlockHashBuilder { callback: F, - block: Option, + block: Option, } impl BlockHashBuilder { @@ -28,7 +28,7 @@ impl BlockHashBuilder { impl BlockHashBuilder where - F: Invoke<(H256, chain::Block)>, + F: Invoke<(H256, zebra_chain::Block)>, { pub fn with_callback(callback: F) -> Self { BlockHashBuilder { @@ -41,7 +41,7 @@ where BlockBuilder::with_callback(self) } - pub fn with_block(mut self, block: chain::Block) -> Self { + pub fn with_block(mut self, block: zebra_chain::Block) -> Self { self.block = Some(block); self } @@ -54,21 +54,21 @@ where } } -impl Invoke for BlockHashBuilder +impl Invoke for BlockHashBuilder where - F: Invoke<(H256, chain::Block)>, + F: Invoke<(H256, zebra_chain::Block)>, { type Result = Self; - fn invoke(self, block: chain::Block) -> Self { + fn invoke(self, block: zebra_chain::Block) -> Self { self.with_block(block) } } pub struct BlockBuilder { callback: F, - header: Option, - transactions: Vec, + header: Option, + transactions: Vec, } impl BlockBuilder { @@ -79,7 +79,7 @@ impl BlockBuilder { impl BlockBuilder where - F: Invoke, + F: Invoke, { pub fn with_callback(callback: F) -> Self { BlockBuilder { @@ -89,26 +89,26 @@ where } } - pub fn with_header(mut self, header: chain::BlockHeader) -> Self { + pub fn with_header(mut self, header: zebra_chain::BlockHeader) -> Self { self.header = Some(header); self } - pub fn with_transaction(mut self, transaction: chain::Transaction) -> Self { + pub fn with_transaction(mut self, transaction: zebra_chain::Transaction) -> Self { self.transactions.push(transaction); self } pub fn with_transactions(mut self, txs: I) -> Self where - I: IntoIterator, + I: IntoIterator, { self.transactions.extend(txs); self } pub fn with_raw(mut self, raw: &'static str) -> Self { - let raw_block: chain::Block = raw.into(); + let raw_block: zebra_chain::Block = raw.into(); self.transactions = raw_block.transactions.to_vec(); self.header = Some(raw_block.header().clone()); self @@ -120,7 +120,7 @@ where pub fn merkled_header(self) -> BlockHeaderBuilder { let hashes: Vec = self.transactions.iter().map(|t| t.hash()).collect(); - let builder = self.header().merkle_root(chain::merkle_root(&hashes)); + let builder = self.header().merkle_root(zebra_chain::merkle_root(&hashes)); builder } @@ -192,29 +192,31 @@ where } pub fn build(self) -> F::Result { - self.callback - .invoke(chain::Block::new(self.header.unwrap(), self.transactions)) + self.callback.invoke(zebra_chain::Block::new( + self.header.unwrap(), + self.transactions, + )) } } -impl Invoke for BlockBuilder +impl Invoke for BlockBuilder where - F: Invoke, + F: Invoke, { type Result = Self; - fn invoke(self, header: chain::BlockHeader) -> Self { + fn invoke(self, header: zebra_chain::BlockHeader) -> Self { self.with_header(header) } } -impl Invoke for BlockBuilder +impl Invoke for BlockBuilder where - F: Invoke, + F: Invoke, { type Result = Self; - fn invoke(self, tx: chain::Transaction) -> Self { + fn invoke(self, tx: zebra_chain::Transaction) -> Self { self.with_transaction(tx) } } @@ -232,7 +234,7 @@ pub struct BlockHeaderBuilder { impl BlockHeaderBuilder where - F: Invoke, + F: Invoke, { pub fn with_callback(callback: F) -> Self { BlockHeaderBuilder { @@ -288,7 +290,7 @@ where } pub fn build(self) -> F::Result { - self.callback.invoke(chain::BlockHeader { + self.callback.invoke(zebra_chain::BlockHeader { time: self.time, previous_header_hash: self.parent, bits: self.bits, @@ -296,7 +298,7 @@ where merkle_root_hash: self.merkle_root, version: self.version, final_sapling_root: self.final_sapling_root, - solution: chain::EquihashSolution::default(), + solution: zebra_chain::EquihashSolution::default(), }) } } @@ -305,13 +307,13 @@ pub struct TransactionBuilder { callback: F, version: i32, lock_time: u32, - inputs: Vec, - outputs: Vec, + inputs: Vec, + outputs: Vec, } impl TransactionBuilder where - F: Invoke, + F: Invoke, { fn with_callback(callback: F) -> Self { TransactionBuilder { @@ -323,12 +325,12 @@ where } } - fn with_input(mut self, input: chain::TransactionInput) -> Self { + fn with_input(mut self, input: zebra_chain::TransactionInput) -> Self { self.inputs.push(input); self } - fn with_output(mut self, input: chain::TransactionOutput) -> Self { + fn with_output(mut self, input: zebra_chain::TransactionOutput) -> Self { self.outputs.push(input); self } @@ -388,7 +390,7 @@ where } pub fn build(self) -> F::Result { - self.callback.invoke(chain::Transaction { + self.callback.invoke(zebra_chain::Transaction { lock_time: self.lock_time, version: self.version, inputs: self.inputs, @@ -398,38 +400,38 @@ where } } -impl Invoke for TransactionBuilder +impl Invoke for TransactionBuilder where - F: Invoke, + F: Invoke, { type Result = Self; - fn invoke(self, tx: chain::TransactionInput) -> Self { + fn invoke(self, tx: zebra_chain::TransactionInput) -> Self { self.with_input(tx) } } -impl Invoke for TransactionBuilder +impl Invoke for TransactionBuilder where - F: Invoke, + F: Invoke, { type Result = Self; - fn invoke(self, tx: chain::TransactionOutput) -> Self { + fn invoke(self, tx: zebra_chain::TransactionOutput) -> Self { self.with_output(tx) } } pub struct TransactionInputBuilder { callback: F, - output: Option, + output: Option, signature: Bytes, sequence: u32, } impl TransactionInputBuilder where - F: Invoke, + F: Invoke, { fn with_callback(callback: F) -> Self { TransactionInputBuilder { @@ -477,7 +479,7 @@ where } pub fn hash(mut self, hash: H256) -> Self { - let mut output = self.output.unwrap_or(chain::OutPoint { + let mut output = self.output.unwrap_or(zebra_chain::OutPoint { hash: hash.clone(), index: 0, }); @@ -487,7 +489,7 @@ where } pub fn index(mut self, index: u32) -> Self { - let mut output = self.output.unwrap_or(chain::OutPoint { + let mut output = self.output.unwrap_or(zebra_chain::OutPoint { hash: H256::from(0), index: index, }); @@ -497,7 +499,7 @@ where } pub fn coinbase(mut self) -> Self { - self.output = Some(chain::OutPoint { + self.output = Some(zebra_chain::OutPoint { hash: H256::from(0), index: 0xffffffff, }); @@ -506,7 +508,7 @@ where } pub fn build(self) -> F::Result { - self.callback.invoke(chain::TransactionInput { + self.callback.invoke(zebra_chain::TransactionInput { previous_output: self.output.expect("Building input without previous output"), script_sig: self.signature, sequence: self.sequence, @@ -522,7 +524,7 @@ pub struct TransactionOutputBuilder { impl TransactionOutputBuilder where - F: Invoke, + F: Invoke, { fn with_callback(callback: F) -> Self { TransactionOutputBuilder { @@ -572,7 +574,7 @@ where } pub fn build(self) -> F::Result { - self.callback.invoke(chain::TransactionOutput { + self.callback.invoke(zebra_chain::TransactionOutput { script_pubkey: self.script_pubkey, value: self.value, }) @@ -589,8 +591,8 @@ pub fn block_hash_builder() -> BlockHashBuilder { pub fn build_n_empty_blocks_from( n: u32, start_nonce: u32, - previous: &chain::BlockHeader, -) -> Vec { + previous: &zebra_chain::BlockHeader, +) -> Vec { let mut result = Vec::new(); let mut previous_hash = previous.hash(); let end_nonce = start_nonce + n; @@ -607,11 +609,11 @@ pub fn build_n_empty_blocks_from( result } -pub fn build_n_empty_blocks_from_genesis(n: u32, start_nonce: u32) -> Vec { +pub fn build_n_empty_blocks_from_genesis(n: u32, start_nonce: u32) -> Vec { build_n_empty_blocks_from(n, start_nonce, &genesis().block_header) } -pub fn build_n_empty_blocks(n: u32, start_nonce: u32) -> Vec { +pub fn build_n_empty_blocks(n: u32, start_nonce: u32) -> Vec { assert!(n != 0); let previous = block_builder() .header() diff --git a/test-data/src/chain_builder.rs b/test-data/src/chain_builder.rs index 5f669f80..f38dfd1a 100644 --- a/test-data/src/chain_builder.rs +++ b/test-data/src/chain_builder.rs @@ -1,10 +1,10 @@ -use chain::{ +use ser::Serializable; +use zebra_chain::{ IndexedTransaction, JoinSplit, OutPoint, Sapling, Transaction, TransactionInput, TransactionOutput, }; -use primitives::bytes::Bytes; -use primitives::hash::H256; -use ser::Serializable; +use zebra_primitives::bytes::Bytes; +use zebra_primitives::hash::H256; #[derive(Debug, Default, Clone)] pub struct ChainBuilder { diff --git a/test-data/src/lib.rs b/test-data/src/lib.rs index 36cbadf9..2651d813 100644 --- a/test-data/src/lib.rs +++ b/test-data/src/lib.rs @@ -2,13 +2,13 @@ extern crate time; -extern crate chain; -extern crate network; -extern crate primitives; -extern crate script; -extern crate serialization as ser; +extern crate zebra_chain; +extern crate zebra_network; +extern crate zebra_primitives; +extern crate zebra_script; +extern crate zebra_serialization as ser; -use chain::{Block, Transaction}; +use zebra_chain::{Block, Transaction}; pub mod block; pub mod chain_builder; diff --git a/verification/Cargo.toml b/verification/Cargo.toml index 29e85ad1..89435922 100644 --- a/verification/Cargo.toml +++ b/verification/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "verification" +name = "zebra-verification" version = "0.1.0" -authors = ["Nikolay Volf "] +license = "GPL-3.0" +authors = ["Zcash Foundation "] [dependencies] time = "0.1" @@ -9,21 +10,21 @@ log = "0.4" rayon = "1.0" parking_lot = "0.8" byteorder = "1.2" -keys = { path = "../keys" } -primitives = { path = "../primitives" } -chain = { path = "../chain" } -serialization = { path = "../serialization" } -script = { path = "../script" } -network = { path = "../network" } -storage = { path = "../storage" } -bitcrypto = { path = "../crypto" } rustc-hex = "2" bitvec = "0.10" bitflags = "1.0" +zebra-keys = { path = "../keys" } +zebra-primitives = { path = "../primitives" } +zebra-chain = { path = "../chain" } +zebra-serialization = { path = "../serialization" } +zebra-script = { path = "../script" } +zebra-network = { path = "../network" } +zebra-storage = { path = "../storage" } +zebra-crypto = { path = "../crypto" } [dev-dependencies] rand = "0.4" -test-data = { path = "../test-data" } -db = { path = "../db" } assert_matches = "1.3.0" -chain = { path = "../chain", features = ["test-helpers"] } +zebra-chain = { path = "../chain", features = ["test-helpers"] } +zebra-db = { path = "../db" } +zebra-test-data = { path = "../test-data" } diff --git a/verification/src/accept_block.rs b/verification/src/accept_block.rs index a8c32c2c..22f5cb91 100644 --- a/verification/src/accept_block.rs +++ b/verification/src/accept_block.rs @@ -2,15 +2,15 @@ use canon::CanonBlock; use deployments::BlockDeployments; use error::Error; use fee::checked_transaction_fee; -use keys::Address; -use network::ConsensusParams; -use script::{self, Builder}; use sigops::transaction_sigops; -use storage::{ +use timestamp::median_timestamp; +use zebra_keys::Address; +use zebra_network::ConsensusParams; +use zebra_script::{self, Builder}; +use zebra_storage::{ BlockHeaderProvider, DuplexTransactionOutputProvider, SaplingTreeState, TransactionOutputProvider, TreeStateProvider, }; -use timestamp::median_timestamp; /// Flexible verification of ordered block pub struct BlockAcceptor<'a> { @@ -240,7 +240,7 @@ impl<'a> BlockCoinbaseScript<'a> { return Ok(()); } - let prefix = script::Builder::default() + let prefix = zebra_script::Builder::default() .push_i64(self.height.into()) .into_script(); @@ -355,14 +355,14 @@ impl<'a> BlockSaplingRoot<'a> { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{BlockCoinbaseMinerReward, BlockCoinbaseScript, BlockSaplingRoot}; - use chain::{OutPoint, TransactionOutput}; - use db::BlockChainDatabase; - use network::{ConsensusParams, Network}; use std::collections::HashMap; - use storage::{SaplingTreeState, TransactionOutputProvider}; + use zebra_chain::{OutPoint, TransactionOutput}; + use zebra_db::BlockChainDatabase; + use zebra_network::{ConsensusParams, Network}; + use zebra_storage::{SaplingTreeState, TransactionOutputProvider}; use {CanonBlock, Error}; #[test] @@ -371,7 +371,7 @@ mod tests { // https://blockchain.info/rawtx/7cf05175ce9c8dbfff9aafa8263edc613fc08f876e476553009afcf7e3868a0c?format=hex let tx = "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff3f033d0a070004b663ec58049cba630608733867a0787a02000a425720537570706f727420384d200a666973686572206a696e78696e092f425720506f6f6c2fffffffff01903d9d4e000000001976a914721afdf638d570285d02d3076d8be6a03ee0794d88ac00000000".into(); let block_number = 461373; - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .with_transaction(tx) .header() .build() @@ -400,10 +400,14 @@ mod tests { #[test] fn test_block_sapling_root() { - let storage = BlockChainDatabase::init_test_chain(vec![test_data::genesis().into()]); + let storage = BlockChainDatabase::init_test_chain(vec![zebra_test_data::genesis().into()]); // when sapling is inactive - let block = test_data::block_builder().header().build().build().into(); + let block = zebra_test_data::block_builder() + .header() + .build() + .build() + .into(); assert_eq!( BlockSaplingRoot { block: CanonBlock::new(&block), @@ -415,7 +419,7 @@ mod tests { ); // when sapling is active and root matches - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .header() .final_sapling_root(SaplingTreeState::empty_root()) .build() @@ -432,7 +436,11 @@ mod tests { ); // when sapling is active and root mismatches - let block = test_data::block_builder().header().build().build().into(); + let block = zebra_test_data::block_builder() + .header() + .build() + .build() + .into(); assert_eq!( BlockSaplingRoot { block: CanonBlock::new(&block), @@ -465,7 +473,7 @@ mod tests { } } - let (block, donors) = test_data::block_h419221_with_donors(); + let (block, donors) = zebra_test_data::block_h419221_with_donors(); let store = Store( donors .into_iter() diff --git a/verification/src/accept_chain.rs b/verification/src/accept_chain.rs index 2cd0b961..81560bcb 100644 --- a/verification/src/accept_chain.rs +++ b/verification/src/accept_chain.rs @@ -4,9 +4,9 @@ use accept_transaction::TransactionAcceptor; use canon::CanonBlock; use deployments::BlockDeployments; use error::Error; -use network::ConsensusParams; use rayon::prelude::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator}; -use storage::{ +use zebra_network::ConsensusParams; +use zebra_storage::{ BlockHeaderProvider, DuplexTransactionOutputProvider, NullifierTracker, TransactionMetaProvider, TransactionOutputProvider, TreeStateProvider, }; diff --git a/verification/src/accept_header.rs b/verification/src/accept_header.rs index eb9ff2b5..0bbb25a6 100644 --- a/verification/src/accept_header.rs +++ b/verification/src/accept_header.rs @@ -1,10 +1,10 @@ use canon::CanonHeader; use deployments::Deployments; use error::Error; -use network::ConsensusParams; -use storage::BlockHeaderProvider; use timestamp::median_timestamp; use work::work_required; +use zebra_network::ConsensusParams; +use zebra_storage::BlockHeaderProvider; pub struct HeaderAcceptor<'a> { pub version: HeaderVersion<'a>, diff --git a/verification/src/accept_transaction.rs b/verification/src/accept_transaction.rs index 31d91493..75885011 100644 --- a/verification/src/accept_transaction.rs +++ b/verification/src/accept_transaction.rs @@ -1,26 +1,26 @@ use canon::CanonTransaction; -use chain::{ +use constants::COINBASE_MATURITY; +use deployments::BlockDeployments; +use error::TransactionError; +use sapling::accept_sapling; +use ser::Serializable; +use sigops::transaction_sigops; +use tree_cache::TreeCache; +use zebra_chain::{ OVERWINTER_TX_VERSION, OVERWINTER_TX_VERSION_GROUP_ID, SAPLING_TX_VERSION, SAPLING_TX_VERSION_GROUP_ID, }; -use constants::COINBASE_MATURITY; -use crypto::Groth16VerifyingKey; -use deployments::BlockDeployments; -use error::TransactionError; -use network::ConsensusParams; -use primitives::hash::H256; -use sapling::accept_sapling; -use script::{ +use zebra_crypto::Groth16VerifyingKey; +use zebra_network::ConsensusParams; +use zebra_primitives::hash::H256; +use zebra_script::{ verify_script, Script, SighashBase, TransactionInputSigner, TransactionSignatureChecker, VerificationFlags, }; -use ser::Serializable; -use sigops::transaction_sigops; -use storage::{ +use zebra_storage::{ DuplexTransactionOutputProvider, EpochRef, EpochTag, NullifierTracker, TransactionMetaProvider, TransactionOutputProvider, TreeStateProvider, }; -use tree_cache::TreeCache; use {checked_transaction_fee, VerificationLevel}; pub struct TransactionAcceptor<'a> { @@ -727,7 +727,7 @@ impl<'a> JoinSplitVerification<'a> { pub fn check(&self, sighash: H256) -> Result<(), TransactionError> { if let Some(ref join_split) = self.transaction.raw.join_split { - ::crypto::verify_ed25519( + ::zebra_crypto::verify_ed25519( &sighash[..], &join_split.pubkey.into(), &join_split.sig.into(), @@ -826,13 +826,13 @@ impl<'a> SaplingVerification<'a> { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::*; - use chain::{Sapling, Transaction, BTC_TX_VERSION}; - use db::BlockChainDatabase; - use network::{ConsensusParams, Network}; - use script::{ + use zebra_chain::{Sapling, Transaction, BTC_TX_VERSION}; + use zebra_db::BlockChainDatabase; + use zebra_network::{ConsensusParams, Network}; + use zebra_script::{ verify_script, Script, TransactionInputSigner, TransactionSignatureChecker, VerificationFlags, }; @@ -870,16 +870,16 @@ mod tests { #[test] fn sapling_nullifiers_works() { - let storage = BlockChainDatabase::init_test_chain(vec![test_data::genesis().into()]); + let storage = BlockChainDatabase::init_test_chain(vec![zebra_test_data::genesis().into()]); - let tx: Transaction = test_data::TransactionBuilder::with_sapling(Sapling { + let tx: Transaction = zebra_test_data::TransactionBuilder::with_sapling(Sapling { spends: vec![Default::default()], ..Default::default() }) .into(); - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .header() - .parent(test_data::genesis().hash()) + .parent(zebra_test_data::genesis().hash()) .build() .transaction() .coinbase() @@ -911,7 +911,7 @@ mod tests { let consensus = ConsensusParams::new(Network::Mainnet); // when overwinter isn't active, expiry height is ignored - let tx = test_data::TransactionBuilder::overwintered() + let tx = zebra_test_data::TransactionBuilder::overwintered() .set_expiry_height(1) .into(); assert_eq!( @@ -925,7 +925,7 @@ mod tests { ); // when overwinter is active && we check coinbase tx, expiry height is ignored - let tx = test_data::TransactionBuilder::coinbase() + let tx = zebra_test_data::TransactionBuilder::coinbase() .set_overwintered(true) .set_expiry_height(1) .into(); @@ -940,7 +940,7 @@ mod tests { ); // when overwinter is active && expiry height check passes - let tx = test_data::TransactionBuilder::overwintered() + let tx = zebra_test_data::TransactionBuilder::overwintered() .set_expiry_height(consensus.overwinter_height + 100) .into(); assert_eq!( @@ -954,7 +954,7 @@ mod tests { ); // when overwinter is active && expiry height check fails - let tx = test_data::TransactionBuilder::overwintered() + let tx = zebra_test_data::TransactionBuilder::overwintered() .set_expiry_height(consensus.overwinter_height + 1) .into(); assert_eq!( @@ -973,7 +973,7 @@ mod tests { let consensus = ConsensusParams::new(Network::Mainnet); // when overwinter is active, but transaction isn't overwintered - let tx = test_data::TransactionBuilder::default().into(); + let tx = zebra_test_data::TransactionBuilder::default().into(); assert_eq!( TransactionVersion::new( CanonTransaction::new(&tx), @@ -985,7 +985,7 @@ mod tests { ); // when overwinter isn't active, but transaction is overwintered - let tx = test_data::TransactionBuilder::overwintered().into(); + let tx = zebra_test_data::TransactionBuilder::overwintered().into(); assert_eq!( TransactionVersion::new( CanonTransaction::new(&tx), @@ -997,7 +997,7 @@ mod tests { ); // when sapling is active, but version group id isn't set to sapling - let tx = test_data::TransactionBuilder::overwintered().into(); + let tx = zebra_test_data::TransactionBuilder::overwintered().into(); assert_eq!( TransactionVersion::new( CanonTransaction::new(&tx), @@ -1009,7 +1009,7 @@ mod tests { ); // when overwinter is active, but version group id isn't set to overwinter - let tx = test_data::TransactionBuilder::overwintered().into(); + let tx = zebra_test_data::TransactionBuilder::overwintered().into(); assert_eq!( TransactionVersion::new( CanonTransaction::new(&tx), @@ -1021,7 +1021,7 @@ mod tests { ); // when sapling is active, but version is post-sapling - let tx = test_data::TransactionBuilder::overwintered() + let tx = zebra_test_data::TransactionBuilder::overwintered() .set_version_group_id(SAPLING_TX_VERSION_GROUP_ID) .set_version(SAPLING_TX_VERSION + 1) .into(); @@ -1036,7 +1036,7 @@ mod tests { ); // when overwinter is active, but version is post-overwinter - let tx = test_data::TransactionBuilder::overwintered() + let tx = zebra_test_data::TransactionBuilder::overwintered() .set_version_group_id(OVERWINTER_TX_VERSION_GROUP_ID) .set_version(OVERWINTER_TX_VERSION + 1) .into(); @@ -1051,7 +1051,7 @@ mod tests { ); // sprout tx passes check - let tx = test_data::TransactionBuilder::default() + let tx = zebra_test_data::TransactionBuilder::default() .set_version(BTC_TX_VERSION) .into(); assert_eq!( @@ -1065,7 +1065,7 @@ mod tests { ); // overwinter tx passes check - let tx = test_data::TransactionBuilder::overwintered() + let tx = zebra_test_data::TransactionBuilder::overwintered() .set_version(OVERWINTER_TX_VERSION) .set_version_group_id(OVERWINTER_TX_VERSION_GROUP_ID) .into(); @@ -1080,7 +1080,7 @@ mod tests { ); // sapling tx passes check - let tx = test_data::TransactionBuilder::overwintered() + let tx = zebra_test_data::TransactionBuilder::overwintered() .set_version(SAPLING_TX_VERSION) .set_version_group_id(SAPLING_TX_VERSION_GROUP_ID) .into(); diff --git a/verification/src/canon.rs b/verification/src/canon.rs index ef0bf6fb..a9f83018 100644 --- a/verification/src/canon.rs +++ b/verification/src/canon.rs @@ -1,6 +1,6 @@ -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; -use primitives::hash::H256; use std::ops; +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; +use zebra_primitives::hash::H256; /// Blocks whose parents are known to be in the chain #[derive(Clone, Copy)] @@ -85,7 +85,7 @@ impl<'a> CanonTransaction<'a> { } } - pub fn join_split(&self) -> Option<&'a chain::JoinSplit> { + pub fn join_split(&self) -> Option<&'a zebra_chain::JoinSplit> { self.transaction.raw.join_split.as_ref() } } diff --git a/verification/src/chain_verifier.rs b/verification/src/chain_verifier.rs index b9259519..79504562 100644 --- a/verification/src/chain_verifier.rs +++ b/verification/src/chain_verifier.rs @@ -3,17 +3,17 @@ use accept_chain::ChainAcceptor; use accept_transaction::MemoryPoolTransactionAcceptor; use canon::{CanonBlock, CanonTransaction}; -use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; use deployments::{BlockDeployments, Deployments}; use error::{Error, TransactionError}; -use network::ConsensusParams; -use storage::{ - BlockHeaderProvider, BlockOrigin, CachedTransactionOutputProvider, - DuplexTransactionOutputProvider, NoopStore, SharedStore, TransactionOutputProvider, -}; use verify_chain::ChainVerifier; use verify_header::HeaderVerifier; use verify_transaction::MemoryPoolTransactionVerifier; +use zebra_chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction}; +use zebra_network::ConsensusParams; +use zebra_storage::{ + BlockHeaderProvider, BlockOrigin, CachedTransactionOutputProvider, + DuplexTransactionOutputProvider, NoopStore, SharedStore, TransactionOutputProvider, +}; use {VerificationLevel, Verify}; pub struct BackwardsCompatibleChainVerifier { @@ -229,23 +229,23 @@ impl Verify for BackwardsCompatibleChainVerifier { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::BackwardsCompatibleChainVerifier as ChainVerifier; - use chain::IndexedBlock; - use db::BlockChainDatabase; - use network::{ConsensusParams, Network}; - use script; use std::sync::Arc; - use storage::Error as DBError; + use zebra_chain::IndexedBlock; + use zebra_db::BlockChainDatabase; + use zebra_network::{ConsensusParams, Network}; + use zebra_script; + use zebra_storage::Error as DBError; use {Error, TransactionError, VerificationLevel, Verify}; #[test] fn verify_orphan() { let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); - let b2 = test_data::block_h2().into(); + let b2 = zebra_test_data::block_h2().into(); let verifier = ChainVerifier::new(storage, ConsensusParams::new(Network::Unitest)); assert_eq!( Err(Error::Database(DBError::UnknownParent)), @@ -256,9 +256,9 @@ mod tests { #[test] fn verify_smoky() { let storage = Arc::new(BlockChainDatabase::init_test_chain(vec![ - test_data::genesis().into(), + zebra_test_data::genesis().into(), ])); - let b1 = test_data::block_h1(); + let b1 = zebra_test_data::block_h1(); let verifier = ChainVerifier::new(storage, ConsensusParams::new(Network::Mainnet)); assert_eq!(verifier.verify(VerificationLevel::FULL, &b1.into()), Ok(())); } @@ -266,10 +266,10 @@ mod tests { #[test] fn first_tx() { let storage = BlockChainDatabase::init_test_chain(vec![ - test_data::block_h0().into(), - test_data::block_h1().into(), + zebra_test_data::block_h0().into(), + zebra_test_data::block_h1().into(), ]); - let b1 = test_data::block_h2(); + let b1 = zebra_test_data::block_h2(); let verifier = ChainVerifier::new(Arc::new(storage), ConsensusParams::new(Network::Mainnet)); assert_eq!(verifier.verify(VerificationLevel::FULL, &b1.into()), Ok(())); @@ -278,7 +278,7 @@ mod tests { #[test] fn coinbase_maturity() { let consensus = ConsensusParams::new(Network::Unitest); - let genesis = test_data::block_builder() + let genesis = zebra_test_data::block_builder() .transaction() .coinbase() .output() @@ -292,7 +292,7 @@ mod tests { let storage = BlockChainDatabase::init_test_chain(vec![genesis.clone().into()]); let genesis_coinbase = genesis.transactions()[0].hash(); - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .transaction() .coinbase() .founder_reward(&consensus, 1) @@ -327,7 +327,7 @@ mod tests { fn non_coinbase_happy() { let consensus = ConsensusParams::new(Network::Unitest); - let genesis = test_data::block_builder() + let genesis = zebra_test_data::block_builder() .transaction() .coinbase() .output() @@ -346,7 +346,7 @@ mod tests { let storage = BlockChainDatabase::init_test_chain(vec![genesis.clone().into()]); let reference_tx = genesis.transactions()[1].hash(); - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .transaction() .coinbase() .founder_reward(&consensus, 1) @@ -378,7 +378,7 @@ mod tests { fn transaction_references_same_block_happy() { let consensus = ConsensusParams::new(Network::Unitest); - let genesis = test_data::block_builder() + let genesis = zebra_test_data::block_builder() .transaction() .coinbase() .output() @@ -397,7 +397,7 @@ mod tests { let storage = BlockChainDatabase::init_test_chain(vec![genesis.clone().into()]); let first_tx_hash = genesis.transactions()[1].hash(); - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .transaction() .coinbase() .founder_reward(&consensus, 1) @@ -434,7 +434,7 @@ mod tests { #[test] fn transaction_references_same_block_overspend() { - let genesis = test_data::block_builder() + let genesis = zebra_test_data::block_builder() .transaction() .coinbase() .output() @@ -453,7 +453,7 @@ mod tests { let storage = BlockChainDatabase::init_test_chain(vec![genesis.clone().into()]); let first_tx_hash = genesis.transactions()[1].hash(); - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .transaction() .coinbase() .output() @@ -499,7 +499,7 @@ mod tests { #[test] #[ignore] fn coinbase_happy() { - let genesis = test_data::block_builder() + let genesis = zebra_test_data::block_builder() .transaction() .coinbase() .output() @@ -515,7 +515,7 @@ mod tests { // waiting 100 blocks for genesis coinbase to become valid for _ in 0..100 { - let block: IndexedBlock = test_data::block_builder() + let block: IndexedBlock = zebra_test_data::block_builder() .transaction() .coinbase() .build() @@ -533,7 +533,7 @@ mod tests { let best_hash = storage.best_block().hash; - let block = test_data::block_builder() + let block = zebra_test_data::block_builder() .transaction() .coinbase() .build() @@ -556,7 +556,7 @@ mod tests { #[test] fn absoulte_sigops_overflow_block() { - let genesis = test_data::block_builder() + let genesis = zebra_test_data::block_builder() .transaction() .coinbase() .build() @@ -572,17 +572,17 @@ mod tests { let storage = BlockChainDatabase::init_test_chain(vec![genesis.clone().into()]); let reference_tx = genesis.transactions()[1].hash(); - let mut builder_tx1 = script::Builder::default(); + let mut builder_tx1 = zebra_script::Builder::default(); for _ in 0..81000 { - builder_tx1 = builder_tx1.push_opcode(script::Opcode::OP_CHECKSIG) + builder_tx1 = builder_tx1.push_opcode(zebra_script::Opcode::OP_CHECKSIG) } - let mut builder_tx2 = script::Builder::default(); + let mut builder_tx2 = zebra_script::Builder::default(); for _ in 0..81001 { - builder_tx2 = builder_tx2.push_opcode(script::Opcode::OP_CHECKSIG) + builder_tx2 = builder_tx2.push_opcode(zebra_script::Opcode::OP_CHECKSIG) } - let block: IndexedBlock = test_data::block_builder() + let block: IndexedBlock = zebra_test_data::block_builder() .transaction() .coinbase() .build() @@ -615,7 +615,7 @@ mod tests { #[test] fn coinbase_overspend() { - let genesis = test_data::block_builder() + let genesis = zebra_test_data::block_builder() .transaction() .coinbase() .build() @@ -624,7 +624,7 @@ mod tests { .build(); let storage = BlockChainDatabase::init_test_chain(vec![genesis.clone().into()]); - let block: IndexedBlock = test_data::block_builder() + let block: IndexedBlock = zebra_test_data::block_builder() .transaction() .coinbase() .output() diff --git a/verification/src/deployments.rs b/verification/src/deployments.rs index 842fd2b4..cebf2c01 100644 --- a/verification/src/deployments.rs +++ b/verification/src/deployments.rs @@ -1,10 +1,10 @@ use hash::H256; -use network::{ConsensusParams, Deployment}; use parking_lot::Mutex; use std::collections::hash_map::Entry; use std::collections::HashMap; -use storage::{BlockAncestors, BlockHeaderProvider, BlockIterator, BlockRef}; use timestamp::median_timestamp; +use zebra_network::{ConsensusParams, Deployment}; +use zebra_storage::{BlockAncestors, BlockHeaderProvider, BlockIterator, BlockRef}; #[derive(Debug, PartialEq, Clone, Copy)] enum ThresholdState { @@ -309,13 +309,13 @@ impl<'a> Iterator for ThresholdIterator<'a> { #[cfg(test)] mod tests { use super::{first_of_the_period, threshold_state, DeploymentStateCache, ThresholdState}; - use chain::{BlockHeader, IndexedBlockHeader}; use hash::H256; - use network::Deployment; - use primitives::bytes::Bytes; use std::collections::HashMap; use std::sync::atomic::{AtomicUsize, Ordering}; - use storage::{BlockHeaderProvider, BlockRef}; + use zebra_chain::{BlockHeader, IndexedBlockHeader}; + use zebra_network::Deployment; + use zebra_primitives::bytes::Bytes; + use zebra_storage::{BlockHeaderProvider, BlockRef}; const MINER_CONFIRMATION_WINDOW: u32 = 1000; const RULE_CHANGE_ACTIVATION_THRESHOLD: u32 = 900; diff --git a/verification/src/equihash.rs b/verification/src/equihash.rs index 5efff7ed..080e16f1 100644 --- a/verification/src/equihash.rs +++ b/verification/src/equihash.rs @@ -1,5 +1,5 @@ -use chain::BlockHeader; -use crypto::Blake2b; +use zebra_chain::BlockHeader; +use zebra_crypto::Blake2b; /// Verify equihash solution of the block header. pub fn verify_block_equihash_solution(params: (u32, u32), header: &BlockHeader) -> bool { @@ -337,7 +337,7 @@ mod on_chain_equihash { mod tests { use super::*; - use primitives::bigint::U256; + use zebra_primitives::bigint::U256; struct TestEquihash; @@ -462,7 +462,7 @@ mod tests { #[test] fn test_equihash_on_real_block() { - let block = test_data::block_h170(); + let block = zebra_test_data::block_h170(); assert!(verify_block_equihash_solution( (200, 9), &block.block_header diff --git a/verification/src/error.rs b/verification/src/error.rs index c4180f20..442f6f9e 100644 --- a/verification/src/error.rs +++ b/verification/src/error.rs @@ -1,7 +1,7 @@ use compact::Compact; use hash::H256; -use script::Error as SignatureError; -use storage::Error as DBError; +use zebra_script::Error as SignatureError; +use zebra_storage::Error as DBError; #[derive(Debug, PartialEq)] /// All possible verification errors @@ -141,7 +141,7 @@ pub enum TransactionError { /// Join split is not supported in the transaction version. JoinSplitVersionInvalid, /// Invalid join split signature - JoinSplitSignature(::crypto::Error), + JoinSplitSignature(::zebra_crypto::Error), /// Transaction sapling verification has failed. InvalidSapling, /// Sapling nullifier already revealed earlier in the chain. diff --git a/verification/src/fee.rs b/verification/src/fee.rs index f2e62015..b792e8ca 100644 --- a/verification/src/fee.rs +++ b/verification/src/fee.rs @@ -1,5 +1,5 @@ -use chain::Transaction; -use storage::TransactionOutputProvider; +use zebra_chain::Transaction; +use zebra_storage::TransactionOutputProvider; use TransactionError; /// Compute miner fee for given transaction. @@ -79,16 +79,16 @@ pub fn checked_transaction_fee( #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::*; - use db::BlockChainDatabase; use std::sync::Arc; - use storage::AsSubstore; + use zebra_db::BlockChainDatabase; + use zebra_storage::AsSubstore; #[test] fn test_transaction_fee() { - let b0 = test_data::block_builder() + let b0 = zebra_test_data::block_builder() .header() .nonce(1.into()) .build() @@ -103,7 +103,7 @@ mod tests { .build(); let tx0 = b0.transactions[0].clone(); let tx0_hash = tx0.hash(); - let b1 = test_data::block_builder() + let b1 = zebra_test_data::block_builder() .header() .parent(b0.hash().clone()) .nonce(2.into()) diff --git a/verification/src/lib.rs b/verification/src/lib.rs index a1c28caa..1d0ccae6 100644 --- a/verification/src/lib.rs +++ b/verification/src/lib.rs @@ -63,18 +63,18 @@ extern crate rustc_hex as hex; #[macro_use] extern crate bitflags; -extern crate bitcrypto as crypto; extern crate bitvec; -extern crate chain; -extern crate keys; -extern crate network; -extern crate primitives; -extern crate script; -extern crate serialization as ser; -extern crate storage; +extern crate zebra_chain; +extern crate zebra_crypto; +extern crate zebra_keys; +extern crate zebra_network; +extern crate zebra_primitives; +extern crate zebra_script; +extern crate zebra_serialization as ser; +extern crate zebra_storage; #[cfg(test)] -extern crate db; +extern crate zebra_db; #[cfg(test)] #[macro_use] @@ -109,7 +109,7 @@ mod chain_verifier; mod tree_cache; -pub use primitives::{bigint, compact, hash}; +pub use zebra_primitives::{bigint, compact, hash}; pub use accept_block::BlockAcceptor; pub use accept_chain::ChainAcceptor; @@ -148,5 +148,9 @@ bitflags! { /// Interface for block verification pub trait Verify: Send + Sync { - fn verify(&self, level: VerificationLevel, block: &chain::IndexedBlock) -> Result<(), Error>; + fn verify( + &self, + level: VerificationLevel, + block: &zebra_chain::IndexedBlock, + ) -> Result<(), Error>; } diff --git a/verification/src/sapling.rs b/verification/src/sapling.rs index 30204c9b..befe464d 100644 --- a/verification/src/sapling.rs +++ b/verification/src/sapling.rs @@ -1,5 +1,6 @@ -use chain::{Sapling, SaplingOutputDescription, SaplingSpendDescription}; -use crypto::{ +use std::io::Error as IoError; +use zebra_chain::{Sapling, SaplingOutputDescription, SaplingSpendDescription}; +use zebra_crypto::{ bellman::{ groth16::{verify_proof, Proof}, SynthesisError, @@ -15,7 +16,6 @@ use crypto::{ }, Groth16VerifyingKey, JUBJUB, }; -use std::io::Error as IoError; type Point = edwards::Point; @@ -310,11 +310,11 @@ fn is_small_order(point: &Point) -> bool { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::*; - use chain::Transaction; - use script::{SighashBase, TransactionInputSigner}; + use zebra_chain::Transaction; + use zebra_script::{SighashBase, TransactionInputSigner}; // tx: https://zcash.blockexplorer.com/tx/bd4fe81c15cfbd125f5ca6fe51fb5ac4ef340e64a36f576a6a09f7528eb2e176 fn test_tx() -> Transaction { @@ -336,8 +336,8 @@ mod tests { } fn run_accept_sapling(tx: Transaction) -> Result<(), Error> { - let spend_vk = crypto::load_sapling_spend_verifying_key().unwrap(); - let output_vk = crypto::load_sapling_output_verifying_key().unwrap(); + let spend_vk = zebra_crypto::load_sapling_spend_verifying_key().unwrap(); + let output_vk = zebra_crypto::load_sapling_output_verifying_key().unwrap(); let sighash = compute_sighash(tx.clone()); let sapling = tx.sapling.unwrap(); @@ -369,8 +369,8 @@ mod tests { } fn bad_verifying_key() -> Groth16VerifyingKey { - use crypto::bellman::groth16::{prepare_verifying_key, VerifyingKey}; - use crypto::pairing::{ + use zebra_crypto::bellman::groth16::{prepare_verifying_key, VerifyingKey}; + use zebra_crypto::pairing::{ bls12_381::{G1Affine, G2Affine}, CurveAffine, }; @@ -393,7 +393,7 @@ mod tests { #[test] fn accept_spend_fails() { - let spend_vk = crypto::load_sapling_spend_verifying_key().unwrap(); + let spend_vk = zebra_crypto::load_sapling_spend_verifying_key().unwrap(); let sighash = compute_sighash(test_tx()); let sapling = test_tx().sapling.unwrap(); let mut total = edwards::Point::zero(); @@ -476,7 +476,7 @@ mod tests { #[test] fn accept_output_fails() { - let output_vk = crypto::load_sapling_output_verifying_key().unwrap(); + let output_vk = zebra_crypto::load_sapling_output_verifying_key().unwrap(); let sapling = test_tx().sapling.unwrap(); let mut total = edwards::Point::zero(); diff --git a/verification/src/sigops.rs b/verification/src/sigops.rs index 9af86660..d014f922 100644 --- a/verification/src/sigops.rs +++ b/verification/src/sigops.rs @@ -1,6 +1,6 @@ -use chain::Transaction; -use script::Script; -use storage::TransactionOutputProvider; +use zebra_chain::Transaction; +use zebra_script::Script; +use zebra_storage::TransactionOutputProvider; /// Counts signature operations in given transaction /// bip16_active flag indicates if we should also count signature operations diff --git a/verification/src/sprout.rs b/verification/src/sprout.rs index c6329694..5e45d2e0 100644 --- a/verification/src/sprout.rs +++ b/verification/src/sprout.rs @@ -1,5 +1,5 @@ -use chain::{JoinSplit, JoinSplitDescription, JoinSplitProof}; -use crypto::{curve::bls, curve::bn, pghr13_verify, Pghr13Proof}; +use zebra_chain::{JoinSplit, JoinSplitDescription, JoinSplitProof}; +use zebra_crypto::{curve::bls, curve::bn, pghr13_verify, Pghr13Proof}; /// Join split verification error kind #[derive(Debug)] @@ -18,7 +18,7 @@ pub fn compute_hsig( nullifiers: &[[u8; 32]; 2], pub_key_hash: &[u8; 32], ) -> [u8; 32] { - use crypto::blake2::Params; + use zebra_crypto::blake2::Params; let res = Params::new() .hash_length(32) @@ -38,8 +38,8 @@ pub fn compute_hsig( pub fn verify( desc: &JoinSplitDescription, join_split: &JoinSplit, - sprout_verifying_key: &crypto::Pghr13VerifyingKey, - sapling_verifying_key: &crypto::Groth16VerifyingKey, + sprout_verifying_key: &zebra_crypto::Pghr13VerifyingKey, + sapling_verifying_key: &zebra_crypto::Groth16VerifyingKey, ) -> Result<(), ErrorKind> { let hsig = compute_hsig( &desc.random_seed, @@ -74,7 +74,7 @@ pub fn verify( JoinSplitProof::Groth(ref proof) => { let input = input.into_bls_frs(); - if !crypto::bellman::groth16::verify_proof( + if !zebra_crypto::bellman::groth16::verify_proof( &sapling_verifying_key.0, &proof .to_bls_proof() @@ -143,7 +143,7 @@ impl Input { } pub fn into_bls_frs(self) -> Vec { - use crypto::pairing::{Field, PrimeField}; + use zebra_crypto::pairing::{Field, PrimeField}; let mut frs = Vec::new(); @@ -168,9 +168,9 @@ impl Input { mod tests { use super::{compute_hsig, verify}; - use chain::{JoinSplit, JoinSplitDescription, JoinSplitProof}; - use crypto; - use crypto::load_joinsplit_groth16_verifying_key; + use zebra_chain::{JoinSplit, JoinSplitDescription, JoinSplitProof}; + use zebra_crypto; + use zebra_crypto::load_joinsplit_groth16_verifying_key; fn hash(s: &'static str) -> [u8; 32] { use hex::FromHex; @@ -195,14 +195,14 @@ mod tests { result } - fn dummy_groth16_key() -> crypto::Groth16VerifyingKey { - use crypto::bellman::groth16::{prepare_verifying_key, VerifyingKey}; - use crypto::pairing::{ + fn dummy_groth16_key() -> zebra_crypto::Groth16VerifyingKey { + use zebra_crypto::bellman::groth16::{prepare_verifying_key, VerifyingKey}; + use zebra_crypto::pairing::{ bls12_381::{G1Affine, G2Affine}, CurveAffine, }; - crypto::Groth16VerifyingKey(prepare_verifying_key(&VerifyingKey { + zebra_crypto::Groth16VerifyingKey(prepare_verifying_key(&VerifyingKey { alpha_g1: G1Affine::zero(), beta_g1: G1Affine::zero(), beta_g2: G2Affine::zero(), @@ -307,8 +307,8 @@ mod tests { assert_eq!(input.into_bn_frs()[0].into_u256(), 10161672.into()); } - fn vkey() -> crypto::Pghr13VerifyingKey { - crypto::json::pghr13::decode(include_bytes!("../../res/sprout-verifying-key.json")) + fn vkey() -> zebra_crypto::Pghr13VerifyingKey { + zebra_crypto::json::pghr13::decode(include_bytes!("../../res/sprout-verifying-key.json")) .expect("known to be good") .into() } diff --git a/verification/src/timestamp.rs b/verification/src/timestamp.rs index 44006307..87d2af4c 100644 --- a/verification/src/timestamp.rs +++ b/verification/src/timestamp.rs @@ -1,6 +1,6 @@ -use chain::BlockHeader; -use primitives::hash::H256; -use storage::{BlockAncestors, BlockHeaderProvider}; +use zebra_chain::BlockHeader; +use zebra_primitives::hash::H256; +use zebra_storage::{BlockAncestors, BlockHeaderProvider}; /// Returns median timestamp, of given header ancestors. /// The header should be later expected to have higher timestamp diff --git a/verification/src/tree_cache.rs b/verification/src/tree_cache.rs index 36b9babc..a8ee910a 100644 --- a/verification/src/tree_cache.rs +++ b/verification/src/tree_cache.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; -use chain::hash::H256; use error::TransactionError; -use storage::{SaplingTreeState, SproutTreeState, TreeStateProvider}; +use zebra_chain::hash::H256; +use zebra_storage::{SaplingTreeState, SproutTreeState, TreeStateProvider}; #[derive(Clone)] pub struct TreeCache<'a> { diff --git a/verification/src/verify_block.rs b/verification/src/verify_block.rs index 39469dc8..6e2c61b8 100644 --- a/verification/src/verify_block.rs +++ b/verification/src/verify_block.rs @@ -1,9 +1,9 @@ -use chain::IndexedBlock; use error::{Error, TransactionError}; -use network::ConsensusParams; use sigops::transaction_sigops; use std::collections::HashSet; -use storage::NoopStore; +use zebra_chain::IndexedBlock; +use zebra_network::ConsensusParams; +use zebra_storage::NoopStore; pub struct BlockVerifier<'a> { pub empty: BlockEmpty<'a>, diff --git a/verification/src/verify_chain.rs b/verification/src/verify_chain.rs index 082adb36..48f07224 100644 --- a/verification/src/verify_chain.rs +++ b/verification/src/verify_chain.rs @@ -1,10 +1,10 @@ -use chain::IndexedBlock; use error::Error; -use network::ConsensusParams; use rayon::prelude::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator}; use verify_block::BlockVerifier; use verify_header::HeaderVerifier; use verify_transaction::TransactionVerifier; +use zebra_chain::IndexedBlock; +use zebra_network::ConsensusParams; use VerificationLevel; pub struct ChainVerifier<'a> { diff --git a/verification/src/verify_header.rs b/verification/src/verify_header.rs index 213dbe32..44334935 100644 --- a/verification/src/verify_header.rs +++ b/verification/src/verify_header.rs @@ -1,10 +1,10 @@ -use chain::IndexedBlockHeader; use constants::BLOCK_MAX_FUTURE; use equihash::verify_block_equihash_solution; use error::Error; -use network::ConsensusParams; -use primitives::compact::Compact; use work::is_valid_proof_of_work; +use zebra_chain::IndexedBlockHeader; +use zebra_network::ConsensusParams; +use zebra_primitives::compact::Compact; pub struct HeaderVerifier<'a> { pub version: HeaderVersion<'a>, @@ -130,11 +130,11 @@ impl<'a> HeaderEquihashSolution<'a> { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::HeaderVersion; use error::Error; - use network::{ConsensusParams, Network}; + use zebra_network::{ConsensusParams, Network}; #[test] fn header_version_works() { @@ -142,7 +142,7 @@ mod tests { assert_eq!( HeaderVersion::new( - &test_data::block_builder() + &zebra_test_data::block_builder() .header() .version(consensus.min_block_version() - 1) .build() @@ -156,7 +156,7 @@ mod tests { ); assert_eq!( HeaderVersion::new( - &test_data::block_builder() + &zebra_test_data::block_builder() .header() .version(consensus.min_block_version()) .build() @@ -170,7 +170,7 @@ mod tests { ); assert_eq!( HeaderVersion::new( - &test_data::block_builder() + &zebra_test_data::block_builder() .header() .version(consensus.min_block_version() + 1) .build() diff --git a/verification/src/verify_transaction.rs b/verification/src/verify_transaction.rs index 8bb280d4..8667a816 100644 --- a/verification/src/verify_transaction.rs +++ b/verification/src/verify_transaction.rs @@ -1,14 +1,14 @@ -use chain::{ - IndexedTransaction, BTC_TX_VERSION, OVERWINTER_TX_VERSION, OVERWINTER_TX_VERSION_GROUP_ID, - SAPLING_TX_VERSION_GROUP_ID, -}; use constants::{MAX_COINBASE_SIZE, MIN_COINBASE_SIZE}; use error::TransactionError; -use network::ConsensusParams; use ser::Serializable; use sigops::transaction_sigops; use std::{collections::HashMap, ops}; -use storage::NoopStore; +use zebra_chain::{ + IndexedTransaction, BTC_TX_VERSION, OVERWINTER_TX_VERSION, OVERWINTER_TX_VERSION_GROUP_ID, + SAPLING_TX_VERSION_GROUP_ID, +}; +use zebra_network::ConsensusParams; +use zebra_storage::NoopStore; pub struct TransactionVerifier<'a> { pub version: TransactionVersion<'a>, @@ -628,7 +628,7 @@ impl<'a> TransactionDuplicateSaplingNullifiers<'a> { #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{ TransactionDuplicateInputs, TransactionDuplicateJoinSplitNullifiers, @@ -636,12 +636,12 @@ mod tests { TransactionInputValueOverflow, TransactionJoinSplit, TransactionNonTransparentCoinbase, TransactionOutputValueOverflow, TransactionSapling, TransactionVersion, }; - use chain::{ + use error::TransactionError; + use zebra_chain::{ JoinSplit, JoinSplitDescription, Sapling, BTC_TX_VERSION, OVERWINTER_TX_VERSION, OVERWINTER_TX_VERSION_GROUP_ID, SAPLING_TX_VERSION_GROUP_ID, }; - use error::TransactionError; - use network::{ConsensusParams, Network}; + use zebra_network::{ConsensusParams, Network}; #[test] fn transaction_empty_works() { @@ -649,7 +649,7 @@ mod tests { assert_eq!( TransactionEmpty::new( - &test_data::TransactionBuilder::with_version(2) + &zebra_test_data::TransactionBuilder::with_version(2) .add_output(0) .into() ) @@ -659,7 +659,7 @@ mod tests { assert_eq!( TransactionEmpty::new( - &test_data::TransactionBuilder::with_version(2) + &zebra_test_data::TransactionBuilder::with_version(2) .add_output(0) .add_default_join_split() .into() @@ -670,7 +670,7 @@ mod tests { assert_eq!( TransactionEmpty::new( - &test_data::TransactionBuilder::with_version(2) + &zebra_test_data::TransactionBuilder::with_version(2) .add_output(0) .set_sapling(Sapling { spends: vec![Default::default()], @@ -686,7 +686,7 @@ mod tests { assert_eq!( TransactionEmpty::new( - &test_data::TransactionBuilder::with_version(2) + &zebra_test_data::TransactionBuilder::with_version(2) .add_default_input(0) .into() ) @@ -696,7 +696,7 @@ mod tests { assert_eq!( TransactionEmpty::new( - &test_data::TransactionBuilder::with_version(2) + &zebra_test_data::TransactionBuilder::with_version(2) .add_default_input(0) .add_default_join_split() .into() @@ -707,7 +707,7 @@ mod tests { assert_eq!( TransactionEmpty::new( - &test_data::TransactionBuilder::with_version(2) + &zebra_test_data::TransactionBuilder::with_version(2) .add_default_input(0) .set_sapling(Sapling { outputs: vec![Default::default()], @@ -723,13 +723,14 @@ mod tests { #[test] fn transaction_version_works() { assert_eq!( - TransactionVersion::new(&test_data::TransactionBuilder::with_version(0).into()).check(), + TransactionVersion::new(&zebra_test_data::TransactionBuilder::with_version(0).into()) + .check(), Err(TransactionError::InvalidVersion) ); assert_eq!( TransactionVersion::new( - &test_data::TransactionBuilder::with_version(BTC_TX_VERSION).into() + &zebra_test_data::TransactionBuilder::with_version(BTC_TX_VERSION).into() ) .check(), Ok(()) @@ -737,7 +738,7 @@ mod tests { assert_eq!( TransactionVersion::new( - &test_data::TransactionBuilder::overwintered() + &zebra_test_data::TransactionBuilder::overwintered() .set_version(BTC_TX_VERSION) .into() ) @@ -747,7 +748,7 @@ mod tests { assert_eq!( TransactionVersion::new( - &test_data::TransactionBuilder::overwintered() + &zebra_test_data::TransactionBuilder::overwintered() .set_version(OVERWINTER_TX_VERSION) .into() ) @@ -757,7 +758,7 @@ mod tests { assert_eq!( TransactionVersion::new( - &test_data::TransactionBuilder::overwintered() + &zebra_test_data::TransactionBuilder::overwintered() .set_version(OVERWINTER_TX_VERSION) .set_version_group_id(OVERWINTER_TX_VERSION_GROUP_ID) .into() @@ -768,7 +769,7 @@ mod tests { assert_eq!( TransactionVersion::new( - &test_data::TransactionBuilder::overwintered() + &zebra_test_data::TransactionBuilder::overwintered() .set_version(OVERWINTER_TX_VERSION) .set_version_group_id(SAPLING_TX_VERSION_GROUP_ID) .into() @@ -782,7 +783,7 @@ mod tests { fn transaction_non_transparent_coinbase_works() { assert_eq!( TransactionNonTransparentCoinbase::new( - &test_data::TransactionBuilder::coinbase() + &zebra_test_data::TransactionBuilder::coinbase() .add_default_join_split() .into() ) @@ -792,7 +793,7 @@ mod tests { assert_eq!( TransactionNonTransparentCoinbase::new( - &test_data::TransactionBuilder::coinbase() + &zebra_test_data::TransactionBuilder::coinbase() .set_sapling(Sapling { spends: vec![Default::default()], ..Default::default() @@ -805,7 +806,7 @@ mod tests { assert_eq!( TransactionNonTransparentCoinbase::new( - &test_data::TransactionBuilder::coinbase() + &zebra_test_data::TransactionBuilder::coinbase() .set_sapling(Sapling { outputs: vec![Default::default()], ..Default::default() @@ -818,7 +819,7 @@ mod tests { assert_eq!( TransactionNonTransparentCoinbase::new( - &test_data::TransactionBuilder::coinbase() + &zebra_test_data::TransactionBuilder::coinbase() .set_sapling(Default::default()) .into() ) @@ -828,7 +829,7 @@ mod tests { assert_eq!( TransactionNonTransparentCoinbase::new( - &test_data::TransactionBuilder::coinbase().into() + &zebra_test_data::TransactionBuilder::coinbase().into() ) .check(), Ok(()) @@ -836,7 +837,7 @@ mod tests { assert_eq!( TransactionNonTransparentCoinbase::new( - &test_data::TransactionBuilder::default() + &zebra_test_data::TransactionBuilder::default() .add_default_join_split() .into() ) @@ -846,7 +847,7 @@ mod tests { assert_eq!( TransactionNonTransparentCoinbase::new( - &test_data::TransactionBuilder::default().into() + &zebra_test_data::TransactionBuilder::default().into() ) .check(), Ok(()) @@ -860,7 +861,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_output(max_value as u64 + 1).into(), + &zebra_test_data::TransactionBuilder::with_output(max_value as u64 + 1).into(), &consensus ) .check(), @@ -869,7 +870,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_output(max_value as u64 / 2) + &zebra_test_data::TransactionBuilder::with_output(max_value as u64 / 2) .add_output(max_value as u64 / 2 + 1) .into(), &consensus @@ -880,7 +881,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_output(max_value as u64).into(), + &zebra_test_data::TransactionBuilder::with_output(max_value as u64).into(), &consensus ) .check(), @@ -889,7 +890,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: max_value, ..Default::default() }) @@ -902,7 +903,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: max_value + 1, ..Default::default() }) @@ -915,7 +916,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_output(max_value as u64 / 2 + 1) + &zebra_test_data::TransactionBuilder::with_output(max_value as u64 / 2 + 1) .set_sapling(Sapling { balancing_value: -max_value / 2, ..Default::default() @@ -929,7 +930,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: max_value as u64, value_pub_new: 0, @@ -946,7 +947,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: max_value as u64 + 1, value_pub_new: 0, @@ -963,7 +964,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: 0, value_pub_new: max_value as u64, @@ -980,7 +981,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: 0, value_pub_new: max_value as u64 + 1, @@ -997,7 +998,7 @@ mod tests { assert_eq!( TransactionOutputValueOverflow::new( - &test_data::TransactionBuilder::with_output(max_value as u64 / 2 + 1) + &zebra_test_data::TransactionBuilder::with_output(max_value as u64 / 2 + 1) .set_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: max_value as u64 / 2, @@ -1021,7 +1022,7 @@ mod tests { assert_eq!( TransactionInputValueOverflow::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_new: max_value as u64, ..Default::default() @@ -1037,7 +1038,7 @@ mod tests { assert_eq!( TransactionInputValueOverflow::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_new: max_value as u64 + 1, ..Default::default() @@ -1053,7 +1054,7 @@ mod tests { assert_eq!( TransactionInputValueOverflow::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: max_value, ..Default::default() }) @@ -1066,7 +1067,7 @@ mod tests { assert_eq!( TransactionInputValueOverflow::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: max_value + 1, ..Default::default() }) @@ -1079,7 +1080,7 @@ mod tests { assert_eq!( TransactionInputValueOverflow::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_new: max_value as u64 / 2 + 1, ..Default::default() @@ -1104,7 +1105,7 @@ mod tests { assert_eq!( TransactionExpiry::new( - &test_data::TransactionBuilder::overwintered() + &zebra_test_data::TransactionBuilder::overwintered() .set_expiry_height(consensus.transaction_expiry_height_threshold() - 1) .into(), &consensus @@ -1115,7 +1116,7 @@ mod tests { assert_eq!( TransactionExpiry::new( - &test_data::TransactionBuilder::overwintered() + &zebra_test_data::TransactionBuilder::overwintered() .set_expiry_height(consensus.transaction_expiry_height_threshold()) .into(), &consensus @@ -1129,7 +1130,7 @@ mod tests { fn transaction_sapling_works() { assert_eq!( TransactionSapling::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: 100, spends: vec![Default::default()], ..Default::default() @@ -1142,7 +1143,7 @@ mod tests { assert_eq!( TransactionSapling::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: 100, outputs: vec![Default::default()], ..Default::default() @@ -1155,7 +1156,7 @@ mod tests { assert_eq!( TransactionSapling::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: 100, outputs: vec![Default::default()], spends: vec![Default::default()], @@ -1169,7 +1170,7 @@ mod tests { assert_eq!( TransactionSapling::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { balancing_value: 100, ..Default::default() }) @@ -1184,7 +1185,7 @@ mod tests { fn transaction_join_split_works() { assert_eq!( TransactionJoinSplit::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: 100, value_pub_new: 0, @@ -1200,7 +1201,7 @@ mod tests { assert_eq!( TransactionJoinSplit::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: 0, value_pub_new: 100, @@ -1216,7 +1217,7 @@ mod tests { assert_eq!( TransactionJoinSplit::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { value_pub_old: 100, value_pub_new: 100, @@ -1235,7 +1236,7 @@ mod tests { fn transaction_duplicate_inputs_works() { assert_eq!( TransactionDuplicateInputs::new( - &test_data::TransactionBuilder::with_default_input(0) + &zebra_test_data::TransactionBuilder::with_default_input(0) .add_default_input(1) .into() ) @@ -1245,7 +1246,7 @@ mod tests { assert_eq!( TransactionDuplicateInputs::new( - &test_data::TransactionBuilder::with_default_input(0) + &zebra_test_data::TransactionBuilder::with_default_input(0) .add_default_input(0) .into() ) @@ -1258,7 +1259,7 @@ mod tests { fn transaction_duplicate_join_split_nullifiers_works() { assert_eq!( TransactionDuplicateJoinSplitNullifiers::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![JoinSplitDescription { nullifiers: [[1; 32], [2; 32]], ..Default::default() @@ -1273,7 +1274,7 @@ mod tests { assert_eq!( TransactionDuplicateJoinSplitNullifiers::new( - &test_data::TransactionBuilder::with_join_split(JoinSplit { + &zebra_test_data::TransactionBuilder::with_join_split(JoinSplit { descriptions: vec![Default::default(), Default::default()], ..Default::default() }) @@ -1288,7 +1289,7 @@ mod tests { fn transaction_duplicate_sapling_nullifiers_works() { assert_eq!( TransactionDuplicateSaplingNullifiers::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { spends: vec![Default::default()], ..Default::default() }) @@ -1300,7 +1301,7 @@ mod tests { assert_eq!( TransactionDuplicateSaplingNullifiers::new( - &test_data::TransactionBuilder::with_sapling(Sapling { + &zebra_test_data::TransactionBuilder::with_sapling(Sapling { spends: vec![Default::default(), Default::default()], ..Default::default() }) diff --git a/verification/src/work.rs b/verification/src/work.rs index 3820b832..98837d4c 100644 --- a/verification/src/work.rs +++ b/verification/src/work.rs @@ -1,9 +1,9 @@ -use network::ConsensusParams; -use primitives::bigint::U256; -use primitives::compact::Compact; -use primitives::hash::H256; -use storage::{BlockAncestors, BlockHeaderProvider}; use timestamp::median_timestamp_inclusive; +use zebra_network::ConsensusParams; +use zebra_primitives::bigint::U256; +use zebra_primitives::compact::Compact; +use zebra_primitives::hash::H256; +use zebra_storage::{BlockAncestors, BlockHeaderProvider}; /// Returns true if hash is lower or equal than target represented by compact bits pub fn is_valid_proof_of_work_hash(bits: Compact, hash: &H256) -> bool { @@ -124,18 +124,18 @@ fn calculate_work_required( #[cfg(test)] mod tests { - extern crate test_data; + extern crate zebra_test_data; use super::{calculate_work_required, work_required}; - use chain::{BlockHeader, IndexedBlockHeader}; - use network::{ConsensusParams, Network}; - use primitives::bigint::U256; - use primitives::bytes::Bytes; - use primitives::compact::Compact; - use primitives::hash::H256; use std::collections::HashMap; - use storage::{BlockHeaderProvider, BlockRef}; use timestamp::median_timestamp_inclusive; + use zebra_chain::{BlockHeader, IndexedBlockHeader}; + use zebra_network::{ConsensusParams, Network}; + use zebra_primitives::bigint::U256; + use zebra_primitives::bytes::Bytes; + use zebra_primitives::compact::Compact; + use zebra_primitives::hash::H256; + use zebra_storage::{BlockHeaderProvider, BlockRef}; #[derive(Default)] pub struct MemoryBlockHeaderProvider { @@ -191,11 +191,11 @@ mod tests { // insert genesis block let mut header_provider = MemoryBlockHeaderProvider::default(); - let genesis = test_data::genesis().block_header; + let genesis = zebra_test_data::genesis().block_header; header_provider.insert(genesis.clone()); // assert block#1 work - let h1 = test_data::block_h1(); + let h1 = zebra_test_data::block_h1(); let expected = h1.block_header.bits; let actual = work_required( genesis.hash(), diff --git a/zebra/commands/import.rs b/zebra/commands/import.rs index 67c3903d..05d7cfd1 100644 --- a/zebra/commands/import.rs +++ b/zebra/commands/import.rs @@ -1,7 +1,7 @@ use clap::ArgMatches; use config::Config; -use sync::{create_sync_blocks_writer, Error}; use util::init_db; +use zebra_sync::{create_sync_blocks_writer, Error}; pub fn import(cfg: Config, matches: &ArgMatches) -> Result<(), String> { try!(init_db(&cfg)); @@ -9,7 +9,7 @@ pub fn import(cfg: Config, matches: &ArgMatches) -> Result<(), String> { let blk_path = matches .value_of("PATH") .expect("PATH is required in cli.yml; qed"); - let blk_dir = ::import::open_blk_dir(blk_path) + let blk_dir = ::zebra_import::open_blk_dir(blk_path) .map_err(|err| format!("Failed to open import directory: {}", err))?; let mut writer = create_sync_blocks_writer(cfg.db, cfg.consensus, cfg.verification_params); diff --git a/zebra/commands/rollback.rs b/zebra/commands/rollback.rs index 292c3ab5..f4f41240 100644 --- a/zebra/commands/rollback.rs +++ b/zebra/commands/rollback.rs @@ -1,8 +1,8 @@ use clap::ArgMatches; use config::Config; -use primitives::hash::H256; -use storage::BlockRef; use util::init_db; +use zebra_primitives::hash::H256; +use zebra_storage::BlockRef; pub fn rollback(cfg: Config, matches: &ArgMatches) -> Result<(), String> { try!(init_db(&cfg)); diff --git a/zebra/commands/start.rs b/zebra/commands/start.rs index ccb2411f..3a3ffa4e 100644 --- a/zebra/commands/start.rs +++ b/zebra/commands/start.rs @@ -1,15 +1,17 @@ use super::super::rpc; -use primitives::hash::H256; +use config; use std::net::SocketAddr; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{channel, Receiver, Sender}; use std::sync::Arc; use std::thread; -use sync::{ +use util::{init_db, node_table_path}; +use zebra_p2p; +use zebra_primitives::hash::H256; +use zebra_sync::{ create_local_sync_node, create_sync_connection_factory, create_sync_peers, SyncListener, }; -use util::{init_db, node_table_path}; -use {config, p2p, ZCASH_PROTOCOL_MINIMUM, ZCASH_PROTOCOL_VERSION}; +use {ZCASH_PROTOCOL_MINIMUM, ZCASH_PROTOCOL_VERSION}; enum BlockNotifierTask { NewBlock(H256), @@ -86,17 +88,17 @@ impl Drop for BlockNotifier { } pub fn start(cfg: config::Config) -> Result<(), String> { - let mut el = p2p::event_loop(); + let mut el = zebra_p2p::event_loop(); init_db(&cfg)?; let nodes_path = node_table_path(&cfg); - let p2p_cfg = p2p::Config { + let p2p_cfg = zebra_p2p::Config { threads: cfg.p2p_threads, inbound_connections: cfg.inbound_connections, outbound_connections: cfg.outbound_connections, - connection: p2p::NetConfig { + connection: zebra_p2p::NetConfig { protocol_version: ZCASH_PROTOCOL_VERSION, protocol_minimum: ZCASH_PROTOCOL_MINIMUM, magic: cfg.consensus.magic(), @@ -128,7 +130,8 @@ pub fn start(cfg: config::Config) -> Result<(), String> { } let p2p = try!( - p2p::P2P::new(p2p_cfg, sync_connection_factory, el.handle()).map_err(|x| x.to_string()) + zebra_p2p::P2P::new(p2p_cfg, sync_connection_factory, el.handle()) + .map_err(|x| x.to_string()) ); let rpc_deps = rpc::Dependencies { consensus: cfg.consensus, @@ -140,6 +143,6 @@ pub fn start(cfg: config::Config) -> Result<(), String> { let _rpc_server = try!(rpc::new_http(cfg.rpc_config, rpc_deps)); try!(p2p.run().map_err(|_| "Failed to start p2p module")); - el.run(p2p::forever()).unwrap(); + el.run(zebra_p2p::forever()).unwrap(); Ok(()) } diff --git a/zebra/config.rs b/zebra/config.rs index 3d8e607f..74abdbcc 100644 --- a/zebra/config.rs +++ b/zebra/config.rs @@ -1,17 +1,17 @@ use clap; -use keys::Address; -use message::Services; -use network::{ConsensusParams, Network}; -use p2p::InternetProtocol; -use primitives::hash::H256; use rpc::HttpConfiguration as RpcHttpConfig; use rpc_apis::ApiSet; use seednodes::{zcash_seednodes, zcash_testnet_seednodes}; use std::net; -use storage; -use sync::VerificationParameters; use util::open_db; -use verification::VerificationLevel; +use zebra_keys::Address; +use zebra_message::Services; +use zebra_network::{ConsensusParams, Network}; +use zebra_p2p::InternetProtocol; +use zebra_primitives::hash::H256; +use zebra_storage; +use zebra_sync::VerificationParameters; +use zebra_verification::VerificationLevel; use {REGTEST_USER_AGENT, USER_AGENT}; pub struct Config { @@ -33,7 +33,7 @@ pub struct Config { pub rpc_config: RpcHttpConfig, pub block_notify_command: Option, pub verification_params: VerificationParameters, - pub db: storage::SharedStore, + pub db: zebra_storage::SharedStore, pub miner_address: Option
, } diff --git a/zebra/main.rs b/zebra/main.rs index d78f4b3c..2aad9854 100644 --- a/zebra/main.rs +++ b/zebra/main.rs @@ -6,20 +6,20 @@ extern crate app_dirs; extern crate env_logger; extern crate libc; -extern crate chain; -extern crate db; -extern crate import; -extern crate keys; -extern crate logs; -extern crate message; -extern crate network; -extern crate p2p; -extern crate primitives; -extern crate rpc as ethcore_rpc; -extern crate script; -extern crate storage; -extern crate sync; -extern crate verification; +extern crate zebra_chain; +extern crate zebra_db; +extern crate zebra_import; +extern crate zebra_keys; +extern crate zebra_logs; +extern crate zebra_message; +extern crate zebra_network; +extern crate zebra_p2p; +extern crate zebra_primitives; +extern crate zebra_rpc; +extern crate zebra_script; +extern crate zebra_storage; +extern crate zebra_sync; +extern crate zebra_verification; mod commands; mod config; @@ -58,9 +58,9 @@ fn run() -> Result<(), String> { if !cfg.quiet { if cfg!(windows) { - logs::init(LOG_INFO, logs::DateLogFormatter); + zebra_logs::init(LOG_INFO, zebra_logs::DateLogFormatter); } else { - logs::init(LOG_INFO, logs::DateAndColorLogFormatter); + zebra_logs::init(LOG_INFO, zebra_logs::DateAndColorLogFormatter); } } else { env_logger::init(); diff --git a/zebra/rpc.rs b/zebra/rpc.rs index ba85d859..9a687ca4 100644 --- a/zebra/rpc.rs +++ b/zebra/rpc.rs @@ -1,19 +1,19 @@ -use ethcore_rpc::{start_http, Compatibility, MetaIoHandler, Server}; -use keys::Address; -use network::ConsensusParams; -use p2p; use rpc_apis::{self, ApiSet}; use std::io; use std::net::SocketAddr; use std::sync::Arc; -use storage; -use sync; +use zebra_keys::Address; +use zebra_network::ConsensusParams; +use zebra_p2p; +use zebra_rpc::{start_http, Compatibility, MetaIoHandler, Server}; +use zebra_storage; +use zebra_sync; pub struct Dependencies { pub consensus: ConsensusParams, - pub local_sync_node: sync::LocalNodeRef, - pub storage: storage::SharedStore, - pub p2p_context: Arc, + pub local_sync_node: zebra_sync::LocalNodeRef, + pub storage: zebra_storage::SharedStore, + pub p2p_context: Arc, pub miner_address: Option
, } diff --git a/zebra/rpc_apis.rs b/zebra/rpc_apis.rs index c80f1504..40ed6bf5 100644 --- a/zebra/rpc_apis.rs +++ b/zebra/rpc_apis.rs @@ -1,7 +1,7 @@ -use ethcore_rpc::MetaIoHandler; use rpc::Dependencies; use std::collections::HashSet; use std::str::FromStr; +use zebra_rpc::MetaIoHandler; #[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)] pub enum Api { @@ -57,7 +57,7 @@ pub fn setup_rpc( apis: ApiSet, deps: Dependencies, ) -> MetaIoHandler<()> { - use ethcore_rpc::v1::*; + use zebra_rpc::v1::*; for api in apis.list_apis() { match api { diff --git a/zebra/util.rs b/zebra/util.rs index b820e74b..f9c4c8d8 100644 --- a/zebra/util.rs +++ b/zebra/util.rs @@ -1,18 +1,20 @@ use app_dirs::{app_dir, AppDataType}; use config::Config; -use db; use std::fs::create_dir_all; use std::path::PathBuf; use std::sync::Arc; -use {storage, APP_INFO}; +use zebra_db; +use zebra_storage; +use APP_INFO; -pub fn open_db(data_dir: &Option, db_cache: usize) -> storage::SharedStore { +pub fn open_db(data_dir: &Option, db_cache: usize) -> zebra_storage::SharedStore { let db_path = match *data_dir { Some(ref data_dir) => custom_path(&data_dir, "db"), None => app_dir(AppDataType::UserData, &APP_INFO, "db").expect("Failed to get app dir"), }; Arc::new( - db::BlockChainDatabase::open_at_path(db_path, db_cache).expect("Failed to open database"), + zebra_db::BlockChainDatabase::open_at_path(db_path, db_cache) + .expect("Failed to open database"), ) }