Fix update-sapling-tree binary

The generated gRPC files were updated using protoc-rust-grpc 0.8.2 and
protoc 3.13.0.
This commit is contained in:
Jack Grigg 2020-09-22 17:05:26 +01:00
parent 588c65afa1
commit dc0479af91
5 changed files with 1819 additions and 804 deletions

611
Cargo.lock generated
View File

@ -71,7 +71,7 @@ dependencies = [
"android_log-sys",
"env_logger",
"lazy_static",
"log 0.4.11",
"log",
]
[[package]]
@ -128,6 +128,12 @@ dependencies = [
"safemem",
]
[[package]]
name = "base64"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7"
[[package]]
name = "base64"
version = "0.12.3"
@ -151,12 +157,12 @@ dependencies = [
"byteorder",
"crossbeam",
"ff",
"futures",
"futures 0.1.29",
"futures-cpupool",
"group",
"num_cpus",
"pairing",
"rand_core",
"rand_core 0.5.1",
"subtle",
]
@ -264,7 +270,7 @@ dependencies = [
"ff",
"group",
"pairing",
"rand_core",
"rand_core 0.5.1",
"subtle",
]
@ -295,16 +301,6 @@ version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
[[package]]
name = "bytes"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c"
dependencies = [
"byteorder",
"iovec",
]
[[package]]
name = "bytes"
version = "0.5.6"
@ -344,7 +340,7 @@ version = "4.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2809f67365382d65fd2b6d9c22577231b954ed27400efeafbe687bda75abcc0b"
dependencies = [
"bytes 0.5.6",
"bytes",
"memchr",
"pin-project-lite",
]
@ -504,7 +500,7 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
dependencies = [
"log 0.4.11",
"log",
"regex",
]
@ -574,16 +570,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01646e077d4ebda82b73f1bca002ea1e91561a77df2431a9e79729bcc31950ef"
dependencies = [
"bitvec",
"rand_core",
"rand_core 0.5.1",
"subtle",
]
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "fpe"
version = "0.3.1"
@ -597,6 +587,12 @@ dependencies = [
"num-traits",
]
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
@ -625,16 +621,111 @@ version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
[[package]]
name = "futures"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-channel"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
"futures-core",
"futures-sink",
]
[[package]]
name = "futures-core"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
[[package]]
name = "futures-cpupool"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
dependencies = [
"futures",
"futures 0.1.29",
"num_cpus",
]
[[package]]
name = "futures-executor"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
[[package]]
name = "futures-macro"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
dependencies = [
"proc-macro-hack",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "futures-sink"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"
[[package]]
name = "futures-task"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
dependencies = [
"once_cell",
]
[[package]]
name = "futures-util"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project",
"pin-utils",
"proc-macro-hack",
"proc-macro-nested",
"slab",
]
[[package]]
name = "generic-array"
version = "0.12.3"
@ -679,28 +770,36 @@ checksum = "cc11f9f5fbf1943b48ae7c2bf6846e7d827a512d1be4f23af708f5ca5d01dde1"
dependencies = [
"byteorder",
"ff",
"rand_core",
"rand_core 0.5.1",
"subtle",
]
[[package]]
name = "grpc"
version = "0.6.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e530ef7894a104a1c8525ce68787b3491efa2098ce5e5454e8324ea78893548"
checksum = "f61e21f9181e4f3732976a62a81f2b53f1195867d99325b5b9408b19219137e2"
dependencies = [
"base64 0.9.3",
"bytes 0.4.12",
"futures",
"futures-cpupool",
"bytes",
"futures 0.3.5",
"httpbis",
"log 0.4.11",
"protobuf",
"log",
"log-ndc",
"tls-api",
"tls-api-stub",
"tokio-core",
"tokio-io",
"tokio-tls-api",
"tokio",
]
[[package]]
name = "grpc-protobuf"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c784adad59f85a308c690bbfd8863001750f3e01929dcc6fba0bfc2f13e3192"
dependencies = [
"bytes",
"grpc",
"protobuf",
]
[[package]]
@ -710,7 +809,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35b15cc3c181a2aace485d56c784568a4ae6e34322287a2499549d4cda7af3e1"
dependencies = [
"lazy_static",
"rand",
"rand 0.7.3",
"ring",
"secp256k1",
]
@ -738,22 +837,19 @@ checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35"
[[package]]
name = "httpbis"
version = "0.7.0"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7689cfa896b2a71da4f16206af167542b75d242b6906313e53857972a92d5614"
checksum = "3d3e4404f8f87938a2db89336609bde64363f5a556b15af936343e7252c9648d"
dependencies = [
"bytes 0.4.12",
"futures",
"futures-cpupool",
"log 0.4.11",
"bytes",
"futures 0.3.5",
"log",
"log-ndc",
"net2",
"rand 0.5.6",
"tls-api",
"tls-api-stub",
"tokio-core",
"tokio-io",
"tokio-timer 0.1.2",
"tokio-tls-api",
"tokio-uds 0.1.7",
"tokio",
"unix_socket",
"void",
]
@ -783,7 +879,7 @@ dependencies = [
"combine",
"error-chain",
"jni-sys",
"log 0.4.11",
"log",
"walkdir",
]
@ -812,7 +908,7 @@ dependencies = [
"bls12_381",
"ff",
"group",
"rand_core",
"rand_core 0.5.1",
"subtle",
]
@ -855,24 +951,6 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
[[package]]
name = "lock_api"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
dependencies = [
"scopeguard",
]
[[package]]
name = "log"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
dependencies = [
"log 0.4.11",
]
[[package]]
name = "log"
version = "0.4.11"
@ -882,13 +960,22 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "log-ndc"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb09057c7b58b7d27498b528eaee9a1e661b2974a733fcabbbc3350360bc8bd"
dependencies = [
"log",
]
[[package]]
name = "log-panics"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae0136257df209261daa18d6c16394757c63e032e27aafd8b07788b051082bef"
dependencies = [
"log 0.4.11",
"log",
]
[[package]]
@ -943,10 +1030,10 @@ dependencies = [
"iovec",
"kernel32-sys",
"libc",
"log 0.4.11",
"log",
"miow",
"net2",
"slab 0.4.2",
"slab",
"winapi 0.2.8",
]
@ -1030,6 +1117,12 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
[[package]]
name = "once_cell"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
[[package]]
name = "opaque-debug"
version = "0.2.3"
@ -1053,29 +1146,23 @@ dependencies = [
]
[[package]]
name = "parking_lot"
version = "0.9.0"
name = "pin-project"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
dependencies = [
"lock_api",
"parking_lot_core",
"rustc_version",
"pin-project-internal",
]
[[package]]
name = "parking_lot_core"
version = "0.6.2"
name = "pin-project-internal"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
dependencies = [
"cfg-if",
"cloudabi",
"libc",
"redox_syscall",
"rustc_version",
"smallvec 0.6.13",
"winapi 0.3.9",
"proc-macro2",
"quote",
"syn",
]
[[package]]
@ -1084,6 +1171,12 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkg-config"
version = "0.3.18"
@ -1102,6 +1195,12 @@ version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
[[package]]
name = "proc-macro-nested"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
[[package]]
name = "proc-macro2"
version = "1.0.21"
@ -1117,7 +1216,7 @@ version = "2.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb14183cc7f213ee2410067e1ceeadba2a7478a59432ff0747a335202798b1e2"
dependencies = [
"bytes 0.5.6",
"bytes",
]
[[package]]
@ -1154,6 +1253,19 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64de9a0c5361e034f1aefc9f71a86871ec870e766fe31a009734a989b329286a"
[[package]]
name = "rand"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9"
dependencies = [
"cloudabi",
"fuchsia-cprng",
"libc",
"rand_core 0.3.1",
"winapi 0.3.9",
]
[[package]]
name = "rand"
version = "0.7.3"
@ -1163,7 +1275,7 @@ dependencies = [
"getrandom",
"libc",
"rand_chacha",
"rand_core",
"rand_core 0.5.1",
"rand_hc",
]
@ -1174,9 +1286,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
dependencies = [
"ppv-lite86",
"rand_core",
"rand_core 0.5.1",
]
[[package]]
name = "rand_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
dependencies = [
"rand_core 0.4.2",
]
[[package]]
name = "rand_core"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
[[package]]
name = "rand_core"
version = "0.5.1"
@ -1192,7 +1319,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
dependencies = [
"rand_core",
"rand_core 0.5.1",
]
[[package]]
@ -1268,7 +1395,7 @@ dependencies = [
"libsqlite3-sys",
"lru-cache",
"memchr",
"smallvec 1.4.2",
"smallvec",
"time",
]
@ -1301,12 +1428,12 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.18.1"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81"
checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1"
dependencies = [
"base64 0.12.3",
"log 0.4.11",
"base64 0.11.0",
"log",
"ring",
"sct",
"webpki",
@ -1333,12 +1460,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "scoped-tls"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
[[package]]
name = "scopeguard"
version = "1.1.0"
@ -1447,27 +1568,12 @@ dependencies = [
"opaque-debug 0.3.0",
]
[[package]]
name = "slab"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
[[package]]
name = "slab"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
[[package]]
name = "smallvec"
version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
dependencies = [
"maybe-uninit",
]
[[package]]
name = "smallvec"
version = "1.4.2"
@ -1616,272 +1722,53 @@ dependencies = [
[[package]]
name = "tls-api"
version = "0.1.22"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "049c03787a0595182357fbd487577947f4351b78ce20c3668f6d49f17feb13d1"
checksum = "4ebb4107c167a4087349fcf08aea4debc358fe69d60fe1df991781842cfe98a3"
dependencies = [
"log 0.4.11",
"log",
"tokio",
]
[[package]]
name = "tls-api-rustls"
version = "0.1.9"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "445f73888f803ef983ae667b3edcffbccdb276373dc2be62ea9e36dfd0bbc5af"
checksum = "17e236b7cea18986a1fd8d3247e8fdb5515ad43d8ab254920cc86f4a160a7910"
dependencies = [
"rustls",
"tls-api",
"tokio",
"webpki",
"webpki-roots",
]
[[package]]
name = "tls-api-stub"
version = "0.1.22"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9a0cc8c149724db9de7d73a0e1bc80b1a74f5394f08c6f301e11f9c35fa061e"
checksum = "6f8ff269def04f25ae84b9aac156a400b92c97018a184036548c91cedaafd783"
dependencies = [
"tls-api",
"tokio",
"void",
]
[[package]]
name = "tokio"
version = "0.1.22"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6"
checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
dependencies = [
"bytes 0.4.12",
"futures",
"mio",
"num_cpus",
"tokio-codec",
"tokio-current-thread",
"tokio-executor",
"tokio-fs",
"tokio-io",
"tokio-reactor",
"tokio-sync",
"tokio-tcp",
"tokio-threadpool",
"tokio-timer 0.2.13",
"tokio-udp",
"tokio-uds 0.2.7",
]
[[package]]
name = "tokio-codec"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b"
dependencies = [
"bytes 0.4.12",
"futures",
"tokio-io",
]
[[package]]
name = "tokio-core"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71"
dependencies = [
"bytes 0.4.12",
"futures",
"bytes",
"iovec",
"log 0.4.11",
"mio",
"scoped-tls",
"tokio",
"tokio-executor",
"tokio-io",
"tokio-reactor",
"tokio-timer 0.2.13",
]
[[package]]
name = "tokio-current-thread"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e"
dependencies = [
"futures",
"tokio-executor",
]
[[package]]
name = "tokio-executor"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671"
dependencies = [
"crossbeam-utils",
"futures",
]
[[package]]
name = "tokio-fs"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4"
dependencies = [
"futures",
"tokio-io",
"tokio-threadpool",
]
[[package]]
name = "tokio-io"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674"
dependencies = [
"bytes 0.4.12",
"futures",
"log 0.4.11",
]
[[package]]
name = "tokio-reactor"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351"
dependencies = [
"crossbeam-utils",
"futures",
"lazy_static",
"log 0.4.11",
"mio",
"num_cpus",
"parking_lot",
"slab 0.4.2",
"tokio-executor",
"tokio-io",
"tokio-sync",
]
[[package]]
name = "tokio-sync"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee"
dependencies = [
"fnv",
"futures",
]
[[package]]
name = "tokio-tcp"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72"
dependencies = [
"bytes 0.4.12",
"futures",
"iovec",
"mio",
"tokio-io",
"tokio-reactor",
]
[[package]]
name = "tokio-threadpool"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89"
dependencies = [
"crossbeam-deque",
"crossbeam-queue",
"crossbeam-utils",
"futures",
"lazy_static",
"log 0.4.11",
"num_cpus",
"slab 0.4.2",
"tokio-executor",
]
[[package]]
name = "tokio-timer"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6131e780037787ff1b3f8aad9da83bca02438b72277850dd6ad0d455e0e20efc"
dependencies = [
"futures",
"slab 0.3.0",
]
[[package]]
name = "tokio-timer"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296"
dependencies = [
"crossbeam-utils",
"futures",
"slab 0.4.2",
"tokio-executor",
]
[[package]]
name = "tokio-tls-api"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68d0e040d5b1f4cfca70ec4f371229886a5de5bb554d272a4a8da73004a7b2c9"
dependencies = [
"futures",
"tls-api",
"tokio-io",
]
[[package]]
name = "tokio-udp"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82"
dependencies = [
"bytes 0.4.12",
"futures",
"log 0.4.11",
"mio",
"tokio-codec",
"tokio-io",
"tokio-reactor",
]
[[package]]
name = "tokio-uds"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65ae5d255ce739e8537221ed2942e0445f4b3b813daebac1c0050ddaaa3587f9"
dependencies = [
"bytes 0.4.12",
"futures",
"iovec",
"libc",
"log 0.3.9",
"memchr",
"mio",
"mio-uds",
"tokio-core",
"tokio-io",
]
[[package]]
name = "tokio-uds"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0"
dependencies = [
"bytes 0.4.12",
"futures",
"iovec",
"libc",
"log 0.4.11",
"mio",
"mio-uds",
"tokio-codec",
"tokio-io",
"tokio-reactor",
"pin-project-lite",
"slab",
]
[[package]]
@ -1965,7 +1852,7 @@ checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68"
dependencies = [
"bumpalo",
"lazy_static",
"log 0.4.11",
"log",
"proc-macro2",
"quote",
"syn",
@ -2023,9 +1910,9 @@ dependencies = [
[[package]]
name = "webpki-roots"
version = "0.20.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f"
checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739"
dependencies = [
"webpki",
]
@ -2095,15 +1982,17 @@ version = "0.0.4"
dependencies = [
"android_logger",
"base58",
"bls12_381",
"bs58",
"failure",
"futures",
"futures 0.3.5",
"grpc",
"grpc-protobuf",
"hdwallet",
"hex 0.3.2",
"httpbis",
"jni",
"log 0.4.11",
"log",
"log-panics",
"protobuf",
"protobuf-codegen-pure",
@ -2149,7 +2038,7 @@ dependencies = [
"group",
"jubjub",
"protobuf",
"rand_core",
"rand_core 0.5.1",
"rusqlite",
"time",
"zcash_client_backend",
@ -2176,9 +2065,9 @@ dependencies = [
"hex 0.4.2",
"jubjub",
"lazy_static",
"log 0.4.11",
"rand",
"rand_core",
"log",
"rand 0.7.3",
"rand_core 0.5.1",
"sha2 0.9.1",
"subtle",
]
@ -2198,6 +2087,6 @@ dependencies = [
"group",
"jubjub",
"lazy_static",
"rand_core",
"rand_core 0.5.1",
"zcash_primitives",
]

View File

@ -21,14 +21,6 @@ zcash_client_sqlite = "0.2"
zcash_primitives = "0.4"
zcash_proofs = "0.4"
# update-sapling-tree dependencies
futures = { version = "0.1", optional = true }
grpc = { version = "0.6", optional = true }
httpbis = { version = "0.7", optional = true }
#protobuf = { version = "2", optional = true }
tls-api = { version = "0.1", optional = true }
tls-api-rustls = { version = "0.1", optional = true }
#### Temporary additions: ####################################
base58 = "0.1.0"
protobuf = "2"
@ -39,6 +31,15 @@ ripemd160 = "0.8.0"
secp256k1 = "0.17.2"
##############################################################
# update-sapling-tree dependencies
bls12_381 = { version = "0.3", optional = true }
futures = { version = "0.3", optional = true }
grpc = { version = "0.8", optional = true }
grpc-protobuf = { version = "0.8", optional = true }
httpbis = { version = "0.9", optional = true }
tls-api = { version = "0.4", optional = true }
tls-api-rustls = { version = "0.4", optional = true }
[build-dependencies]
protobuf-codegen-pure = "2.14"
@ -51,7 +52,7 @@ protobuf-codegen-pure = "2.14"
[features]
mainnet = ["zcash_client_sqlite/mainnet"]
#updater = ["futures", "grpc", "httpbis", "protobuf", "tls-api", "tls-api-rustls"]
updater = ["bls12_381", "futures", "grpc", "grpc-protobuf", "httpbis", "tls-api", "tls-api-rustls"]
[lib]
name = "zcashwalletsdk"

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
// https://github.com/Manishearth/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy)]
#![allow(clippy::all)]
#![cfg_attr(rustfmt, rustfmt_skip)]
@ -19,88 +19,119 @@
#![allow(unused_results)]
// interface
// server interface
pub trait CompactTxStreamer {
fn get_latest_block(&self, o: ::grpc::RequestOptions, p: super::service::ChainSpec) -> ::grpc::SingleResponse<super::service::BlockID>;
fn get_latest_block(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::ChainSpec>, resp: ::grpc::ServerResponseUnarySink<super::service::BlockID>) -> ::grpc::Result<()>;
fn get_block(&self, o: ::grpc::RequestOptions, p: super::service::BlockID) -> ::grpc::SingleResponse<super::compact_formats::CompactBlock>;
fn get_block(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::BlockID>, resp: ::grpc::ServerResponseUnarySink<super::compact_formats::CompactBlock>) -> ::grpc::Result<()>;
fn get_block_range(&self, o: ::grpc::RequestOptions, p: super::service::BlockRange) -> ::grpc::StreamingResponse<super::compact_formats::CompactBlock>;
fn get_block_range(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::BlockRange>, resp: ::grpc::ServerResponseSink<super::compact_formats::CompactBlock>) -> ::grpc::Result<()>;
fn get_transaction(&self, o: ::grpc::RequestOptions, p: super::service::TxFilter) -> ::grpc::SingleResponse<super::service::RawTransaction>;
fn get_transaction(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::TxFilter>, resp: ::grpc::ServerResponseUnarySink<super::service::RawTransaction>) -> ::grpc::Result<()>;
fn send_transaction(&self, o: ::grpc::RequestOptions, p: super::service::RawTransaction) -> ::grpc::SingleResponse<super::service::SendResponse>;
fn send_transaction(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::RawTransaction>, resp: ::grpc::ServerResponseUnarySink<super::service::SendResponse>) -> ::grpc::Result<()>;
fn get_address_txids(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::TransparentAddressBlockFilter>, resp: ::grpc::ServerResponseSink<super::service::RawTransaction>) -> ::grpc::Result<()>;
fn get_lightd_info(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::Empty>, resp: ::grpc::ServerResponseUnarySink<super::service::LightdInfo>) -> ::grpc::Result<()>;
fn ping(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::service::Duration>, resp: ::grpc::ServerResponseUnarySink<super::service::PingResponse>) -> ::grpc::Result<()>;
}
// client
pub struct CompactTxStreamerClient {
grpc_client: ::std::sync::Arc<::grpc::Client>,
method_GetLatestBlock: ::std::sync::Arc<::grpc::rt::MethodDescriptor<super::service::ChainSpec, super::service::BlockID>>,
method_GetBlock: ::std::sync::Arc<::grpc::rt::MethodDescriptor<super::service::BlockID, super::compact_formats::CompactBlock>>,
method_GetBlockRange: ::std::sync::Arc<::grpc::rt::MethodDescriptor<super::service::BlockRange, super::compact_formats::CompactBlock>>,
method_GetTransaction: ::std::sync::Arc<::grpc::rt::MethodDescriptor<super::service::TxFilter, super::service::RawTransaction>>,
method_SendTransaction: ::std::sync::Arc<::grpc::rt::MethodDescriptor<super::service::RawTransaction, super::service::SendResponse>>,
}
impl ::grpc::ClientStub for CompactTxStreamerClient {
fn with_client(grpc_client: ::std::sync::Arc<::grpc::Client>) -> Self {
CompactTxStreamerClient {
grpc_client: grpc_client,
method_GetLatestBlock: ::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock".to_string(),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
}),
method_GetBlock: ::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock".to_string(),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
}),
method_GetBlockRange: ::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange".to_string(),
streaming: ::grpc::rt::GrpcStreaming::ServerStreaming,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
}),
method_GetTransaction: ::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction".to_string(),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
}),
method_SendTransaction: ::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction".to_string(),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
}),
}
}
}
impl CompactTxStreamer for CompactTxStreamerClient {
fn get_latest_block(&self, o: ::grpc::RequestOptions, p: super::service::ChainSpec) -> ::grpc::SingleResponse<super::service::BlockID> {
self.grpc_client.call_unary(o, p, self.method_GetLatestBlock.clone())
impl CompactTxStreamerClient {
pub fn get_latest_block(&self, o: ::grpc::RequestOptions, req: super::service::ChainSpec) -> ::grpc::SingleResponse<super::service::BlockID> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_unary(o, req, descriptor)
}
fn get_block(&self, o: ::grpc::RequestOptions, p: super::service::BlockID) -> ::grpc::SingleResponse<super::compact_formats::CompactBlock> {
self.grpc_client.call_unary(o, p, self.method_GetBlock.clone())
pub fn get_block(&self, o: ::grpc::RequestOptions, req: super::service::BlockID) -> ::grpc::SingleResponse<super::compact_formats::CompactBlock> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_unary(o, req, descriptor)
}
fn get_block_range(&self, o: ::grpc::RequestOptions, p: super::service::BlockRange) -> ::grpc::StreamingResponse<super::compact_formats::CompactBlock> {
self.grpc_client.call_server_streaming(o, p, self.method_GetBlockRange.clone())
pub fn get_block_range(&self, o: ::grpc::RequestOptions, req: super::service::BlockRange) -> ::grpc::StreamingResponse<super::compact_formats::CompactBlock> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange"),
streaming: ::grpc::rt::GrpcStreaming::ServerStreaming,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_server_streaming(o, req, descriptor)
}
fn get_transaction(&self, o: ::grpc::RequestOptions, p: super::service::TxFilter) -> ::grpc::SingleResponse<super::service::RawTransaction> {
self.grpc_client.call_unary(o, p, self.method_GetTransaction.clone())
pub fn get_transaction(&self, o: ::grpc::RequestOptions, req: super::service::TxFilter) -> ::grpc::SingleResponse<super::service::RawTransaction> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_unary(o, req, descriptor)
}
fn send_transaction(&self, o: ::grpc::RequestOptions, p: super::service::RawTransaction) -> ::grpc::SingleResponse<super::service::SendResponse> {
self.grpc_client.call_unary(o, p, self.method_SendTransaction.clone())
pub fn send_transaction(&self, o: ::grpc::RequestOptions, req: super::service::RawTransaction) -> ::grpc::SingleResponse<super::service::SendResponse> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_unary(o, req, descriptor)
}
pub fn get_address_txids(&self, o: ::grpc::RequestOptions, req: super::service::TransparentAddressBlockFilter) -> ::grpc::StreamingResponse<super::service::RawTransaction> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressTxids"),
streaming: ::grpc::rt::GrpcStreaming::ServerStreaming,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_server_streaming(o, req, descriptor)
}
pub fn get_lightd_info(&self, o: ::grpc::RequestOptions, req: super::service::Empty) -> ::grpc::SingleResponse<super::service::LightdInfo> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_unary(o, req, descriptor)
}
pub fn ping(&self, o: ::grpc::RequestOptions, req: super::service::Duration) -> ::grpc::SingleResponse<super::service::PingResponse> {
let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/Ping"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
});
self.grpc_client.call_unary(o, req, descriptor)
}
}
@ -115,63 +146,99 @@ impl CompactTxStreamerServer {
::grpc::rt::ServerServiceDefinition::new("/cash.z.wallet.sdk.rpc.CompactTxStreamer",
vec![
::grpc::rt::ServerMethod::new(
::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock".to_string(),
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerUnary::new(move |o, p| handler_copy.get_latest_block(o, p))
::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).get_latest_block(ctx, req, resp))
},
),
::grpc::rt::ServerMethod::new(
::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock".to_string(),
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerUnary::new(move |o, p| handler_copy.get_block(o, p))
::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).get_block(ctx, req, resp))
},
),
::grpc::rt::ServerMethod::new(
::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange".to_string(),
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange"),
streaming: ::grpc::rt::GrpcStreaming::ServerStreaming,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerServerStreaming::new(move |o, p| handler_copy.get_block_range(o, p))
::grpc::rt::MethodHandlerServerStreaming::new(move |ctx, req, resp| (*handler_copy).get_block_range(ctx, req, resp))
},
),
::grpc::rt::ServerMethod::new(
::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction".to_string(),
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerUnary::new(move |o, p| handler_copy.get_transaction(o, p))
::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).get_transaction(ctx, req, resp))
},
),
::grpc::rt::ServerMethod::new(
::std::sync::Arc::new(::grpc::rt::MethodDescriptor {
name: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction".to_string(),
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
resp_marshaller: Box::new(::grpc::protobuf::MarshallerProtobuf),
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerUnary::new(move |o, p| handler_copy.send_transaction(o, p))
::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).send_transaction(ctx, req, resp))
},
),
::grpc::rt::ServerMethod::new(
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressTxids"),
streaming: ::grpc::rt::GrpcStreaming::ServerStreaming,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerServerStreaming::new(move |ctx, req, resp| (*handler_copy).get_address_txids(ctx, req, resp))
},
),
::grpc::rt::ServerMethod::new(
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).get_lightd_info(ctx, req, resp))
},
),
::grpc::rt::ServerMethod::new(
::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor {
name: ::grpc::rt::StringOrStatic::Static("/cash.z.wallet.sdk.rpc.CompactTxStreamer/Ping"),
streaming: ::grpc::rt::GrpcStreaming::Unary,
req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf),
}),
{
let handler_copy = handler_arc.clone();
::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).ping(ctx, req, resp))
},
),
],

View File

@ -1,32 +1,15 @@
extern crate ff;
extern crate futures;
extern crate grpc;
extern crate hex;
extern crate httpbis;
extern crate pairing;
extern crate protobuf;
extern crate tls_api;
extern crate tls_api_rustls;
extern crate zcash_client_backend;
extern crate zcash_primitives;
mod service;
mod service_grpc;
use ff::{PrimeField, PrimeFieldRepr};
use futures::Stream;
use futures::executor;
use grpc::ClientStub;
use httpbis::ClientTlsOption;
use pairing::bls12_381::{Fr, FrRepr};
use std::env;
use std::net::ToSocketAddrs;
use std::sync::Arc;
use tls_api::{TlsConnector, TlsConnectorBuilder};
use zcash_client_backend::proto::compact_formats;
use zcash_primitives::{merkle_tree::CommitmentTree, sapling::Node};
use service_grpc::CompactTxStreamer;
#[cfg(feature = "mainnet")]
const START_HEIGHT: u64 = 419200;
#[cfg(feature = "mainnet")]
@ -112,15 +95,6 @@ fn main() -> Result<(), Error> {
let mut start_height = START_HEIGHT;
let mut tree = CommitmentTree::new();
// If LIGHTWALLETD_HOST is behind a load balancer which resolves to multiple IP
// addresses, we need to select one ourselves and then use it directly, as a
// workaround for https://github.com/stepancheg/rust-http2/issues/7
let socket = (LIGHTWALLETD_HOST, LIGHTWALLETD_PORT)
.to_socket_addrs()?
.into_iter()
.next()
.expect("LIGHTWALLETD_HOST can be resolved");
let tls = {
let mut tls_connector = tls_api_rustls::TlsConnector::builder()?;
@ -134,14 +108,10 @@ fn main() -> Result<(), Error> {
ClientTlsOption::Tls(LIGHTWALLETD_HOST.to_owned(), tls_connector)
};
let client_conf = Default::default();
let client = grpc::Client::new_expl::<tls_api_rustls::TlsConnector>(
&socket,
LIGHTWALLETD_HOST,
tls,
client_conf,
)
.map(|c| service_grpc::CompactTxStreamerClient::with_client(Arc::new(c)))?;
let client = grpc::ClientBuilder::new(LIGHTWALLETD_HOST, LIGHTWALLETD_PORT)
.explicit_tls(tls)
.build()
.map(|c| service_grpc::CompactTxStreamerClient::with_client(Arc::new(c)))?;
loop {
// Get the latest height
@ -161,10 +131,11 @@ fn main() -> Result<(), Error> {
let mut range = service::BlockRange::new();
range.set_start(start);
range.set_end(end);
let blocks = client
.get_block_range(grpc::RequestOptions::new(), range)
.drop_metadata()
.wait();
let blocks = executor::block_on_stream(
client
.get_block_range(grpc::RequestOptions::new(), range)
.drop_metadata(),
);
let mut end_hash = vec![];
let mut end_time = 0;
@ -176,10 +147,11 @@ fn main() -> Result<(), Error> {
for tx in block.vtx.iter() {
for output in tx.outputs.iter() {
// Append commitment to tree
let mut repr = FrRepr::default();
repr.read_le(&output.cmu[..])?;
let cmu = Fr::from_repr(repr).map_err(|_| Error::InvalidBlock)?;
let node = Node::new(cmu.into_repr());
let mut repr = [0u8; 32];
repr.copy_from_slice(&output.cmu[..]);
let cmu: bls12_381::Scalar = Option::from(bls12_381::Scalar::from_bytes(&repr))
.ok_or(Error::InvalidBlock)?;
let node = Node::new(cmu.to_bytes());
tree.append(node).expect("tree is not full");
}
}