POC: prove the concept of local RPC via protobufs.

This is an example of a jni call that accepts and returns proto objects. Ultimately, this trades a minor amount of performance for a significant improvement of ease of use. By exchanging protocol buffers, the Kotlin and Rust layers are able to communicate using far more complex objects. Eventually, this type of approach might completely replace the use of a database or sqlite.
This commit is contained in:
Kevin Gorham 2020-08-13 21:03:19 -04:00
parent 4707e97bfd
commit 01efabe195
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
7 changed files with 1233 additions and 103 deletions

331
Cargo.lock generated
View File

@ -100,6 +100,11 @@ dependencies = [
"rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "base58"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "base64"
version = "0.9.3"
@ -111,11 +116,8 @@ dependencies = [
[[package]]
name = "base64"
version = "0.10.1"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bech32"
@ -125,18 +127,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bellman"
version = "0.6.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"blake2s_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"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)",
"group 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"group 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"subtle 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -206,6 +208,11 @@ dependencies = [
"sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bumpalo"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "byte-tools"
version = "0.3.1"
@ -232,7 +239,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cc"
version = "1.0.58"
version = "1.0.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -260,7 +267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ascii 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"either 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -368,13 +375,13 @@ dependencies = [
[[package]]
name = "either"
version = "1.5.3"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "equihash"
version = "0.1.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -382,7 +389,7 @@ dependencies = [
[[package]]
name = "error-chain"
version = "0.12.2"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -404,7 +411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -426,10 +433,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ff"
version = "0.6.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ff_derive 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff_derive 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"subtle 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -437,7 +444,7 @@ dependencies = [
[[package]]
name = "ff_derive"
version = "0.6.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"addchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -445,7 +452,7 @@ dependencies = [
"num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -519,10 +526,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "group"
version = "0.6.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"subtle 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -547,6 +554,17 @@ dependencies = [
"tokio-tls-api 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "hdwallet"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ring 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)",
"secp256k1 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "hermit-abi"
version = "0.1.15"
@ -596,7 +614,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cesu8 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"combine 3.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)",
"jni-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -607,6 +625,14 @@ name = "jni-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "js-sys"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
@ -631,7 +657,7 @@ name = "libsqlite3-sys"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -805,11 +831,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pairing"
version = "0.16.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"group 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"group 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"subtle 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -941,17 +967,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ring"
version = "0.14.6"
version = "0.16.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.74 (registry+https://github.com/rust-lang/crates.io-index)",
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"web-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ripemd160"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rusqlite"
version = "0.23.1"
@ -963,7 +1000,7 @@ dependencies = [
"libsqlite3-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -982,15 +1019,14 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.15.2"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)",
"sct 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ring 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)",
"sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1018,11 +1054,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "sct"
version = "0.5.0"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ring 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "secp256k1"
version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"secp256k1-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "secp256k1-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1069,7 +1121,7 @@ dependencies = [
[[package]]
name = "smallvec"
version = "1.4.1"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -1084,7 +1136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "1.0.36"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1099,7 +1151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1122,13 +1174,13 @@ dependencies = [
[[package]]
name = "tls-api-rustls"
version = "0.1.22"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustls 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustls 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tls-api 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki-roots 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki-roots 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1391,7 +1443,7 @@ dependencies = [
[[package]]
name = "untrusted"
version = "0.6.2"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -1425,21 +1477,78 @@ version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "webpki"
version = "0.19.1"
name = "wasm-bindgen"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-macro 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bumpalo 3.4.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.11 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-macro-support 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-backend 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "web-sys"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"js-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "webpki"
version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ring 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "webpki-roots"
version = "0.16.0"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1493,75 +1602,82 @@ name = "zcash-android-wallet-sdk"
version = "0.0.4"
dependencies = [
"android_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bs58 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
"grpc 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hdwallet 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"httpbis 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"jni 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log-panics 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf-codegen-pure 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ripemd160 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"secp256k1 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tls-api 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
"tls-api-rustls 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_client_backend 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"zcash_client_sqlite 0.0.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"zcash_proofs 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"tls-api-rustls 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_client_backend 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"zcash_client_sqlite 0.0.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"zcash_proofs 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
]
[[package]]
name = "zcash_client_backend"
version = "0.2.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"bech32 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bs58 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf-codegen-pure 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"subtle 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
]
[[package]]
name = "zcash_client_sqlite"
version = "0.0.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"bech32 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bs58 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rusqlite 0.23.1 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_client_backend 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"zcash_client_backend 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
]
[[package]]
name = "zcash_primitives"
version = "0.2.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"aes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"blake2s_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"crypto_api_chachapoly 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"equihash 0.1.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"equihash 0.1.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"fpe 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hex 0.3.2 (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.11 (registry+https://github.com/rust-lang/crates.io-index)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1571,16 +1687,16 @@ dependencies = [
[[package]]
name = "zcash_proofs"
version = "0.2.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942#f55f094ef69c2caeaa941bcf851dac8cb5fa9942"
source = "git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296#18b1ce7401184e86031e6d7ddefa7c8d36929296"
dependencies = [
"bellman 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"bellman 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)",
"zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)",
]
[metadata]
@ -1597,10 +1713,11 @@ dependencies = [
"checksum ascii 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
"checksum backtrace 0.3.50 (registry+https://github.com/rust-lang/crates.io-index)" = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293"
"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
"checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83"
"checksum base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
"checksum bech32 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cdcf67bb7ba7797a081cd19009948ab533af7c355d5caf1d08c777582d351e9c"
"checksum bellman 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum bellman 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f"
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
@ -1609,11 +1726,12 @@ dependencies = [
"checksum block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774"
"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
"checksum bs58 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb"
"checksum bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"
"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c"
"checksum bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
"checksum cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"
"checksum cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "8dae9c4b8fedcae85592ba623c4fd08cfdab3e3b72d6df780c6ead964a69bfff"
"checksum cesu8 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
@ -1629,16 +1747,16 @@ dependencies = [
"checksum crypto_api_chachapoly 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "95b2ad7cab08fd71addba81df5077c49df208effdfb3118a1519f9cdeac5aaf2"
"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
"checksum directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72d337a64190607d4fcca2cb78982c5dd57f4916e19696b48a575fa746b6cb0f"
"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
"checksum equihash 0.1.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd"
"checksum either 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f"
"checksum equihash 0.1.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum error-chain 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc"
"checksum failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
"checksum failure_derive 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
"checksum fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
"checksum fallible-streaming-iterator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
"checksum ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum ff_derive 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum ff 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum ff_derive 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
"checksum fpe 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "21988a326139165b75e3196bc6962ca638e5fb0c95102fbf152a3743174b01e4"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
@ -1648,14 +1766,16 @@ dependencies = [
"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
"checksum gimli 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
"checksum group 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum group 0.6.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum grpc 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8e530ef7894a104a1c8525ce68787b3491efa2098ce5e5454e8324ea78893548"
"checksum hdwallet 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "35b15cc3c181a2aace485d56c784568a4ae6e34322287a2499549d4cda7af3e1"
"checksum hermit-abi 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
"checksum httpbis 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7689cfa896b2a71da4f16206af167542b75d242b6906313e53857972a92d5614"
"checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
"checksum jni 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e00f1fd30a82a801f8bf38bcb0895088a0013cde111acb713c0824edc372aa4"
"checksum jni-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
"checksum js-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)" = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum libc 0.2.74 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10"
@ -1680,7 +1800,7 @@ dependencies = [
"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
"checksum object 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
"checksum pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum pairing 0.16.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"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 pkg-config 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
@ -1696,30 +1816,33 @@ dependencies = [
"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
"checksum rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
"checksum redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)" = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
"checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c"
"checksum ring 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1ba5a8ec64ee89a76c98c549af81ff14813df09c3e6dc4766c3856da48597a0c"
"checksum ripemd160 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a"
"checksum rusqlite 0.23.1 (registry+https://github.com/rust-lang/crates.io-index)" = "45d0fd62e1df63d254714e6cb40d0a0e82e7a1623e7a27f679d851af092ae58b"
"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
"checksum rustls 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f271e3552cd835fa28c541c34a7e8fdd8cdff09d77fe4eb8f6c42e87a11b096e"
"checksum rustls 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac94b333ee2aac3284c5b8a1b7fb4dd11cba88c244e3fe33cdbd047af0eb693"
"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
"checksum sct 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f5adf8fbd58e1b1b52699dc8bed2630faecb6d8c7bee77d009d6bbe4af569b9"
"checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c"
"checksum secp256k1 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2932dc07acd2066ff2e3921a4419606b220ba6cd03a9935123856cc534877056"
"checksum secp256k1-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ab2c26f0d3552a0f12e639ae8a64afc2e3db9c52fe32f5fc6c289d38519f220"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
"checksum smallvec 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f"
"checksum smallvec 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
"checksum subtle 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1"
"checksum syn 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)" = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250"
"checksum syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4"
"checksum synstructure 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
"checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
"checksum tls-api 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "049c03787a0595182357fbd487577947f4351b78ce20c3668f6d49f17feb13d1"
"checksum tls-api-rustls 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "170e842eb3737569f46972898d82f69755cf983b61fb706ea3cf0f4a2b67bc09"
"checksum tls-api-rustls 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "445f73888f803ef983ae667b3edcffbccdb276373dc2be62ea9e36dfd0bbc5af"
"checksum tls-api-stub 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "c9a0cc8c149724db9de7d73a0e1bc80b1a74f5394f08c6f301e11f9c35fa061e"
"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6"
"checksum tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b"
@ -1742,14 +1865,20 @@ dependencies = [
"checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
"checksum unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f"
"checksum untrusted 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
"checksum vcpkg 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
"checksum version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
"checksum webpki 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4f7e1cd7900a3a6b65a3e8780c51a3e6b59c0e2c55c6dc69578c288d69f7d082"
"checksum webpki-roots 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c10fa4212003ba19a564f25cd8ab572c6791f99a03cc219c13ed35ccab00de0e"
"checksum wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c"
"checksum wasm-bindgen-backend 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0"
"checksum wasm-bindgen-macro 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2"
"checksum wasm-bindgen-macro-support 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556"
"checksum wasm-bindgen-shared 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092"
"checksum web-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)" = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47"
"checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef"
"checksum webpki-roots 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
@ -1757,7 +1886,7 @@ dependencies = [
"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
"checksum zcash_client_backend 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum zcash_client_sqlite 0.0.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum zcash_proofs 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=f55f094ef69c2caeaa941bcf851dac8cb5fa9942)" = "<none>"
"checksum zcash_client_backend 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum zcash_client_sqlite 0.0.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum zcash_primitives 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"
"checksum zcash_proofs 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=18b1ce7401184e86031e6d7ddefa7c8d36929296)" = "<none>"

View File

@ -19,10 +19,21 @@ httpbis = { version = "0.7", optional = true }
jni = { version = "0.13", default-features = false }
log = "0.4"
log-panics = "2.0.0"
protobuf = { version = "2", 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"
sha2 = "0.8.0"
bs58 = { version = "0.3", features = ["check"] }
hdwallet = "0.2.2"
ripemd160 = "0.8.0"
secp256k1 = "0.17.2"
##############################################################
[dependencies.ff]
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
@ -47,6 +58,9 @@ rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
git = "https://github.com/zcash/librustzcash.git"
rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[build-dependencies]
protobuf-codegen-pure = "2.14"
#[patch.'https://github.com/zcash/librustzcash.git']
#ff = { path = '../../clones/librustzcash/ff' }
#pairing = { path = '../../clones/librustzcash/pairing' }
@ -57,7 +71,7 @@ rev = "18b1ce7401184e86031e6d7ddefa7c8d36929296"
[features]
mainnet = ["zcash_client_sqlite/mainnet"]
updater = ["futures", "grpc", "httpbis", "protobuf", "tls-api", "tls-api-rustls"]
#updater = ["futures", "grpc", "httpbis", "protobuf", "tls-api", "tls-api-rustls"]
[lib]
name = "zcashwalletsdk"

View File

@ -4,6 +4,7 @@ import cash.z.ecc.android.sdk.exception.BirthdayException
import cash.z.ecc.android.sdk.ext.ZcashSdk.OUTPUT_PARAM_FILE_NAME
import cash.z.ecc.android.sdk.ext.ZcashSdk.SPEND_PARAM_FILE_NAME
import cash.z.ecc.android.sdk.ext.twig
import cash.z.ecc.android.sdk.rpc.LocalRpcTypes
import java.io.File
/**
@ -125,6 +126,9 @@ class RustBackend : RustBackendWelding {
override fun deriveSpendingKeys(seed: ByteArray, numberOfAccounts: Int) =
deriveExtendedSpendingKeys(seed, numberOfAccounts)
override fun deriveTAddress(seed: ByteArray): String = deriveTransparentAddress(seed)
override fun deriveViewingKeys(seed: ByteArray, numberOfAccounts: Int) =
deriveExtendedFullViewingKeys(seed, numberOfAccounts)
@ -141,6 +145,25 @@ class RustBackend : RustBackendWelding {
override fun getBranchIdForHeight(height: Int): Long = branchIdForHeight(height)
/**
* This is a proof-of-concept for doing Local RPC, where we are effectively using the JNI
* boundary as a grpc server. It is slightly inefficient in terms of both space and time but
* given that it is all done locally, on the heap, it seems to be a worthwhile tradeoff because
* it reduces the complexity and expands the capacity for the two layers to communicate.
*
* We're able to keep the "unsafe" byteArray functions private and wrap them in typeSafe
* equivalents and, eventually, surface any parse errors (for now, errors are only logged).
*/
override fun parseTransactionDataList(tdl: LocalRpcTypes.TransactionDataList): LocalRpcTypes.TransparentTransactionList {
return try {
// serialize the list, send it over to rust and get back a serialized set of results that we parse out and return
return LocalRpcTypes.TransparentTransactionList.parseFrom(parseTransactionDataList(tdl.toByteArray()))
} catch (t: Throwable) {
twig("ERROR: failed to parse transaction data list due to: $t caused by: ${t.cause}")
LocalRpcTypes.TransparentTransactionList.newBuilder().build()
}
}
/**
* Exposes all of the librustzcash functions along with helpers for loading the static library.
*/
@ -246,5 +269,9 @@ class RustBackend : RustBackendWelding {
@JvmStatic private external fun deriveAddressFromViewingKey(key: String): String
@JvmStatic private external fun branchIdForHeight(height: Int): Long
@JvmStatic private external fun parseTransactionDataList(serializedList: ByteArray): ByteArray
@JvmStatic private external fun deriveTransparentAddress(seed: ByteArray): String
}
}

View File

@ -1,5 +1,7 @@
package cash.z.ecc.android.sdk.jni
import cash.z.ecc.android.sdk.rpc.LocalRpcTypes
/**
* Contract defining the exposed capabilities of the Rust backend.
* This is what welds the SDK to the Rust layer.
@ -23,6 +25,8 @@ interface RustBackendWelding {
fun deriveSpendingKeys(seed: ByteArray, numberOfAccounts: Int = 1): Array<String>
fun deriveTAddress(seed: ByteArray): String
fun deriveViewingKey(spendingKey: String): String
fun deriveViewingKeys(seed: ByteArray, numberOfAccounts: Int = 1): Array<String>
@ -53,6 +57,8 @@ interface RustBackendWelding {
fun getVerifiedBalance(account: Int = 0): Long
fun parseTransactionDataList(tdl: LocalRpcTypes.TransactionDataList): LocalRpcTypes.TransparentTransactionList
fun rewindToHeight(height: Int): Boolean
fun scanBlocks(limit: Int = -1): Boolean

View File

@ -0,0 +1,22 @@
syntax = "proto3";
package cash.z.ecc.android.sdk.rpc;
option go_package = "walletrpc";
message TransactionDataList {
repeated bytes data = 1;
}
message TransparentTransactionList {
repeated TransparentTransaction transactions = 1;
}
message TransparentTransaction {
uint32 protoVersion = 1; // the version of this wire format, for storage
uint32 expiryHeight = 2;
bool hasShieldedOutputs = 3;
bool hasShieldedSpends = 4;
uint32 height = 5;
int64 value = 6;
string toAddress = 7;
string fromAddress = 8;
}

View File

@ -63,6 +63,27 @@ use zcash_client_backend::constants::testnet::{
HRP_SAPLING_PAYMENT_ADDRESS,
};
// /////////////////////////////////////////////////////////////////////////////////////////////////
// Temporary Imports
mod local_rpc_types;
use local_rpc_types::{TransparentTransaction, TransparentTransactionList, TransactionDataList};
use base58::{ToBase58};
use jni::errors::{Result as JniResult};
use protobuf::{parse_from_bytes, Message};
use sha2::{Sha256, Digest};
use zcash_client_backend::{
constants::{testnet, mainnet},
};
use zcash_primitives::legacy::{Script, TransparentAddress};
use bs58::{self, decode::Error as Bs58Error};
use hdwallet::{ExtendedPrivKey, KeyIndex};
use secp256k1::{PublicKey, Secp256k1, SecretKey, SignOnly, VerifyOnly};
use zcash_client_backend::constants::mainnet::B58_PUBKEY_ADDRESS_PREFIX;
// use crate::extended_key::{key_index::KeyIndex, ExtendedPrivKey, ExtendedPubKey, KeySeed};
// /////////////////////////////////////////////////////////////////////////////////////////////////
#[cfg(debug_assertions)]
fn print_debug_state() {
debug!("WARNING! Debugging enabled! This will likely slow things down 10X!");
@ -591,6 +612,84 @@ pub unsafe extern "C" fn Java_cash_z_ecc_android_sdk_jni_RustBackend_scanBlockBa
unwrap_exc_or(&env, res, JNI_FALSE)
}
// ////////////////////////////////////////////////////////////////////////////////////////////////
// PROOF-OF-CONCEPT FOR PROTOBUF COMMUNICATION WITH SDK
// ////////////////////////////////////////////////////////////////////////////////////////////////
#[no_mangle]
pub unsafe extern "C" fn Java_cash_z_ecc_android_sdk_jni_RustBackend_parseTransactionDataList(
env: JNIEnv<'_>,
_: JClass<'_>,
tx_data_list: jbyteArray,
) -> jbyteArray {
let mut err_val: Vec<u8> = Vec::new();
let mut res_err = env.byte_array_from_slice(&err_val).unwrap();
let res = panic::catch_unwind(|| {
let tx_data_bytes = env.convert_byte_array(tx_data_list)?;
let input_tx_data = parse_from_bytes::<TransactionDataList>(&tx_data_bytes)?;
let mut tx_list = TransparentTransactionList::new();
let mut txs = protobuf::RepeatedField::<TransparentTransaction>::new();
for data in input_tx_data.data.iter() {
let mut tx = TransparentTransaction::new();
let parsed = Transaction::read(&data[..])?;
tx.set_expiryHeight(parsed.expiry_height);
// Note: the wrong value is returned here (negative numbers)
tx.set_value(i64::from(parsed.value_balance));
tx.set_hasShieldedSpends(parsed.shielded_spends.len() > 0);
tx.set_hasShieldedOutputs(parsed.shielded_outputs.len() > 0);
for (n, vout) in parsed.vout.iter().enumerate() {
match vout.script_pubkey.address() {
// NOTE : this logic below doesn't work. No address is parsed.
Some(TransparentAddress::PublicKey(hash)) => {
tx.set_toAddress(hash.to_base58check(&B58_PUBKEY_ADDRESS_PREFIX, &[]));
},
_ => {}
}
}
txs.push(tx);
}
tx_list.set_transactions(txs);
match env.byte_array_from_slice(&tx_list.write_to_bytes()?) {
Ok(result) => Ok(result),
Err(e) => Err(format_err!("Error while parsing transaction: {}", e)),
}
});
unwrap_exc_or(&env, res, res_err)
}
#[no_mangle]
pub unsafe extern "C" fn Java_cash_z_ecc_android_sdk_jni_RustBackend_deriveTransparentAddress(
env: JNIEnv<'_>,
_: JClass<'_>,
seed: jbyteArray,
) -> jstring {
let res = panic::catch_unwind(|| {
let seed = env.convert_byte_array(seed).unwrap();
// modified from: https://github.com/adityapk00/zecwallet-light-cli/blob/master/lib/src/lightwallet.rs
let ext_t_key = ExtendedPrivKey::with_seed(&seed).unwrap();
let address_sk = ext_t_key
.derive_private_key(KeyIndex::hardened_from_normalize_index(44).unwrap()).unwrap()
.derive_private_key(KeyIndex::hardened_from_normalize_index(COIN_TYPE).unwrap()).unwrap()
.derive_private_key(KeyIndex::hardened_from_normalize_index(0).unwrap()).unwrap()
.derive_private_key(KeyIndex::Normal(0)).unwrap()
.derive_private_key(KeyIndex::Normal(0)).unwrap()
.private_key;
let secp = Secp256k1::new();
let pk = PublicKey::from_secret_key(&secp, &address_sk);
let mut hash160 = ripemd160::Ripemd160::new();
hash160.input(Sha256::digest(&pk.serialize()[..].to_vec()));
let address_string = hash160.result().to_base58check(&B58_PUBKEY_ADDRESS_PREFIX, &[]);
let output = env.new_string(address_string).expect("Couldn't create Java string!");
Ok(output.into_inner())
});
unwrap_exc_or(&env, res, ptr::null_mut())
}
#[no_mangle]
pub unsafe extern "C" fn Java_cash_z_ecc_android_sdk_jni_RustBackend_decryptAndStoreTransaction(
env: JNIEnv<'_>,
@ -701,3 +800,35 @@ pub unsafe extern "C" fn Java_cash_z_ecc_android_sdk_jni_RustBackend_branchIdFor
});
unwrap_exc_or(&env, res, -1)
}
//
// Helper code from: https://github.com/adityapk00/zecwallet-light-cli/blob/master/lib/src/lightwallet.rs
//
/// A trait for converting a [u8] to base58 encoded string.
pub trait ToBase58Check {
/// Converts a value of `self` to a base58 value, returning the owned string.
/// The version is a coin-specific prefix that is added.
/// The suffix is any bytes that we want to add at the end (like the "iscompressed" flag for
/// Secret key encoding)
fn to_base58check(&self, version: &[u8], suffix: &[u8]) -> String;
}
impl ToBase58Check for [u8] {
fn to_base58check(&self, version: &[u8], suffix: &[u8]) -> String {
let mut payload: Vec<u8> = Vec::new();
payload.extend_from_slice(version);
payload.extend_from_slice(self);
payload.extend_from_slice(suffix);
let mut checksum = double_sha256(&payload);
payload.append(&mut checksum[..4].to_vec());
payload.to_base58()
}
}
pub fn double_sha256(payload: &[u8]) -> Vec<u8> {
let h1 = Sha256::digest(&payload);
let h2 = Sha256::digest(&h1);
h2.to_vec()
}

View File

@ -0,0 +1,801 @@
// This file is generated by rust-protobuf 2.14.0. Do not edit
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unsafe_code)]
#![allow(unused_imports)]
#![allow(unused_results)]
//! Generated file from `local_rpc_types.proto`
use protobuf::Message as Message_imported_for_functions;
use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
/// Generated files are compatible only with the same version
/// of protobuf runtime.
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_14_0;
#[derive(PartialEq,Clone,Default)]
pub struct TransactionDataList {
// message fields
pub data: ::protobuf::RepeatedField<::std::vec::Vec<u8>>,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a TransactionDataList {
fn default() -> &'a TransactionDataList {
<TransactionDataList as ::protobuf::Message>::default_instance()
}
}
impl TransactionDataList {
pub fn new() -> TransactionDataList {
::std::default::Default::default()
}
// repeated bytes data = 1;
pub fn get_data(&self) -> &[::std::vec::Vec<u8>] {
&self.data
}
pub fn clear_data(&mut self) {
self.data.clear();
}
// Param is passed by value, moved
pub fn set_data(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec<u8>>) {
self.data = v;
}
// Mutable pointer to the field.
pub fn mut_data(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
&mut self.data
}
// Take field
pub fn take_data(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
::std::mem::replace(&mut self.data, ::protobuf::RepeatedField::new())
}
}
impl ::protobuf::Message for TransactionDataList {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.data)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
for value in &self.data {
my_size += ::protobuf::rt::bytes_size(1, &value);
};
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
for v in &self.data {
os.write_bytes(1, &v)?;
};
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> TransactionDataList {
TransactionDataList::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"data",
|m: &TransactionDataList| { &m.data },
|m: &mut TransactionDataList| { &mut m.data },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransactionDataList>(
"TransactionDataList",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static TransactionDataList {
static mut instance: ::protobuf::lazy::Lazy<TransactionDataList> = ::protobuf::lazy::Lazy::INIT;
unsafe {
instance.get(TransactionDataList::new)
}
}
}
impl ::protobuf::Clear for TransactionDataList {
fn clear(&mut self) {
self.data.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for TransactionDataList {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for TransactionDataList {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct TransparentTransactionList {
// message fields
pub transactions: ::protobuf::RepeatedField<TransparentTransaction>,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a TransparentTransactionList {
fn default() -> &'a TransparentTransactionList {
<TransparentTransactionList as ::protobuf::Message>::default_instance()
}
}
impl TransparentTransactionList {
pub fn new() -> TransparentTransactionList {
::std::default::Default::default()
}
// repeated .cash.z.ecc.android.sdk.rpc.TransparentTransaction transactions = 1;
pub fn get_transactions(&self) -> &[TransparentTransaction] {
&self.transactions
}
pub fn clear_transactions(&mut self) {
self.transactions.clear();
}
// Param is passed by value, moved
pub fn set_transactions(&mut self, v: ::protobuf::RepeatedField<TransparentTransaction>) {
self.transactions = v;
}
// Mutable pointer to the field.
pub fn mut_transactions(&mut self) -> &mut ::protobuf::RepeatedField<TransparentTransaction> {
&mut self.transactions
}
// Take field
pub fn take_transactions(&mut self) -> ::protobuf::RepeatedField<TransparentTransaction> {
::std::mem::replace(&mut self.transactions, ::protobuf::RepeatedField::new())
}
}
impl ::protobuf::Message for TransparentTransactionList {
fn is_initialized(&self) -> bool {
for v in &self.transactions {
if !v.is_initialized() {
return false;
}
};
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.transactions)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
for value in &self.transactions {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
};
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
for v in &self.transactions {
os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
};
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> TransparentTransactionList {
TransparentTransactionList::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TransparentTransaction>>(
"transactions",
|m: &TransparentTransactionList| { &m.transactions },
|m: &mut TransparentTransactionList| { &mut m.transactions },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransparentTransactionList>(
"TransparentTransactionList",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static TransparentTransactionList {
static mut instance: ::protobuf::lazy::Lazy<TransparentTransactionList> = ::protobuf::lazy::Lazy::INIT;
unsafe {
instance.get(TransparentTransactionList::new)
}
}
}
impl ::protobuf::Clear for TransparentTransactionList {
fn clear(&mut self) {
self.transactions.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for TransparentTransactionList {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for TransparentTransactionList {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct TransparentTransaction {
// message fields
pub protoVersion: u32,
pub expiryHeight: u32,
pub hasShieldedOutputs: bool,
pub hasShieldedSpends: bool,
pub height: u32,
pub value: i64,
pub toAddress: ::std::string::String,
pub fromAddress: ::std::string::String,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a TransparentTransaction {
fn default() -> &'a TransparentTransaction {
<TransparentTransaction as ::protobuf::Message>::default_instance()
}
}
impl TransparentTransaction {
pub fn new() -> TransparentTransaction {
::std::default::Default::default()
}
// uint32 protoVersion = 1;
pub fn get_protoVersion(&self) -> u32 {
self.protoVersion
}
pub fn clear_protoVersion(&mut self) {
self.protoVersion = 0;
}
// Param is passed by value, moved
pub fn set_protoVersion(&mut self, v: u32) {
self.protoVersion = v;
}
// uint32 expiryHeight = 2;
pub fn get_expiryHeight(&self) -> u32 {
self.expiryHeight
}
pub fn clear_expiryHeight(&mut self) {
self.expiryHeight = 0;
}
// Param is passed by value, moved
pub fn set_expiryHeight(&mut self, v: u32) {
self.expiryHeight = v;
}
// bool hasShieldedOutputs = 3;
pub fn get_hasShieldedOutputs(&self) -> bool {
self.hasShieldedOutputs
}
pub fn clear_hasShieldedOutputs(&mut self) {
self.hasShieldedOutputs = false;
}
// Param is passed by value, moved
pub fn set_hasShieldedOutputs(&mut self, v: bool) {
self.hasShieldedOutputs = v;
}
// bool hasShieldedSpends = 4;
pub fn get_hasShieldedSpends(&self) -> bool {
self.hasShieldedSpends
}
pub fn clear_hasShieldedSpends(&mut self) {
self.hasShieldedSpends = false;
}
// Param is passed by value, moved
pub fn set_hasShieldedSpends(&mut self, v: bool) {
self.hasShieldedSpends = v;
}
// uint32 height = 5;
pub fn get_height(&self) -> u32 {
self.height
}
pub fn clear_height(&mut self) {
self.height = 0;
}
// Param is passed by value, moved
pub fn set_height(&mut self, v: u32) {
self.height = v;
}
// int64 value = 6;
pub fn get_value(&self) -> i64 {
self.value
}
pub fn clear_value(&mut self) {
self.value = 0;
}
// Param is passed by value, moved
pub fn set_value(&mut self, v: i64) {
self.value = v;
}
// string toAddress = 7;
pub fn get_toAddress(&self) -> &str {
&self.toAddress
}
pub fn clear_toAddress(&mut self) {
self.toAddress.clear();
}
// Param is passed by value, moved
pub fn set_toAddress(&mut self, v: ::std::string::String) {
self.toAddress = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_toAddress(&mut self) -> &mut ::std::string::String {
&mut self.toAddress
}
// Take field
pub fn take_toAddress(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.toAddress, ::std::string::String::new())
}
// string fromAddress = 8;
pub fn get_fromAddress(&self) -> &str {
&self.fromAddress
}
pub fn clear_fromAddress(&mut self) {
self.fromAddress.clear();
}
// Param is passed by value, moved
pub fn set_fromAddress(&mut self, v: ::std::string::String) {
self.fromAddress = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_fromAddress(&mut self) -> &mut ::std::string::String {
&mut self.fromAddress
}
// Take field
pub fn take_fromAddress(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.fromAddress, ::std::string::String::new())
}
}
impl ::protobuf::Message for TransparentTransaction {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint32()?;
self.protoVersion = tmp;
},
2 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint32()?;
self.expiryHeight = tmp;
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_bool()?;
self.hasShieldedOutputs = tmp;
},
4 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_bool()?;
self.hasShieldedSpends = tmp;
},
5 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint32()?;
self.height = tmp;
},
6 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int64()?;
self.value = tmp;
},
7 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.toAddress)?;
},
8 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.fromAddress)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if self.protoVersion != 0 {
my_size += ::protobuf::rt::value_size(1, self.protoVersion, ::protobuf::wire_format::WireTypeVarint);
}
if self.expiryHeight != 0 {
my_size += ::protobuf::rt::value_size(2, self.expiryHeight, ::protobuf::wire_format::WireTypeVarint);
}
if self.hasShieldedOutputs != false {
my_size += 2;
}
if self.hasShieldedSpends != false {
my_size += 2;
}
if self.height != 0 {
my_size += ::protobuf::rt::value_size(5, self.height, ::protobuf::wire_format::WireTypeVarint);
}
if self.value != 0 {
my_size += ::protobuf::rt::value_size(6, self.value, ::protobuf::wire_format::WireTypeVarint);
}
if !self.toAddress.is_empty() {
my_size += ::protobuf::rt::string_size(7, &self.toAddress);
}
if !self.fromAddress.is_empty() {
my_size += ::protobuf::rt::string_size(8, &self.fromAddress);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if self.protoVersion != 0 {
os.write_uint32(1, self.protoVersion)?;
}
if self.expiryHeight != 0 {
os.write_uint32(2, self.expiryHeight)?;
}
if self.hasShieldedOutputs != false {
os.write_bool(3, self.hasShieldedOutputs)?;
}
if self.hasShieldedSpends != false {
os.write_bool(4, self.hasShieldedSpends)?;
}
if self.height != 0 {
os.write_uint32(5, self.height)?;
}
if self.value != 0 {
os.write_int64(6, self.value)?;
}
if !self.toAddress.is_empty() {
os.write_string(7, &self.toAddress)?;
}
if !self.fromAddress.is_empty() {
os.write_string(8, &self.fromAddress)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> TransparentTransaction {
TransparentTransaction::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"protoVersion",
|m: &TransparentTransaction| { &m.protoVersion },
|m: &mut TransparentTransaction| { &mut m.protoVersion },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"expiryHeight",
|m: &TransparentTransaction| { &m.expiryHeight },
|m: &mut TransparentTransaction| { &mut m.expiryHeight },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hasShieldedOutputs",
|m: &TransparentTransaction| { &m.hasShieldedOutputs },
|m: &mut TransparentTransaction| { &mut m.hasShieldedOutputs },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hasShieldedSpends",
|m: &TransparentTransaction| { &m.hasShieldedSpends },
|m: &mut TransparentTransaction| { &mut m.hasShieldedSpends },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"height",
|m: &TransparentTransaction| { &m.height },
|m: &mut TransparentTransaction| { &mut m.height },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"value",
|m: &TransparentTransaction| { &m.value },
|m: &mut TransparentTransaction| { &mut m.value },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"toAddress",
|m: &TransparentTransaction| { &m.toAddress },
|m: &mut TransparentTransaction| { &mut m.toAddress },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"fromAddress",
|m: &TransparentTransaction| { &m.fromAddress },
|m: &mut TransparentTransaction| { &mut m.fromAddress },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TransparentTransaction>(
"TransparentTransaction",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static TransparentTransaction {
static mut instance: ::protobuf::lazy::Lazy<TransparentTransaction> = ::protobuf::lazy::Lazy::INIT;
unsafe {
instance.get(TransparentTransaction::new)
}
}
}
impl ::protobuf::Clear for TransparentTransaction {
fn clear(&mut self) {
self.protoVersion = 0;
self.expiryHeight = 0;
self.hasShieldedOutputs = false;
self.hasShieldedSpends = false;
self.height = 0;
self.value = 0;
self.toAddress.clear();
self.fromAddress.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for TransparentTransaction {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for TransparentTransaction {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x15local_rpc_types.proto\x12\x1acash.z.ecc.android.sdk.rpc\"'\n\x13Tr\
ansactionDataList\x12\x0e\n\x04data\x18\x01\x20\x03(\x0cB\0:\0\"j\n\x1aT\
ransparentTransactionList\x12J\n\x0ctransactions\x18\x01\x20\x03(\x0b22.\
cash.z.ecc.android.sdk.rpc.TransparentTransactionB\0:\0\"\xd4\x01\n\x16T\
ransparentTransaction\x12\x16\n\x0cprotoVersion\x18\x01\x20\x01(\rB\0\
\x12\x16\n\x0cexpiryHeight\x18\x02\x20\x01(\rB\0\x12\x1c\n\x12hasShielde\
dOutputs\x18\x03\x20\x01(\x08B\0\x12\x1b\n\x11hasShieldedSpends\x18\x04\
\x20\x01(\x08B\0\x12\x10\n\x06height\x18\x05\x20\x01(\rB\0\x12\x0f\n\x05\
value\x18\x06\x20\x01(\x03B\0\x12\x13\n\ttoAddress\x18\x07\x20\x01(\tB\0\
\x12\x15\n\x0bfromAddress\x18\x08\x20\x01(\tB\0:\0B\0b\x06proto3\
";
static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
unsafe {
file_descriptor_proto_lazy.get(|| {
parse_descriptor_proto()
})
}
}