diff --git a/.rustfmt.toml b/.rustfmt.toml index 40eb028..e810e47 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,5 +1,5 @@ format_strings = true wrap_comments = true -format_doc_comments = true +format_code_in_doc_comments = true merge_imports = false max_width = 120 diff --git a/Cargo.lock b/Cargo.lock index 024404f..863d691 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,10 +23,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "arrayvec" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -34,13 +34,13 @@ name = "atty" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "autocfg" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -49,7 +49,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -81,13 +81,13 @@ dependencies = [ "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "strason 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitcoin" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitcoin-bech32 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -96,8 +96,8 @@ dependencies = [ "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_test 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_test 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -105,7 +105,7 @@ name = "bitcoin-amount" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -130,12 +130,12 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitflags" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -153,22 +153,22 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "md5 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "try_from 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bstr" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -195,8 +195,8 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "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)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -206,15 +206,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chrono" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -225,7 +225,7 @@ name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -233,19 +233,19 @@ name = "config" version = "0.9.3" 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)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde-hjson 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "constant_time_eq" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -257,16 +257,16 @@ dependencies = [ "bitcoin_hashes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "config 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mongodb 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "ocean-rpc 0.3.0 (git+https://github.com/commerceblock/rust-ocean-rpc)", "rust-ocean 0.6.0 (git+https://github.com/commerceblock/rust-ocean)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -283,10 +283,10 @@ name = "crossbeam-epoch" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -304,8 +304,8 @@ name = "crossbeam-utils" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "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)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -313,7 +313,7 @@ name = "crypto-mac" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -332,7 +332,7 @@ dependencies = [ [[package]] name = "either" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -341,9 +341,9 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -367,7 +367,7 @@ name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -378,7 +378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -386,7 +386,7 @@ name = "futures-cpupool" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -395,7 +395,7 @@ name = "generic-array" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -404,10 +404,10 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "bstr 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -418,9 +418,9 @@ dependencies = [ "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.28 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -446,13 +446,13 @@ name = "hostname" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "winutil 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "http" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -466,8 +466,8 @@ 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.18 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -478,7 +478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "humantime" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -504,17 +504,17 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.33" +version = "0.12.35" 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)", + "futures 0.1.29 (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.26 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.19 (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.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -524,9 +524,9 @@ dependencies = [ "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.8 (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-reactor 0.1.10 (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.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.16 (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)", ] @@ -543,16 +543,18 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.0.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "iovec" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -566,9 +568,9 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -576,11 +578,11 @@ name = "jsonrpc-core" version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -588,12 +590,12 @@ name = "jsonrpc-http-server" version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-server-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (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)", + "unicase 2.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -604,12 +606,12 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (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.22 (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)", + "unicase 2.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -633,12 +635,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.62" +version = "0.2.65" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -657,11 +659,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lock_api" -version = "0.1.5" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -677,7 +678,7 @@ name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -728,9 +729,9 @@ 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-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -743,8 +744,8 @@ name = "mio-uds" version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -764,11 +765,11 @@ name = "mongodb" version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bson 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -788,14 +789,14 @@ name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "nodrop" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -809,12 +810,13 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -822,7 +824,7 @@ name = "num-integer" version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -839,7 +841,7 @@ name = "num-traits" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -847,71 +849,66 @@ name = "num_cpus" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ocean-rpc" version = "0.3.0" -source = "git+https://github.com/commerceblock/rust-ocean-rpc#6bcbbca65bdf44d6567072f38310e8ac8f69e144" +source = "git+https://github.com/commerceblock/rust-ocean-rpc#a8ffb9e94751a608eeb8c5d8a4e082266658184f" dependencies = [ - "bitcoin 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitcoin 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitcoin-amount 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "bitcoin_hashes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "ocean-rpc-json 0.3.0 (git+https://github.com/commerceblock/rust-ocean-rpc)", "rust-ocean 0.6.0 (git+https://github.com/commerceblock/rust-ocean)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ocean-rpc-json" version = "0.3.0" -source = "git+https://github.com/commerceblock/rust-ocean-rpc#6bcbbca65bdf44d6567072f38310e8ac8f69e144" +source = "git+https://github.com/commerceblock/rust-ocean-rpc#a8ffb9e94751a608eeb8c5d8a4e082266658184f" dependencies = [ - "bitcoin 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitcoin 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitcoin-amount 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "bitcoin_hashes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (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 = "owning_ref" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parking_lot" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parking_lot_core" -version = "0.4.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (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.10 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -921,7 +918,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.3 (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)", + "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "crypto-mac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -936,7 +933,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" -version = "1.0.1" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -952,7 +949,7 @@ name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -960,7 +957,7 @@ name = "rand" version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -970,10 +967,10 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (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.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -983,9 +980,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (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)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -993,8 +990,8 @@ name = "rand" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (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.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1003,7 +1000,7 @@ dependencies = [ "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.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1011,7 +1008,7 @@ name = "rand_chacha" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1049,9 +1046,9 @@ name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1061,10 +1058,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (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.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1072,7 +1069,7 @@ name = "rand_pcg" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1111,12 +1108,12 @@ dependencies = [ [[package]] name = "regex" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1130,7 +1127,7 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1144,7 +1141,7 @@ version = "0.6.0" source = "git+https://github.com/commerceblock/rust-ocean#b3728b67611c52f1bd408e588cf396562ffb4c7a" dependencies = [ "bech32 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitcoin 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitcoin 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitcoin_hashes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1159,12 +1156,12 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "safemem" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1175,11 +1172,6 @@ dependencies = [ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "scopeguard" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "scopeguard" version = "1.0.0" @@ -1192,7 +1184,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1228,10 +1220,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1242,29 +1234,29 @@ dependencies = [ "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.0 (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.99 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1277,10 +1269,10 @@ dependencies = [ [[package]] name = "serde_test" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1315,17 +1307,12 @@ name = "smallvec" version = "0.6.10" source = "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 = "strason" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1338,10 +1325,10 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1361,10 +1348,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1372,7 +1359,7 @@ name = "thread_local" version = "0.3.6" 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)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1380,9 +1367,9 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1391,7 +1378,7 @@ version = "0.1.22" 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)", + "futures 0.1.29 (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.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)", @@ -1399,12 +1386,12 @@ dependencies = [ "tokio-executor 0.1.8 (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-reactor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.7 (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.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-udp 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1414,8 +1401,8 @@ 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)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1424,7 +1411,7 @@ 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.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1433,7 +1420,7 @@ name = "tokio-current-thread" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1443,7 +1430,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1451,9 +1438,9 @@ name = "tokio-fs" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (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.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1462,35 +1449,35 @@ 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.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-reactor" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.6.6 (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)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (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.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)", + "parking_lot 0.9.0 (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.8 (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)", + "tokio-sync 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-sync" -version = "0.1.6" +version = "0.1.7" 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.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1499,25 +1486,25 @@ 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.28 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (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)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-threadpool" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "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.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1528,23 +1515,23 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-udp" -version = "0.1.3" +version = "0.1.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.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (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)", "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-reactor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1553,15 +1540,15 @@ 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.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.62 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.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-reactor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1569,7 +1556,7 @@ name = "toml" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1594,7 +1581,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "typenum" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1612,7 +1599,7 @@ dependencies = [ [[package]] name = "unicase" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1664,7 +1651,7 @@ name = "want" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1676,7 +1663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.7" +version = "0.3.8" 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)", @@ -1698,7 +1685,7 @@ name = "winapi-util" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1711,7 +1698,7 @@ name = "wincolor" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1720,7 +1707,7 @@ name = "winutil" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1744,33 +1731,33 @@ dependencies = [ "checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" -"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba" +"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bech32 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad20b907fd16610c3960c7fe9dae13dd243343409bab80299774c9a8b5d7bed8" "checksum bech32 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58946044516aa9dc922182e0d6e9d124a31aafe6b421614654eb27cf90cec09c" "checksum bitcoin 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0105a5a9c83f4ac366ca45f99ba502805a097fdf426ade4af0a822853cdd0886" -"checksum bitcoin 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "381b74ae6480c4da21dccdf6fdf7400250710fc891af8d82376cb5c03e5f6f1d" +"checksum bitcoin 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5e7935f613ba170459072926f01dc5ddb8aa22382dc4badf44bbb55e2d243d" "checksum bitcoin-amount 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0bd5ae6712113fac4edfa917b1d865801f476b021a108e6749ce20d3057abb9e" "checksum bitcoin-bech32 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f0a5cfe5abcb5040b36d4ea8acba95288fefebd7959b59475f2c4ec705974b4c" "checksum bitcoin-bech32 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4e67e8ccfc663811145e6cabdb9a2a6978877f72b048516e83eb95622e9b2554" "checksum bitcoin_hashes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2b7a2e9773ee7ae7f2560f0426c938f57902dcb9e39321b0cbd608f47ed579a4" -"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum bson 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8984b7b33b1f8ac97468df3cefa76c7035abb0786473aa2a437dea0c72855702" -"checksum bstr 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94cdf78eb7e94c566c1f5dbe2abf8fc70a548fc902942a48c4b3a98b48ca9ade" +"checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "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.26 (registry+https://github.com/rust-lang/crates.io-index)" = "389803e36973d242e7fecb092b2de44a3d35ac62524b3b9339e51d577d668e02" -"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" -"checksum chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "77d81f58b7301084de3b958691458a53c3f7e0b1d702f77e550b6a88e3a88abe" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum config 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9107d78ed62b3fa5a86e7d18e647abed48cfd8f8fab6c72f4cdb982d196f7e6" -"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" +"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" "checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" @@ -1778,14 +1765,14 @@ dependencies = [ "checksum crypto-mac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7afa06d05a046c7a47c3a849907ec303504608c927f4e85f7bfff22b7180d971" "checksum data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f47ca1860a761136924ddd2422ba77b2ea54fe8cc75b9040804a0d9d32ad97" "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" -"checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" "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 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.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" +"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" @@ -1793,15 +1780,15 @@ dependencies = [ "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "733e1b3ac906631ca01ebb577e9bb0f5e37a454032b9036b5eaea4013ed6f99a" "checksum hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e" -"checksum http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "372bcb56f939e449117fb0869c2e8fd8753a8223d92a172c6e808cf123a5b6e4" +"checksum http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "d7e06e336150b178206af098a055e3621e8336027e2b4d126bda0bc64824baaf" "checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" -"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" +"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" "checksum hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -"checksum hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)" = "7cb44cbce9d8ee4fb36e4c0ad7b794ac44ebaad924b9c8291a63215bb44c2c8f" +"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -"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 indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" +"checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jsonrpc 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "436f3455a8a4e9c7b14de9f1206198ee5d0bdc2db1b560339d2141093d7dd389" "checksum jsonrpc-core 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97b83fdc5e0218128d0d270f2f2e7a5ea716f3240c8518a58bc89e6716ba8581" @@ -1810,11 +1797,11 @@ dependencies = [ "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" -"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" -"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" "checksum linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" +"checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" @@ -1828,21 +1815,20 @@ dependencies = [ "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum mongodb 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "d558c8c1ee6140954f82b53558135bb9ecb7b258e10dbd7206d985d134d388e0" "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 nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -"checksum num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "57450397855d951f1a41305e54851b1a7b8f5d2e349543a02a2effe25459f718" +"checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" "checksum ocean-rpc 0.3.0 (git+https://github.com/commerceblock/rust-ocean-rpc)" = "" "checksum ocean-rpc-json 0.3.0 (git+https://github.com/commerceblock/rust-ocean-rpc)" = "" -"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" -"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" -"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" +"checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +"checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" "checksum pbkdf2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0c09cddfbfc98de7f76931acf44460972edb4023eb14d0c6d4018800e552d8e0" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c5c2380ae88876faae57698be9e9775e3544decad214599c3a6266cca6ac802" +"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" @@ -1861,16 +1847,15 @@ dependencies = [ "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88c3d9193984285d544df4a30c23a4e62ead42edf70a4452ceb76dac1ce05c26" +"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" -"checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" +"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" "checksum rust-ocean 0.6.0 (git+https://github.com/commerceblock/rust-ocean)" = "" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" -"checksum safemem 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b08423011dae9a5ca23f07cf57dac3857f5c885d352b76f6d95f4aea9434d0" +"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" "checksum scan_fmt 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8b87497427f9fbe539ee6b9626f5a5e899331fdf1c1d62f14c637a462969db30" -"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfaccd3a23619349e0878d9a241f34b1982343cdf67367058cd7d078d326b63e" "checksum semver 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bee2bc909ab2d8d60dab26e8cad85b25d795b14603a0dcb627b78b9d30b6454b" @@ -1878,20 +1863,19 @@ dependencies = [ "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum separator 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7acc4d818f952ed02e7911df5da8098c8b00a3c5ba2832e035a750b56e8fc32b" "checksum serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" -"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" +"checksum serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "9796c9b7ba2ffe7a9ce53c2287dfc48080f4b2b362fcc245a259b3a7201119dd" "checksum serde-hjson 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0b833c5ad67d52ced5f5938b2980f32a9c1c5ef047f0b4fb3127e7a423c76153" -"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425" -"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" +"checksum serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "4b133a43a1ecd55d4086bd5b4dc6c1751c68b1bfbeba7a5040442022c7e7c02e" +"checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2" "checksum serde_test 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" -"checksum serde_test 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "f2d8999326d1f713002c52199b3f30c052dc8998d9359d5ae950328e527da1cd" +"checksum serde_test 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "4aaf891d32257c9f65259b841af6e0b35d2ee22e41f1becbead01f0217f3e000" "checksum sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9d1f3b5de8a167ab06834a7c883bd197f2191e1dda1a22d9ccfeedbf9aded" "checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "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 strason 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dcd1098ae32c583b8d538072380c340a01e46fbca379d6248ff77721373e2cef" "checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -"checksum syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "158521e6f544e7e3dcfc370ac180794aa38cb34a1b1e07609376d4adcf429b93" +"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textnonce 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dafb35214e317d6c0a72b16d1aa667bbc0fea57e302798e7bc520e0f39988006" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" @@ -1903,22 +1887,22 @@ dependencies = [ "checksum tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f27ee0e6db01c5f0b2973824547ce7e637b2ed79b891a9677b0de9bd532b6ac" "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-reactor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c56391be9805bc80163151c0b9e5164ee64f4b0200962c346fea12773158f22d" +"checksum tokio-sync 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76" "checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" -"checksum tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "90ca01319dea1e376a001e8dc192d42ebde6dd532532a5bad988ac37db365b19" +"checksum tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd2c6a3885302581f4401c82af70d792bb9df1700e7437b0aeb4ada94d5388c" "checksum tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f2106812d500ed25a4f38235b9cae8f78a09edf43203e16e59c3b769a342a60e" -"checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" +"checksum tokio-udp 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum try_from 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "923a7ee3e97dbfe8685261beb4511cc9620a1252405d02693d43169729570111" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" +"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6" +"checksum unicase 2.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2e2e6bd1e59e56598518beb94fd6db628ded570326f0a98c679a304bd9f00150" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" @@ -1927,7 +1911,7 @@ dependencies = [ "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "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.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "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/config/default.toml b/config/default.toml index 0ab1349..719d1b1 100644 --- a/config/default.toml +++ b/config/default.toml @@ -27,7 +27,6 @@ pass = "password1" host = "127.0.0.1:5555" user = "user1" pass = "password1" -asset_hash = "93fed59e9407ddc47993fc176a245383eb2a5c06c265ce0e02ff2b59da44f439" genesis_hash = "ff8950160a77988cdc485913568d06c2d69a8c952ef0f179b4b097e3de63d7cc" asset = "CHALLENGE" asset_key = "cScSHCQp9AEwzZoucRpX9bMRkLCJ4LoQWBNFTZuD6tPX9qwNMWfQ" diff --git a/docker-compose.yml b/docker-compose.yml index 0f8c919..8a0886c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,7 +44,6 @@ services: CO_CLIENTCHAIN_HOST: client_chain:5555 CO_CLIENTCHAIN_USER: user1 CO_CLIENTCHAIN_PASS: password1 - CO_CLIENTCHAIN_ASSET_HASH: fae9f771019d45e31b8f78da99a15b094b17b2ba76b0940c3ac53d5e9afd8e8e CO_CLIENTCHAIN_GENESIS_HASH: d1fbd07bd9a7a80a85445b8e28246f0b644c01ac7412e81ce3ffc0815386ad77 CO_CLIENTCHAIN_ASSET_KEY: cScSHCQp9AEwzZoucRpX9bMRkLCJ4LoQWBNFTZuD6tPX9qwNMWfQ @@ -59,4 +58,4 @@ networks: driver: bridge ipam: config: - - subnet: 192.168.12.0/24 \ No newline at end of file + - subnet: 192.168.12.0/24 diff --git a/examples/demo.rs b/examples/demo.rs index 7d233ac..e941f2b 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -22,6 +22,7 @@ use hyper::{ use ocean_rpc::RpcApi; use secp256k1::{Message, Secp256k1, SecretKey}; +use coordinator::clientchain::get_first_unspent; use coordinator::coordinator as coordinator_main; use coordinator::ocean::OceanClient; @@ -50,32 +51,35 @@ fn main() { // auto client chain block generation let client_rpc_clone = client_rpc.clone(); thread::spawn(move || loop { - thread::sleep(time::Duration::from_secs(10)); + thread::sleep(time::Duration::from_secs(5)); if let Err(e) = client_rpc_clone.clone().client.generate(1) { error!("{}", e); } }); let genesis_hash = sha256d::Hash::from_hex(&config.clientchain.genesis_hash).unwrap(); - let request_txid = &client_rpc.get_requests(Some(&genesis_hash)).unwrap()[0].txid; + let request = &client_rpc.get_requests(Some(&genesis_hash)); + if request.as_ref().unwrap().is_empty() { + panic!("No active request in client blockchain!") + } + let request_txid = request.as_ref().unwrap()[0].txid; let guardnode_pubkey = "026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"; let mut guardnode_txid = genesis_hash; // dummy init - for bid in client_rpc.get_request_bids(request_txid).unwrap().unwrap().bids { + for bid in client_rpc.get_request_bids(&request_txid).unwrap().unwrap().bids { if bid.fee_pub_key.to_string() == guardnode_pubkey { guardnode_txid = bid.txid; + println!("guardnode bid txid: {}", guardnode_txid); break; } } // add two guardnodes with valid keys and one without // keys based on mockservice request bids - let asset_hash = config.clientchain.asset_hash.clone(); let listener_host = config.listener_host.clone(); let client_rpc_clone = client_rpc.clone(); thread::spawn(move || { guardnode( &client_rpc_clone, - sha256d::Hash::from_hex(&asset_hash).unwrap(), listener_host.clone(), guardnode_txid, SecretKey::from_slice(&[0xaa; 32]).unwrap(), @@ -92,7 +96,6 @@ fn main() { /// Bid info (key/txid) are based on MockService data for demo purpose fn guardnode( client_rpc: &OceanClient, - asset_hash: sha256d::Hash, listener_host: String, guard_txid: sha256d::Hash, guard_key: SecretKey, @@ -100,6 +103,13 @@ fn guardnode( ) { let secp = Secp256k1::new(); let mut prev_block_count = 0; + // Get asset hash from unspent list + let asset_hash; + match get_first_unspent(&client_rpc, &String::from("CHALLENGE")) { + Err(_) => panic!("No challenge asset issued in client blockchain!"), + Ok(res) => asset_hash = res.asset, + } + loop { if let Ok(block_count) = client_rpc.get_block_count() { if block_count > prev_block_count { diff --git a/scripts/authproxy.py b/scripts/authproxy.py old mode 100644 new mode 100755 diff --git a/scripts/create_request.sh b/scripts/create_request.sh new file mode 100755 index 0000000..72000b5 --- /dev/null +++ b/scripts/create_request.sh @@ -0,0 +1,155 @@ +#!/bin/bash +shopt -s expand_aliases +alias ocl="$HOME/jsonrpc-cli/jsonrpc-cli --user=$RPC_USER --pass=$RPC_PASS --format=jsonpretty --resultonly=on --highlight=off http://$RPC_CONNECT:$RPC_PORT/" +# parameters: +# $1 Genesis hash +# $2 start price +# $3 end price +# $4 auction duration +# $5 request duration +# $6 number of tickets +# $7 fee percentage +# $8 Permission asset private key +# OPTIONAL +# $9 prevtxid +# $10 prevvout + +# Check parameters are set +if [ -z $1 ] || [ -z $2 ] || [ -z $3 ] || [ -z $4 ] || [ -z $5 ] || [ -z $6 ] || [ -z $7 ] +then + printf "%s\n" "createRequest genesisHash startPrice endPrice auctionDuration requestDuration numTickets feePercentage privKey ( txid ) ( vout )" \ \ + "Script builds, signs and sends a request transaction to service chain." \ + "Set shell enviroment variables RPC_CONNECT, RPC_PORT, RPC_USER, RPC_PASS with network connection information." \ + "By deflault a TX_LOCKED_MULTISIG transaction or standard permission asset unspent output is spent to fund the request. If a specific permission asset transaction should be used then set parameters 9 and 10 accordingly." \ + \ \ + "Arguments:" \ + "1. \"Genesis hash\" (Hex string, Required) Hash of client chain genesis block" \ + "2. \"StartPrice\" (Amount, Required) Starting auction price of tickets" \ + "3. \"endPrice\" (Amount, Required) Ending auction price of tickets" \ + "4. \"auctionDuration\" (Integer, Required) Number of blocks auction to last for" \ + "5. \"requestDuration\" (Integer, Required) Number of blocks service period to last for" \ + "6. \"numTickets\" (Integer, Required) Number of tickets to be sold" \ + "7. \"feePercentage\" (Integer, Required) Percentage of fee to go towards rewarding guardnodes" \ + "8. \"privKey\" (String (hex), Optional) Hex encoded private key of address with permission asset" \ + "9. \"txid\" (String (hex), Optional) Specified previous request transaction ID to fund new request" \ + "10. \"vout\" (Integer, Optional) Specified previous request vout to fund new request" + \ \ + "Result: " \ + "\"txid\" (hex string) Transaction ID of request transaction" + exit +fi + +# check start price > end price +if [ $2 -lt $3 ]; then + printf "Input parameter error: Start price must be larger than end price." + exit +fi +# Client chain genesis block hash +genesis=$1 +# check for currently active request for given genesis hash +if [[ `ocl getrequests | jq "if .[].genesisBlock == \"$genesis\" then 1 else 0 end"` == *"1"* ]]; then + printf "Input parameter error: Genesis hash already in active request list. Relevant request info below.\n\n" + echo "Current block height: " `ocl getblockcount` + ocl getrequests $1 | jq '.[]' + exit +fi + +# Request start height = current height + auction duration +currentblockheight=`ocl getblockchaininfo | jq ".blocks"` +let start=$currentblockheight+$5 +# Request end height = request start height + request duration +let end=start+$4 + +# Starting price +price=$2 +# Decay constant formula +decay=$(echo "$4^3/((1+$4)*(($2/$3)-1))" | bc) +# Number of tickets +tickets=$6 +# Fee percentage paid +fee=$7 + +unspent=`ocl listunspent '[1, 9999999, [], true, "PERMISSION"]' | jq -c '.[]'` +# Import private key. Check if list unspent is empty first to avoid unnessesary re-scanning every time script runs +if [ ! -z $8 ] && [[ -z $unspent ]]; then + echo "Importing private key..." + ocl importprivkey $8 > /dev/null + unspent=`ocl listunspent '[1, 9999999, [], true, "PERMISSION"]' | jq -c '.[]'` +fi + +checkLockTime () { + if [[ $currentblockheight -gt `echo $1 | jq -r '.locktime'` ]]; then + return 0 + fi + return 1 +} +# Check for specified previous request transaction info and set txid, vout variables accordingly +if [ -n "$9" ] || [ -n "${10}" ]; then + if [ -z $9 ] || [ -z ${10} ]; then + printf "Input parameter error: txid and vout must be provided for previous request transaction.\n" + exit + fi + txid=$9 + vout=$10 + tx=`ocl decoderawtransaction $(ocl getrawtransaction $txid)` + if checkLockTime "$tx"; then + value=`echo $tx | jq -r '.vout[0].value'` + else + printf "Input parameter error: Previous request transaction nlocktime not met.\n" + exit + fi +else + # Get previously locked TX_LOCKED_MULTISIG unspent output + for i in $unspent; + do + if [ `echo $i | jq ".solvable"` = "false" ]; then + txid=`echo $i | jq -r ".txid"` + tx=`ocl decoderawtransaction $(ocl getrawtransaction $txid | jq -r '.')` + if checkLockTime "$tx"; then + value=`echo $tx | jq -r '.vout[0].value'` # TX_LOCKED_MULTISIG permission + vout=0 # asset always vout=0 + break + fi + fi + done + # If value not set yet then get standard permission asset unspent output + if [ -z $value ]; then + for i in $unspent; + do + txid=`echo $i | jq -r ".txid"` + tx=`ocl decoderawtransaction $(ocl getrawtransaction $txid | jq -r '.')` + if checkLockTime "$tx"; + then + value=`echo $i | jq -r ".amount"` + vout=`echo $i | jq ".vout"` + break + fi + done + fi + if [[ ${#unspent[0]} = 4 || -z $txid ]]; then # unspent or txid is null + printf "Error: No unspent TX_LOCKED_MULTISIG or permission asset transaction outputs available in wallet.\n" + exit + fi +fi +# Address permission tokens will be locked in +pub=`ocl validateaddress $(ocl getnewaddress | jq -r '.') | jq -r ".pubkey"` + +# Generate and sign request transaction +inputs="{\"txid\":\"$txid\",\"vout\":$vout}" +outputs="{\"decayConst\":$decay,\"endBlockHeight\":$end,\"fee\":$fee,\"genesisBlockHash\":\"$genesis\",\ +\"startBlockHeight\":$start,\"tickets\":$tickets,\"startPrice\":$price,\"value\":$value,\"pubkey\":\"$pub\"}" + +rawtx=`ocl createrawrequesttx '['$(echo $inputs)','$(echo $outputs)']' | jq -r '.'` +signedrawtx=`ocl signrawtransaction $rawtx` + +# Catch signing error +if [ `echo $signedrawtx | jq ".complete"` = "false" ]; then + echo "Signing error: Script cannot be signed. Is the input transaction information correct and is it unlockable now?" +fi + +txid=`ocl sendrawtransaction $(echo $signedrawtx | jq -r ".hex") | jq -r '.'` +echo "Request txid: $txid" + +# Import spending address to allow script to automatically update request +address=`ocl decoderawtransaction $(echo $signedrawtx | jq -r '.hex') | jq -r '.vout[0].scriptPubKey.hex'` +ocl importaddress $address > /dev/null diff --git a/scripts/demo.sh b/scripts/demo.sh index 6e91f5d..525b3e7 100755 --- a/scripts/demo.sh +++ b/scripts/demo.sh @@ -25,21 +25,12 @@ printf '%s\n' '#!/bin/sh' 'rpcuser=user1' \ 'challengecoinsdestination=76a914be70510653867b1c648b43cfb3b0edf8420f08d788ac' > ~/co-client-dir/ocean.conf ocd -sleep 5 +sleep 8 echo "Importing challenger key" ocl importprivkey cScSHCQp9AEwzZoucRpX9bMRkLCJ4LoQWBNFTZuD6tPX9qwNMWfQ sleep 2 -# Issue asset for bid creation -echo "Issue asset for guardnodes" -asset=`ocl issueasset 500 0` -asset_hash=`echo $asset | jq -r ".asset"` - -echo "Issue another asset for guardnodes" -asset=`ocl issueasset 100 0` -asset_hash2=`echo $asset | jq -r ".asset"` - # Create request echo "Create request" pub=`ocl validateaddress $(ocl getnewaddress) | jq -r ".pubkey"` @@ -52,22 +43,35 @@ outputs="{\"decayConst\":1000,\"endBlockHeight\":10,\"fee\":3,\"genesisBlockHash \"startBlockHeight\":5,\"tickets\":2,\"startPrice\":50,\"value\":$value,\"pubkey\":\"$pub\"}" signedtx=`ocl signrawtransaction $(ocl createrawrequesttx $inputs $outputs)` -txid=`ocl sendrawtransaction $(echo $signedtx | jq -r ".hex")` +request_txid=`ocl sendrawtransaction $(echo $signedtx | jq -r ".hex")` ocl generate 1 ocl getrequests # Create bid echo "Create request bid" + +# Create tx for bid to spend from +bid_txid=$(ocl sendtoaddress `ocl getnewaddress` 100 "" "" false "CBT") +ocl generate 1 + addr=`ocl getnewaddress` pub=`ocl validateaddress $addr | jq -r ".pubkey"` -unspent=`ocl listunspent 1 9999999 [] true $asset_hash | jq .[0]` -value=`echo $unspent | jq -r ".amount"` - -inputs="[{\"txid\":$(echo $unspent | jq ".txid"),\"vout\":$(echo $unspent | jq -r ".vout"),\"asset\":\"$asset_hash\"}]" -outputs="{\"endBlockHeight\":10,\"requestTxid\":\"$txid\",\"pubkey\":\"$pub\",\ +bid_tx=$(ocl decoderawtransaction `ocl getrawtransaction $bid_txid`) +value=$(echo $bid_tx | jq '.vout[0].value') +if [ $value = 100 ] # Find correct vout +then + vout=$(echo $bid_tx | jq '.vout[0].n') +else + vout=$(echo $bid_tx | jq '.vout[1].n') +fi +domain_asset=$(echo $bid_tx | jq '.vout['$vout'].asset') + + +inputs="[{\"txid\":\"$bid_txid\",\"vout\":$vout,\"asset\":$domain_asset}]" +outputs="{\"endBlockHeight\":10,\"requestTxid\":\"$request_txid\",\"pubkey\":\"$pub\",\ \"feePubkey\":\"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3\",\ -\"value\":50,\"change\":449.999,\"changeAddress\":\"$addr\",\"fee\":0.001}" +\"value\":55,\"change\":\"44.999\",\"changeAddress\":\"$addr\",\"fee\":0.001}" signedtx=`ocl signrawtransaction $(ocl createrawbidtx $inputs $outputs)` txid=`ocl sendrawtransaction $(echo $signedtx | jq -r ".hex")` @@ -78,19 +82,32 @@ ocl importprivkey cPjJhtAgmbkovqCd1BgnY2nxGftX2tqen6UzaMxvFeH8xT3PWUod sleep 2 echo "Create another request bid" +# Create tx for bid to spend from +bid_txid2=$(ocl sendtoaddress `ocl getnewaddress` 100 "" "" false "CBT") +ocl generate 1 + addr=`ocl getnewaddress` pub=`ocl validateaddress $addr | jq -r ".pubkey"` -unspent=`ocl listunspent 1 9999999 [] true $asset_hash2 | jq .[0]` -value=`echo $unspent | jq -r ".amount"` - -inputs="[{\"txid\":$(echo $unspent | jq ".txid"),\"vout\":$(echo $unspent | jq -r ".vout"),\"asset\":\"$asset_hash2\"}]" -outputs="{\"endBlockHeight\":10,\"requestTxid\":\"$txid\",\"pubkey\":\"$pub\",\ -\"feePubkey\":\"029aaa76fcf7b8012041c6b4375ad476408344d842000087aa93c5a33f65d50d92\",\ -\"value\":50,\"change\":49.999,\"changeAddress\":\"$addr\",\"fee\":0.001}" +bid_tx=$(ocl decoderawtransaction `ocl getrawtransaction $bid_txid2`) +value=$(echo $bid_tx | jq '.vout[0].value') +if [ $value = 100 ] +then + vout=$(echo $bid_tx | jq '.vout[0].n') +else + vout=$(echo $bid_tx | jq '.vout[1].n') +fi +domain_asset=$(echo $bid_tx | jq '.vout['$vout'].asset') + +inputs="[{\"txid\":\"$bid_txid2\",\"vout\":$vout,\"asset\":$domain_asset}]" +outputs="{\"endBlockHeight\":10,\"requestTxid\":\"$request_txid\",\"pubkey\":\"$pub\",\ +\"feePubkey\":\"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3\",\ +\"value\":55,\"change\":\"44.999\",\"changeAddress\":\"$addr\",\"fee\":0.001}" signedtx=`ocl signrawtransaction $(ocl createrawbidtx $inputs $outputs)` txid=`ocl sendrawtransaction $(echo $signedtx | jq -r ".hex")` +echo "mempool" +ocl getrawmempool ocl generate 1 ocl getrequestbids $(ocl getrequests | jq -r ".[].txid") echo "Guardnode txid: $txid" diff --git a/scripts/query.js b/scripts/query.js old mode 100644 new mode 100755 diff --git a/src/api.rs b/src/api.rs index ec4a918..1b7581e 100644 --- a/src/api.rs +++ b/src/api.rs @@ -31,7 +31,7 @@ struct GetRequestResponse { } /// Get request RPC call returning corresponding request if it exists -fn get_request(params: Params, storage: Arc) -> futures::Finished { +fn get_request(params: Params, storage: Arc) -> futures::Finished { let try_parse = params.parse::(); match try_parse { Ok(parse) => { @@ -58,7 +58,7 @@ struct GetRequestsResponse { } /// Get requests RPC call returning all stored requests -fn get_requests(storage: Arc) -> futures::Finished { +fn get_requests(storage: Arc) -> futures::Finished { let requests = storage.get_requests().unwrap(); let mut response = GetRequestsResponse { requests: vec![] }; for request in requests { @@ -80,7 +80,7 @@ struct GetRequestResponsesResponse { /// Get requests responses RPC call returning all responses for a specific /// request transaction id hash -fn get_request_responses(params: Params, storage: Arc) -> futures::Finished { +fn get_request_responses(params: Params, storage: Arc) -> futures::Finished { let try_parse = params.parse::(); match try_parse { Ok(parse) => { @@ -159,42 +159,9 @@ pub fn run_api_server( mod tests { use super::*; - use std::str::FromStr; - - use bitcoin_hashes::{hex::FromHex, Hash}; use futures::Future; - use secp256k1::PublicKey; - - use crate::challenger::ChallengeState; - use crate::request::Bid; - use crate::storage::MockStorage; - - /// Generate dummy hash for tests - fn gen_dummy_hash(i: u8) -> sha256d::Hash { - sha256d::Hash::from_slice(&[i as u8; 32]).unwrap() - } - /// Geberate dummy challenge state - fn gen_challenge_state(request_hash: &sha256d::Hash) -> ChallengeState { - let request = ServiceRequest { - txid: *request_hash, - start_blockheight: 2, - end_blockheight: 5, - genesis_blockhash: gen_dummy_hash(0), - fee_percentage: 5, - num_tickets: 10, - }; - let mut bids = BidSet::new(); - let _ = bids.insert(Bid { - txid: sha256d::Hash::from_hex("1234567890000000000000000000000000000000000000000000000000000000").unwrap(), - pubkey: PublicKey::from_str("026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3").unwrap(), - }); - ChallengeState { - request, - bids, - latest_challenge: Some(gen_dummy_hash(0)), - } - } + use crate::util::testing::{gen_challenge_state, gen_dummy_hash, MockStorage}; #[test] fn get_request_test() { @@ -217,8 +184,10 @@ mod tests { let params: Params = serde_json::from_str(&s).unwrap(); let resp = get_request(params, storage.clone()); assert_eq!( - format!(r#"{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}}"#, - dummy_hash.to_string()), + format!( + r#"{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}}"#, + dummy_hash.to_string() + ), resp.wait().unwrap() ); } @@ -237,8 +206,10 @@ mod tests { storage.save_challenge_state(&state).unwrap(); let resp = get_requests(storage.clone()); assert_eq!( - format!(r#"{{"requests":[{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}}]}}"#, - dummy_hash.to_string()), + format!( + r#"{{"requests":[{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}}]}}"#, + dummy_hash.to_string() + ), resp.wait().unwrap() ); @@ -247,9 +218,11 @@ mod tests { storage.save_challenge_state(&state2).unwrap(); let resp = get_requests(storage.clone()); assert_eq!( - format!(r#"{{"requests":[{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}},{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}}]}}"#, + format!( + r#"{{"requests":[{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}},{{"request":{{"txid":"{}","start_blockheight":2,"end_blockheight":5,"genesis_blockhash":"0000000000000000000000000000000000000000000000000000000000000000","fee_percentage":5,"num_tickets":10}},"bids":[{{"txid":"1234567890000000000000000000000000000000000000000000000000000000","pubkey":"026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3"}}]}}]}}"#, dummy_hash.to_string(), - dummy_hash2.to_string()), + dummy_hash2.to_string() + ), resp.wait().unwrap() ); } diff --git a/src/challenger.rs b/src/challenger.rs index 22784c7..5deab01 100644 --- a/src/challenger.rs +++ b/src/challenger.rs @@ -93,6 +93,7 @@ pub fn run_challenge_request( verify_duration: time::Duration, challenge_duration: time::Duration, challenge_frequency: u64, + refresh_delay: time::Duration, ) -> Result<()> { let request = challenge_state.lock().unwrap().request.clone(); // clone as const and drop mutex info! {"Running challenge request: {:?}", request}; @@ -103,8 +104,8 @@ pub fn run_challenge_request( if (request.end_blockheight as u64) < challenge_height { break; } else if (challenge_height - prev_challenge_height) < challenge_frequency { - info! {"Sleeping for 10 sec..."} - thread::sleep(time::Duration::from_secs(10)); + info! {"Sleeping for {} sec...",time::Duration::as_secs(&refresh_delay)} + thread::sleep(refresh_delay); continue; } @@ -207,17 +208,8 @@ mod tests { use std::sync::mpsc::{channel, Receiver, Sender}; - use bitcoin_hashes::Hash; - - use crate::clientchain::MockClientChain; use crate::error::Error; - use crate::service::MockService; - use crate::storage::MockStorage; - - /// Generate dummy hash for tests - fn gen_dummy_hash(i: u8) -> sha256d::Hash { - sha256d::Hash::from_slice(&[i as u8; 32]).unwrap() - } + use crate::util::testing::{gen_dummy_hash, MockClientChain, MockService, MockStorage}; #[test] fn verify_challenge_test() { @@ -396,6 +388,7 @@ mod tests { time::Duration::from_millis(10), time::Duration::from_millis(10), 3, + time::Duration::from_millis(10), ); match res { Ok(_) => { @@ -428,6 +421,7 @@ mod tests { time::Duration::from_millis(10), time::Duration::from_millis(10), 1, + time::Duration::from_millis(10), ); match res { Ok(_) => { @@ -464,6 +458,7 @@ mod tests { time::Duration::from_millis(10), time::Duration::from_millis(10), 1, + time::Duration::from_millis(10), ) .is_err()); clientchain.return_err = false; @@ -482,6 +477,7 @@ mod tests { time::Duration::from_millis(10), time::Duration::from_millis(10), 1, + time::Duration::from_millis(10), ) .is_err()); service.return_err = false; @@ -501,6 +497,7 @@ mod tests { time::Duration::from_millis(10), time::Duration::from_millis(10), 1, + time::Duration::from_millis(10), ) .is_err()); @@ -522,6 +519,7 @@ mod tests { time::Duration::from_millis(10), time::Duration::from_millis(10), 1, + time::Duration::from_millis(10), ); match res { Ok(_) => { @@ -547,6 +545,7 @@ mod tests { time::Duration::from_millis(10), time::Duration::from_millis(10), 1, + time::Duration::from_millis(10), ); match res { Ok(_) => { diff --git a/src/clientchain.rs b/src/clientchain.rs index 9e14635..912ae5a 100644 --- a/src/clientchain.rs +++ b/src/clientchain.rs @@ -2,29 +2,28 @@ //! //! Client chain interface and implementations -use std::cell::RefCell; use std::collections::HashMap; -use bitcoin_hashes::{hex::FromHex, sha256d, Hash}; +use bitcoin_hashes::{hex::FromHex, sha256d}; use ocean_rpc::{json, RpcApi}; use crate::config::ClientChainConfig; use crate::error::{CError, Error, Result}; use crate::ocean::OceanClient; -/// Method that returns the first unspent for a specified asset label +/// Method that returns the first unspent output for given asset /// or an error if the client wallet does not have any unspent/funds -fn get_first_unspent(client: &OceanClient, asset: &str, asset_hash: &sha256d::Hash) -> Result { - // Check challenge asset hash is in the wallet - let unspent = client.list_unspent(None, None, None, None, None)?; - for tx in unspent.iter() { - if tx.assetlabel == Some(asset.into()) && tx.asset == *asset_hash { - return Ok(tx.clone()); - } +pub fn get_first_unspent(client: &OceanClient, asset: &str) -> Result { + // Check asset is held by the wallet and return unspent tx + let unspent = client.list_unspent(None, None, None, None, Some(asset))?; + if unspent.is_empty() { + // TODO: custom error for clientchain + return Err(Error::from(CError::MissingUnspent( + String::from(asset), + String::from("Client"), + ))); } - - // TODO: custom error for clientchain - Err(Error::from(CError::MissingUnspent)) + Ok(unspent[0].clone()) } /// ClientChain trait defining desired functionality for interfacing @@ -42,8 +41,6 @@ pub struct RpcClientChain<'a> { client: OceanClient, /// Challenge asset id asset: &'a str, - /// Challenge asset hash - asset_hash: sha256d::Hash, } impl<'a> RpcClientChain<'a> { @@ -54,15 +51,14 @@ impl<'a> RpcClientChain<'a> { Some(clientchain_config.user.clone()), Some(clientchain_config.pass.clone()), )?; - - let asset_hash = sha256d::Hash::from_hex(&clientchain_config.asset_hash)?; - // check we have funds for challenge asset - match get_first_unspent(&client, &clientchain_config.asset, &asset_hash) { + match get_first_unspent(&client, &clientchain_config.asset) { // If this fails attempt to import the private key and then fetch the unspent again Err(_) => { client.import_priv_key(&clientchain_config.asset_key, None, None)?; - let _ = get_first_unspent(&client, &clientchain_config.asset, &asset_hash)?; + if let Err(e) = get_first_unspent(&client, &clientchain_config.asset) { + return Err(e); + } } _ => (), } @@ -70,7 +66,6 @@ impl<'a> RpcClientChain<'a> { Ok(RpcClientChain { client, asset: &clientchain_config.asset, - asset_hash, }) } } @@ -79,7 +74,7 @@ impl<'a> ClientChain for RpcClientChain<'a> { /// Send challenge transaction to client chain fn send_challenge(&self) -> Result { // get any unspent for the challenge asset - let unspent = get_first_unspent(&self.client, self.asset, &self.asset_hash)?; + let unspent = get_first_unspent(&self.client, self.asset)?; // construct the challenge transaction excluding fees // which are not required for policy transactions @@ -130,48 +125,3 @@ impl<'a> ClientChain for RpcClientChain<'a> { Ok(false) } } - -/// Mock implementation of ClientChain using some mock logic for testing -pub struct MockClientChain { - /// Flag that when set returns error on all inherited methods that return - /// Result - pub return_err: bool, - /// Flag that when set returns false on all inherited methods that return - /// bool - pub return_false: bool, - /// Mock client chain blockheight - pub height: RefCell, -} - -impl MockClientChain { - /// Create a MockClientChain with all flags turned off by default - pub fn new() -> Self { - MockClientChain { - return_err: false, - return_false: false, - height: RefCell::new(0), - } - } -} - -impl ClientChain for MockClientChain { - /// Send challenge transaction to client chain - fn send_challenge(&self) -> Result { - if self.return_err { - return Err(Error::from(CError::Generic("send_challenge failed".to_owned()))); - } - // Use height to generate mock challenge hash - Ok(sha256d::Hash::from_slice(&[(*self.height.borrow() % 16) as u8; 32])?) - } - - /// Verify challenge transaction has been included in the chain - fn verify_challenge(&self, _txid: &sha256d::Hash) -> Result { - if self.return_err { - return Err(Error::from(CError::Generic("verify_challenge failed".to_owned()))); - } - if self.return_false { - return Ok(false); - } - Ok(true) - } -} diff --git a/src/config.rs b/src/config.rs index 541c5ea..f4312a8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,10 +3,12 @@ //! Config module handling config options from file/env use config_rs::{Config as ConfigRs, Environment, File}; +use error::InputErrorType::{GenHash, PrivKey}; use serde::{Deserialize, Serialize}; use std::env; +use util::checks::{check_hash_string, check_privkey_string}; -use crate::error::Result; +use crate::error::{CError, Error, Result}; #[derive(Debug, Serialize, Deserialize)] /// Api specific config @@ -59,8 +61,6 @@ pub struct ClientChainConfig { pub user: String, /// Client rpc pass pub pass: String, - /// Client asset hash - pub asset_hash: String, /// Client genesis hash pub genesis_hash: String, /// Client asset label @@ -75,7 +75,6 @@ impl Default for ClientChainConfig { host: String::new(), user: String::new(), pass: String::new(), - asset_hash: String::new(), genesis_hash: String::new(), asset: String::from("CHALLENGE"), asset_key: String::new(), @@ -208,9 +207,6 @@ impl Config { if let Ok(v) = env::var("CO_CLIENTCHAIN_ASSET_KEY") { let _ = conf_rs.set("clientchain.asset_key", v)?; } - if let Ok(v) = env::var("CO_CLIENTCHAIN_ASSET_HASH") { - let _ = conf_rs.set("clientchain.asset_hash", v)?; - } if let Ok(v) = env::var("CO_CLIENTCHAIN_GENESIS_HASH") { let _ = conf_rs.set("clientchain.genesis_hash", v)?; } @@ -228,6 +224,19 @@ impl Config { let _ = conf_rs.set("storage.name", v)?; } + // Perform type checks + if let Ok(key) = conf_rs.get_str("clientchain.asset_key") { + if !check_privkey_string(&key) { + println!("{}", CError::InputError(PrivKey, key.clone())); + return Err(Error::from(CError::InputError(PrivKey, key))); + } + } + if let Ok(hash) = conf_rs.get_str("clientchain.genesis_hash") { + if !check_hash_string(&hash) { + println!("{}", CError::InputError(GenHash, hash.clone())); + return Err(Error::from(CError::InputError(GenHash, hash))); + } + } Ok(conf_rs.try_into()?) } } diff --git a/src/coordinator.rs b/src/coordinator.rs index eb99439..f494506 100644 --- a/src/coordinator.rs +++ b/src/coordinator.rs @@ -77,6 +77,7 @@ pub fn run_request( time::Duration::from_secs(config.verify_duration), time::Duration::from_secs(config.challenge_duration), config.challenge_frequency, + time::Duration::from_secs(10), )?; // stop listener service diff --git a/src/error.rs b/src/error.rs index 77c7702..ba7b19a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,8 +22,11 @@ pub enum CError { MissingBids, /// Listener receiver disconnected error ReceiverDisconnected, - /// Missing unspent for challenge asset - MissingUnspent, + /// Missing unspent for challenge asset. Takes parameters asset label and + /// chain + MissingUnspent(String, String), + /// Config input error. Takes parameter input error type + InputError(InputErrorType, String), /// Generic error from string error message Generic(String), } @@ -34,10 +37,36 @@ impl From for CError { } } +/// Input parameter error types +#[derive(Debug)] +pub enum InputErrorType { + /// Invalid private key string + PrivKey, + /// Invalid genesis hash string + GenHash, +} + +impl InputErrorType { + fn as_str(&self) -> &'static str { + match *self { + InputErrorType::PrivKey => "Invalid private key input - must be base58check string of length 52.", + InputErrorType::GenHash => { + "Invalid client chain genesis hash input - must be hexadecimal string of length 64." + } + } + } +} + impl fmt::Display for CError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { - CError::Generic(ref e) => write!(f, "generic error: {}", e), + CError::Generic(ref e) => write!(f, "generic Error: {}", e), + CError::InputError(ref error, ref value) => { + write!(f, "Input Error: {} \nProblem value: {}", error.as_str(), value) + } + CError::MissingUnspent(ref asset, ref chain) => { + write!(f, "No unspent found for {} asset on {} chain", asset, chain) + } _ => f.write_str(error::Error::description(self)), } } @@ -46,10 +75,11 @@ impl fmt::Display for CError { impl error::Error for CError { fn description(&self) -> &str { match *self { - CError::Generic(_) => "generic error", - CError::MissingBids => "no bids found", - CError::ReceiverDisconnected => "challenge response receiver disconnected", - CError::MissingUnspent => "no unspent found for challenge asset", + CError::Generic(_) => "Generic error", + CError::MissingBids => "No bids found", + CError::ReceiverDisconnected => "Challenge response receiver disconnected", + CError::MissingUnspent(_, _) => "No unspent found for asset", + CError::InputError(_, _) => "Input parameter error", } } fn source(&self) -> Option<&(dyn error::Error + 'static)> { diff --git a/src/lib.rs b/src/lib.rs index 8165a66..d6812fa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,3 +44,8 @@ pub mod ocean; pub mod request; pub mod service; pub mod storage; +/// utilities +pub mod util { + pub mod checks; + pub mod testing; +} diff --git a/src/listener.rs b/src/listener.rs index abd4e58..0cc59c1 100644 --- a/src/listener.rs +++ b/src/listener.rs @@ -178,38 +178,9 @@ mod tests { use std::sync::mpsc::{channel, Receiver, TryRecvError}; use bitcoin_hashes::hex::ToHex; - use bitcoin_hashes::Hash; use secp256k1::SecretKey; - use crate::request::{BidSet, Request as ServiceRequest}; - - /// Generate dummy hash for tests - fn gen_dummy_hash(i: u8) -> sha256d::Hash { - sha256d::Hash::from_slice(&[i as u8; 32]).unwrap() - } - - /// Geberate dummy challenge state - fn gen_challenge_state(request_hash: &sha256d::Hash, challenge_hash: &sha256d::Hash) -> ChallengeState { - let request = ServiceRequest { - txid: sha256d::Hash::from_slice(&[0xff as u8; 32]).unwrap(), - start_blockheight: 2, - end_blockheight: 5, - genesis_blockhash: *request_hash, - fee_percentage: 5, - num_tickets: 10, - }; - let mut bids = BidSet::new(); - let _ = bids.insert(Bid { - txid: sha256d::Hash::from_hex("1234567890000000000000000000000000000000000000000000000000000000").unwrap(), - // pubkey corresponding to SecretKey::from_slice(&[0xaa; 32]) - pubkey: PublicKey::from_str("026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3").unwrap(), - }); - ChallengeState { - request, - bids, - latest_challenge: Some(*challenge_hash), - } - } + use crate::util::testing::{gen_challenge_state_with_challenge, gen_dummy_hash}; #[test] fn challengeproof_from_json_test() { @@ -272,7 +243,7 @@ mod tests { #[test] fn challengeproof_verify_test() { let chl_hash = gen_dummy_hash(11); - let _challenge_state = gen_challenge_state(&gen_dummy_hash(3), &chl_hash); + let _challenge_state = gen_challenge_state_with_challenge(&gen_dummy_hash(3), &chl_hash); let bid_txid = _challenge_state.bids.iter().next().unwrap().txid; let bid_pubkey = _challenge_state.bids.iter().next().unwrap().pubkey; @@ -315,7 +286,7 @@ mod tests { let (resp_tx, resp_rx): (Sender, Receiver) = channel(); let chl_hash = gen_dummy_hash(11); - let _challenge_state = gen_challenge_state(&gen_dummy_hash(3), &chl_hash); + let _challenge_state = gen_challenge_state_with_challenge(&gen_dummy_hash(3), &chl_hash); let bid_txid = _challenge_state.bids.iter().next().unwrap().txid; let bid_pubkey = _challenge_state.bids.iter().next().unwrap().pubkey; let challenge_state = Arc::new(Mutex::new(_challenge_state)); @@ -453,7 +424,7 @@ mod tests { let (resp_tx, resp_rx): (Sender, Receiver) = channel(); let chl_hash = gen_dummy_hash(8); - let _challenge_state = gen_challenge_state(&gen_dummy_hash(1), &chl_hash); + let _challenge_state = gen_challenge_state_with_challenge(&gen_dummy_hash(1), &chl_hash); let bid_txid = _challenge_state.bids.iter().next().unwrap().txid; let bid_pubkey = _challenge_state.bids.iter().next().unwrap().pubkey; let challenge_state = Arc::new(Mutex::new(_challenge_state)); @@ -581,13 +552,16 @@ mod tests { assert!(resp_rx.try_recv() == Err(TryRecvError::Empty)); // check receiver empty // Invalid bid on request body (pubkey does not exist) - let data = format!(r#" + let data = format!( + r#" {{ "txid": "{}", "pubkey": "03356190524d52d7e94e1bd43e8f23778e585a4fe1f275e65a06fa5ceedb67d111", "hash": "0404040404040404040404040404040404040404040404040404040404040404", "sig": "304402201742daea5ec3b7306b9164be862fc1659cc830032180b8b17beffe02645860d602201039eba402d22e630308e6af05da8dd4f05b51b7d672ca5fc9e3b0a57776365c" - }}"#, bid_txid); + }}"#, + bid_txid + ); let request = Request::new(Body::from(data)); let _ = handle_challengeproof(request, challenge_state.clone(), resp_tx.clone()) .map(|res| { @@ -603,13 +577,16 @@ mod tests { assert!(resp_rx.try_recv() == Err(TryRecvError::Empty)); // check receiver empty // Request send for an invalid / out of date challenge hash - let data = format!(r#" + let data = format!( + r#" {{ "txid": "{}", "pubkey": "{}", "hash": "0404040404040404040404040404040404040404040404040404040404040404", "sig": "304402201742daea5ec3b7306b9164be862fc1659cc830032180b8b17beffe02645860d602201039eba402d22e630308e6af05da8dd4f05b51b7d672ca5fc9e3b0a57776365c" - }}"#, bid_txid, bid_pubkey); + }}"#, + bid_txid, bid_pubkey + ); let request = Request::new(Body::from(data)); let _ = handle_challengeproof(request, challenge_state.clone(), resp_tx.clone()) .map(|res| { @@ -625,13 +602,16 @@ mod tests { assert!(resp_rx.try_recv() == Err(TryRecvError::Empty)); // check receiver empty // Request sent an invalid sig for the correct bid and challenge hash - let data = format!(r#" + let data = format!( + r#" {{ "txid": "{}", "pubkey": "{}", "hash": "{}", "sig": "304402201742daea5ec3b7306b9164be862fc1659cc830032180b8b17beffe02645860d602201039eba402d22e630308e6af05da8dd4f05b51b7d672ca5fc9e3b0a57776365c" - }}"#, bid_txid, bid_pubkey, chl_hash); + }}"#, + bid_txid, bid_pubkey, chl_hash + ); let request = Request::new(Body::from(data)); let _ = handle_challengeproof(request, challenge_state.clone(), resp_tx.clone()) .map(|res| { diff --git a/src/service.rs b/src/service.rs index e2a4e91..bb31319 100644 --- a/src/service.rs +++ b/src/service.rs @@ -2,15 +2,11 @@ //! //! Service chain interface and implementations -use std::cell::RefCell; -use std::str::FromStr; - -use bitcoin_hashes::{hex::FromHex, sha256d, Hash}; +use bitcoin_hashes::sha256d; use ocean_rpc::RpcApi; -use secp256k1::key::PublicKey; use crate::config::ServiceConfig; -use crate::error::{CError, Error, Result}; +use crate::error::Result; use crate::ocean::OceanClient; use crate::request::{Bid, BidSet, Request}; @@ -87,101 +83,3 @@ impl Service for RpcService { Ok(self.client.get_block_count()?) } } - -/// Mock implementation of Service using some mock logic for testing -pub struct MockService { - /// Flag that when set returns error on all inherited methods that return - /// Result - pub return_err: bool, - /// Flag that when set returns None on all inherited methods that return - /// Option - pub return_none: bool, - /// Current active request - pub request: Request, - /// Mock service chain blockheight - incremented by default on - /// get_blockheight - pub height: RefCell, -} - -impl MockService { - /// Create a MockService with all flags turned off by default - pub fn new() -> Self { - let request = Request { - txid: sha256d::Hash::from_slice(&[0xff as u8; 32]).unwrap(), - start_blockheight: 2, - end_blockheight: 5, - genesis_blockhash: sha256d::Hash::from_hex( - "0000000000000000000000000000000000000000000000000000000000000000", - ) - .unwrap(), - fee_percentage: 5, - num_tickets: 10, - }; - - MockService { - return_err: false, - return_none: false, - request, - height: RefCell::new(0), - } - } -} - -impl Service for MockService { - /// Get all active requests, if any, from service chain - fn get_requests(&self) -> Result>> { - Ok(None) - } - - /// Try get active request, by genesis hash, from service chain - fn get_request(&self, hash: &sha256d::Hash) -> Result> { - if self.return_none { - return Ok(None); - } - if self.return_err { - return Err(Error::from(CError::Generic("get_request failed".to_owned()))); - } - - let mut dummy_req = self.request.clone(); - dummy_req.genesis_blockhash = *hash; - Ok(Some(dummy_req)) - } - - /// Try get active request bids, by transaction hash, from service chain - fn get_request_bids(&self, _hash: &sha256d::Hash) -> Result> { - if self.return_none { - return Ok(None); - } - if self.return_err { - return Err(Error::from(CError::Generic("get_request_bids failed".to_owned()))); - } - let mut bid_set = BidSet::new(); - let _ = bid_set.insert(Bid { - txid: sha256d::Hash::from_hex("1234567890000000000000000000000000000000000000000000000000000000").unwrap(), - // pubkey corresponding to SecretKey::from_slice(&[0xaa; 32]) - pubkey: PublicKey::from_str("026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3").unwrap(), - }); - let _ = bid_set.insert(Bid { - txid: sha256d::Hash::from_hex("0000000001234567890000000000000000000000000000000000000000000000").unwrap(), - // pubkey corresponding to SecretKey::from_slice(&[0xbb; 32]) - pubkey: PublicKey::from_str("0268680737c76dabb801cb2204f57dbe4e4579e4f710cd67dc1b4227592c81e9b5").unwrap(), - }); - let _ = bid_set.insert(Bid { - txid: sha256d::Hash::from_hex("0000000000000000001234567890000000000000000000000000000000000000").unwrap(), - // pubkey corresponding to SecretKey::from_slice(&[0xcc; 32]) - pubkey: PublicKey::from_str("02b95c249d84f417e3e395a127425428b540671cc15881eb828c17b722a53fc599").unwrap(), - }); - Ok(Some(bid_set)) - } - - /// Get service chain blockheight - fn get_blockheight(&self) -> Result { - if self.return_err { - return Err(Error::from(CError::Generic("get_blockheight failed".to_owned()))); - } - - let mut height = self.height.borrow_mut(); - *height += 1; // increment height for integration testing - Ok(*height - 1) // return previous height - } -} diff --git a/src/storage.rs b/src/storage.rs index 7a66fcb..88fe94e 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -2,7 +2,6 @@ //! //! Storage interface and implementations -use std::cell::RefCell; use std::mem::drop; use std::str::FromStr; use std::sync::{Mutex, MutexGuard}; @@ -15,7 +14,7 @@ use secp256k1::key::PublicKey; use crate::challenger::{ChallengeResponseIds, ChallengeState}; use crate::config::StorageConfig; -use crate::error::{CError, Error, Result}; +use crate::error::Result; use crate::request::{Bid, BidSet, Request}; /// Storage trait defining required functionality for objects that store request @@ -237,7 +236,7 @@ impl Storage for MongoStorage { } /// Util method that generates a Request document from a request -fn request_to_doc(request: &Request) -> OrderedDocument { +pub fn request_to_doc(request: &Request) -> OrderedDocument { doc! { "txid": request.txid.to_string(), "start_blockheight": request.start_blockheight, @@ -249,7 +248,7 @@ fn request_to_doc(request: &Request) -> OrderedDocument { } /// Util method that generates a request from a Request document -fn doc_to_request(doc: &OrderedDocument) -> Request { +pub fn doc_to_request(doc: &OrderedDocument) -> Request { Request { txid: sha256d::Hash::from_hex(doc.get("txid").unwrap().as_str().unwrap()).unwrap(), start_blockheight: doc.get("start_blockheight").unwrap().as_i32().unwrap() as u32, @@ -261,7 +260,7 @@ fn doc_to_request(doc: &OrderedDocument) -> Request { } /// Util method that generates a Bid document from a request bid -fn bid_to_doc(request_id: &Bson, bid: &Bid) -> OrderedDocument { +pub fn bid_to_doc(request_id: &Bson, bid: &Bid) -> OrderedDocument { doc! { "request_id": request_id.clone(), "txid": bid.txid.to_string(), @@ -270,7 +269,7 @@ fn bid_to_doc(request_id: &Bson, bid: &Bid) -> OrderedDocument { } /// Util method that generates a request bid from a Bid document -fn doc_to_bid(doc: &OrderedDocument) -> Bid { +pub fn doc_to_bid(doc: &OrderedDocument) -> Bid { Bid { txid: sha256d::Hash::from_hex(doc.get("txid").unwrap().as_str().unwrap()).unwrap(), pubkey: PublicKey::from_str(doc.get("pubkey").unwrap().as_str().unwrap()).unwrap(), @@ -278,7 +277,7 @@ fn doc_to_bid(doc: &OrderedDocument) -> Bid { } /// Util method that generates a Response document from challenge responses -fn challenge_responses_to_doc(request_id: &Bson, responses: &ChallengeResponseIds) -> OrderedDocument { +pub fn challenge_responses_to_doc(request_id: &Bson, responses: &ChallengeResponseIds) -> OrderedDocument { let bids = responses .iter() .map(|x| Bson::String(x.to_string())) @@ -290,7 +289,7 @@ fn challenge_responses_to_doc(request_id: &Bson, responses: &ChallengeResponseId } /// Util method that generates challenge responses from a Response document -fn doc_to_challenge_responses(doc: &OrderedDocument) -> ChallengeResponseIds { +pub fn doc_to_challenge_responses(doc: &OrderedDocument) -> ChallengeResponseIds { doc.get_array("bid_txids") .unwrap() .iter() @@ -298,111 +297,13 @@ fn doc_to_challenge_responses(doc: &OrderedDocument) -> ChallengeResponseIds { .collect() } -/// Mock implementation of Storage storing data in memory for testing -#[derive(Debug)] -pub struct MockStorage { - /// Flag that when set returns error on all inherited methods that return - /// Result - pub return_err: bool, - /// Store requests in memory - pub requests: RefCell>, - /// Store bids in memory - pub bids: RefCell>, - /// Store challenge responses in memory - pub challenge_responses: RefCell>, -} - -impl MockStorage { - /// Create a MockStorage with all flags turned off by default - pub fn new() -> Self { - MockStorage { - return_err: false, - requests: RefCell::new(vec![]), - bids: RefCell::new(vec![]), - challenge_responses: RefCell::new(vec![]), - } - } -} - -impl Storage for MockStorage { - /// Store the state of a challenge request - fn save_challenge_state(&self, challenge: &ChallengeState) -> Result<()> { - if self.return_err { - return Err(Error::from(CError::Generic("save_challenge_state failed".to_owned()))); - } - self.requests.borrow_mut().push(request_to_doc(&challenge.request)); - for bid in challenge.bids.iter() { - self.bids - .borrow_mut() - .push(bid_to_doc(&Bson::String(challenge.request.txid.to_string()), bid)) - } - Ok(()) - } - - /// Store responses for a specific challenge request - fn save_response(&self, request_hash: sha256d::Hash, ids: &ChallengeResponseIds) -> Result<()> { - if self.return_err { - return Err(Error::from(CError::Generic("save_response failed".to_owned()))); - } - self.challenge_responses - .borrow_mut() - .push(challenge_responses_to_doc(&Bson::String(request_hash.to_string()), ids)); - Ok(()) - } - - /// Get all challenge responses for a specific request - fn get_responses(&self, request_hash: sha256d::Hash) -> Result> { - let mut challenge_responses = vec![]; - for doc in self.challenge_responses.borrow().to_vec().iter() { - if doc.get("request_id").unwrap().as_str().unwrap() == request_hash.to_string() { - challenge_responses.push(doc_to_challenge_responses(doc)); - } - } - Ok(challenge_responses) - } - - /// Get all bids for a specific request - fn get_bids(&self, request_hash: sha256d::Hash) -> Result { - let mut bids = BidSet::new(); - for doc in self.bids.borrow().to_vec().iter() { - if doc.get("request_id").unwrap().as_str().unwrap() == request_hash.to_string() { - let _ = bids.insert(doc_to_bid(doc)); - } - } - Ok(bids) - } - - /// Get all the requests - fn get_requests(&self) -> Result> { - let mut requests = vec![]; - for doc in self.requests.borrow().to_vec().iter() { - requests.push(doc_to_request(doc)) - } - Ok(requests) - } - - /// Get request for a specific request txid - fn get_request(&self, request_hash: sha256d::Hash) -> Result> { - for doc in self.requests.borrow().to_vec().iter() { - if doc.get("txid").unwrap().as_str().unwrap() == request_hash.to_string() { - return Ok(Some(doc_to_request(doc))); - } - } - Ok(None) - } -} - #[cfg(test)] mod tests { use super::*; - use bitcoin_hashes::Hash; use mongodb::oid::ObjectId; - /// Generate dummy hash for tests - fn gen_dummy_hash(i: u8) -> sha256d::Hash { - sha256d::Hash::from_slice(&[i as u8; 32]).unwrap() - } + use crate::util::testing::gen_dummy_hash; #[test] fn request_doc_test() { diff --git a/src/util/checks.rs b/src/util/checks.rs new file mode 100644 index 0000000..8dfd270 --- /dev/null +++ b/src/util/checks.rs @@ -0,0 +1,25 @@ +//! checks +//! +//! validity checks for string inputs. Use before adding to Config + +/// Return true if char is in base58check character set, false otherwise +fn is_base58_char(char: &char) -> bool { + match *char as u8 { + b'0'..=b'9' | b'A'..=b'H' | b'J'..=b'N' | b'P'..=b'Z' | b'a'..=b'k' | b'm'..=b'z' => true, + _ => false, + } +} +/// Check for correct priv key input string format +pub fn check_privkey_string(str: &String) -> bool { + if str.len() == 52 && str.chars().all(|x| is_base58_char(&x)) { + return true; + } + return false; +} +/// Check for correct hash input string format +pub fn check_hash_string(str: &String) -> bool { + if str.len() == 64 && str.chars().all(|x| x.is_ascii_hexdigit()) { + return true; + } + return false; +} diff --git a/src/util/testing.rs b/src/util/testing.rs new file mode 100644 index 0000000..9597a80 --- /dev/null +++ b/src/util/testing.rs @@ -0,0 +1,308 @@ +//! # Testing Utils +//! +//! Colleciton of helper functions used in tests module + +use bitcoin_hashes::{hex::FromHex, sha256d, Hash}; +use mongodb::ordered::OrderedDocument; +use mongodb::Bson; +use secp256k1::PublicKey; +use std::cell::RefCell; +use std::str::FromStr; + +use crate::challenger::{ChallengeResponseIds, ChallengeState}; +use crate::clientchain::ClientChain; +use crate::request::{Bid, BidSet, Request as ServiceRequest}; +use crate::service::Service; +use crate::storage::*; + +use crate::error::*; + +/// Generate dummy hash +pub fn gen_dummy_hash(i: u8) -> sha256d::Hash { + sha256d::Hash::from_slice(&[i as u8; 32]).unwrap() +} + +/// Generate dummy challenge state +pub fn gen_challenge_state(request_hash: &sha256d::Hash) -> ChallengeState { + let request = ServiceRequest { + txid: *request_hash, + start_blockheight: 2, + end_blockheight: 5, + genesis_blockhash: gen_dummy_hash(0), + fee_percentage: 5, + num_tickets: 10, + }; + let mut bids = BidSet::new(); + let _ = bids.insert(Bid { + txid: sha256d::Hash::from_hex("1234567890000000000000000000000000000000000000000000000000000000").unwrap(), + pubkey: PublicKey::from_str("026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3").unwrap(), + }); + ChallengeState { + request, + bids, + latest_challenge: Some(gen_dummy_hash(0)), + } +} + +/// Generate dummy challenge state with specific challenge +pub fn gen_challenge_state_with_challenge( + request_hash: &sha256d::Hash, + challenge_hash: &sha256d::Hash, +) -> ChallengeState { + let request = ServiceRequest { + txid: sha256d::Hash::from_slice(&[0xff as u8; 32]).unwrap(), + start_blockheight: 2, + end_blockheight: 5, + genesis_blockhash: *request_hash, + fee_percentage: 5, + num_tickets: 10, + }; + let mut bids = BidSet::new(); + let _ = bids.insert(Bid { + txid: sha256d::Hash::from_hex("1234567890000000000000000000000000000000000000000000000000000000").unwrap(), + // pubkey corresponding to SecretKey::from_slice(&[0xaa; 32]) + pubkey: PublicKey::from_str("026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3").unwrap(), + }); + ChallengeState { + request, + bids, + latest_challenge: Some(*challenge_hash), + } +} + +/// Mock implementation of ClientChain using some mock logic for testing +pub struct MockClientChain { + /// Flag that when set returns error on all inherited methods that return + /// Result + pub return_err: bool, + /// Flag that when set returns false on all inherited methods that return + /// bool + pub return_false: bool, + /// Mock client chain blockheight + pub height: RefCell, +} + +impl MockClientChain { + /// Create a MockClientChain with all flags turned off by default + pub fn new() -> Self { + MockClientChain { + return_err: false, + return_false: false, + height: RefCell::new(0), + } + } +} + +impl ClientChain for MockClientChain { + /// Send challenge transaction to client chain + fn send_challenge(&self) -> Result { + if self.return_err { + return Err(Error::from(CError::Generic("send_challenge failed".to_owned()))); + } + // Use height to generate mock challenge hash + Ok(sha256d::Hash::from_slice(&[(*self.height.borrow() % 16) as u8; 32])?) + } + + /// Verify challenge transaction has been included in the chain + fn verify_challenge(&self, _txid: &sha256d::Hash) -> Result { + if self.return_err { + return Err(Error::from(CError::Generic("verify_challenge failed".to_owned()))); + } + if self.return_false { + return Ok(false); + } + Ok(true) + } +} + +/// Mock implementation of Service using some mock logic for testing +pub struct MockService { + /// Flag that when set returns error on all inherited methods that return + /// Result + pub return_err: bool, + /// Flag that when set returns None on all inherited methods that return + /// Option + pub return_none: bool, + /// Current active request + pub request: ServiceRequest, + /// Mock service chain blockheight - incremented by default on + /// get_blockheight + pub height: RefCell, +} + +impl MockService { + /// Create a MockService with all flags turned off by default + pub fn new() -> Self { + let request = ServiceRequest { + txid: sha256d::Hash::from_slice(&[0xff as u8; 32]).unwrap(), + start_blockheight: 2, + end_blockheight: 5, + genesis_blockhash: sha256d::Hash::from_hex( + "0000000000000000000000000000000000000000000000000000000000000000", + ) + .unwrap(), + fee_percentage: 5, + num_tickets: 10, + }; + + MockService { + return_err: false, + return_none: false, + request, + height: RefCell::new(0), + } + } +} + +impl Service for MockService { + /// Get all active requests, if any, from service chain + fn get_requests(&self) -> Result>> { + Ok(None) + } + + /// Try get active request, by genesis hash, from service chain + fn get_request(&self, hash: &sha256d::Hash) -> Result> { + if self.return_none { + return Ok(None); + } + if self.return_err { + return Err(Error::from(CError::Generic("get_request failed".to_owned()))); + } + + let mut dummy_req = self.request.clone(); + dummy_req.genesis_blockhash = *hash; + Ok(Some(dummy_req)) + } + + /// Try get active request bids, by transaction hash, from service chain + fn get_request_bids(&self, _hash: &sha256d::Hash) -> Result> { + if self.return_none { + return Ok(None); + } + if self.return_err { + return Err(Error::from(CError::Generic("get_request_bids failed".to_owned()))); + } + let mut bid_set = BidSet::new(); + let _ = bid_set.insert(Bid { + txid: sha256d::Hash::from_hex("1234567890000000000000000000000000000000000000000000000000000000").unwrap(), + // pubkey corresponding to SecretKey::from_slice(&[0xaa; 32]) + pubkey: PublicKey::from_str("026a04ab98d9e4774ad806e302dddeb63bea16b5cb5f223ee77478e861bb583eb3").unwrap(), + }); + let _ = bid_set.insert(Bid { + txid: sha256d::Hash::from_hex("0000000001234567890000000000000000000000000000000000000000000000").unwrap(), + // pubkey corresponding to SecretKey::from_slice(&[0xbb; 32]) + pubkey: PublicKey::from_str("0268680737c76dabb801cb2204f57dbe4e4579e4f710cd67dc1b4227592c81e9b5").unwrap(), + }); + let _ = bid_set.insert(Bid { + txid: sha256d::Hash::from_hex("0000000000000000001234567890000000000000000000000000000000000000").unwrap(), + // pubkey corresponding to SecretKey::from_slice(&[0xcc; 32]) + pubkey: PublicKey::from_str("02b95c249d84f417e3e395a127425428b540671cc15881eb828c17b722a53fc599").unwrap(), + }); + Ok(Some(bid_set)) + } + + /// Get service chain blockheight + fn get_blockheight(&self) -> Result { + if self.return_err { + return Err(Error::from(CError::Generic("get_blockheight failed".to_owned()))); + } + + let mut height = self.height.borrow_mut(); + *height += 1; // increment height for integration testing + Ok(*height - 1) // return previous height + } +} + +/// Mock implementation of Storage storing data in memory for testing +#[derive(Debug)] +pub struct MockStorage { + /// Flag that when set returns error on all inherited methods that return + /// Result + pub return_err: bool, + /// Store requests in memory + pub requests: RefCell>, + /// Store bids in memory + pub bids: RefCell>, + /// Store challenge responses in memory + pub challenge_responses: RefCell>, +} + +impl MockStorage { + /// Create a MockStorage with all flags turned off by default + pub fn new() -> Self { + MockStorage { + return_err: false, + requests: RefCell::new(vec![]), + bids: RefCell::new(vec![]), + challenge_responses: RefCell::new(vec![]), + } + } +} + +impl Storage for MockStorage { + /// Store the state of a challenge request + fn save_challenge_state(&self, challenge: &ChallengeState) -> Result<()> { + if self.return_err { + return Err(Error::from(CError::Generic("save_challenge_state failed".to_owned()))); + } + self.requests.borrow_mut().push(request_to_doc(&challenge.request)); + for bid in challenge.bids.iter() { + self.bids + .borrow_mut() + .push(bid_to_doc(&Bson::String(challenge.request.txid.to_string()), bid)) + } + Ok(()) + } + + /// Store responses for a specific challenge request + fn save_response(&self, request_hash: sha256d::Hash, ids: &ChallengeResponseIds) -> Result<()> { + if self.return_err { + return Err(Error::from(CError::Generic("save_response failed".to_owned()))); + } + self.challenge_responses + .borrow_mut() + .push(challenge_responses_to_doc(&Bson::String(request_hash.to_string()), ids)); + Ok(()) + } + + /// Get all challenge responses for a specific request + fn get_responses(&self, request_hash: sha256d::Hash) -> Result> { + let mut challenge_responses = vec![]; + for doc in self.challenge_responses.borrow().to_vec().iter() { + if doc.get("request_id").unwrap().as_str().unwrap() == request_hash.to_string() { + challenge_responses.push(doc_to_challenge_responses(doc)); + } + } + Ok(challenge_responses) + } + + /// Get all bids for a specific request + fn get_bids(&self, request_hash: sha256d::Hash) -> Result { + let mut bids = BidSet::new(); + for doc in self.bids.borrow().to_vec().iter() { + if doc.get("request_id").unwrap().as_str().unwrap() == request_hash.to_string() { + let _ = bids.insert(doc_to_bid(doc)); + } + } + Ok(bids) + } + + /// Get all the requests + fn get_requests(&self) -> Result> { + let mut requests = vec![]; + for doc in self.requests.borrow().to_vec().iter() { + requests.push(doc_to_request(doc)) + } + Ok(requests) + } + + /// Get request for a specific request txid + fn get_request(&self, request_hash: sha256d::Hash) -> Result> { + for doc in self.requests.borrow().to_vec().iter() { + if doc.get("txid").unwrap().as_str().unwrap() == request_hash.to_string() { + return Ok(Some(doc_to_request(doc))); + } + } + Ok(None) + } +}