From 54dbf8e0ff258a4802f3285f714a0b786864eae1 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 24 May 2019 16:06:19 +0100 Subject: [PATCH] Add transparent address send support to backend --- Cargo.lock | 147 +++++++++++++++++++++++++++---------------- Cargo.toml | 14 ++--- src/main/rust/lib.rs | 19 +++--- 3 files changed, 107 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ea30741..0dfdfd31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,6 +45,11 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arrayref" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "arrayvec" version = "0.4.10" @@ -102,17 +107,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bellman" version = "0.1.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "futures 0.1.25 (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.1.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "group 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -136,6 +141,15 @@ dependencies = [ "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "block-buffer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "block-buffer" version = "0.7.0" @@ -163,6 +177,14 @@ dependencies = [ "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bs58" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "byte-tools" version = "0.2.0" @@ -363,17 +385,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ff" version = "0.4.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ff_derive 0.3.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff_derive 0.3.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ff_derive" version = "0.3.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -447,9 +469,9 @@ dependencies = [ [[package]] name = "group" version = "0.1.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -724,11 +746,11 @@ dependencies = [ [[package]] name = "pairing" version = "0.14.2" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "group 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "group 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -960,14 +982,14 @@ dependencies = [ [[package]] name = "sapling-crypto" version = "0.0.1" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ - "bellman 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "bellman 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -994,6 +1016,17 @@ name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "sha2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sha2" version = "0.8.0" @@ -1415,86 +1448,88 @@ version = "0.0.1" dependencies = [ "android_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "grpc 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "jni 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log-panics 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "protobuf 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "zcash_client_backend 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "zcash_client_sqlite 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "zcash_proofs 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "zcash_client_backend 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "zcash_client_sqlite 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "zcash_proofs 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", ] [[package]] name = "zcash_client_backend" version = "0.0.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ "bech32 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "protobuf 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf-codegen-pure 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", ] [[package]] name = "zcash_client_sqlite" version = "0.0.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ "bech32 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "protobuf 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rusqlite 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "zcash_client_backend 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "zcash_client_backend 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", ] [[package]] name = "zcash_primitives" version = "0.0.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ "aes 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "crypto_api_chachapoly 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "fpe 0.1.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.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "zcash_proofs" version = "0.0.0" -source = "git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6#b12ff574992219c39c694143e7faa11f095305b6" +source = "git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16#ae63116f639847e54716fbf47f19589d12038a16" dependencies = [ - "bellman 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "bellman 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", - "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)", + "sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", + "zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)", ] [metadata] @@ -1503,6 +1538,7 @@ dependencies = [ "checksum aesni 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6810b7fb9f2bb4f76f05ac1c170b8dde285b6308955dc3afd89710268c958d9e" "checksum android_log-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b8052e2d8aabbb8d556d6abbcce2a22b9590996c5f849b9c7ce4544a2e3b984e" "checksum android_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bad99185bc195e796e1591740c26716667b58ac9210a48731f71f803fc6ca43a" +"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" "checksum ascii 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a5fc969a8ce2c9c0c4b0429bb8431544f6658283c8326ba5ff8c762b75369335" "checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" @@ -1510,13 +1546,15 @@ dependencies = [ "checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bech32 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58946044516aa9dc922182e0d6e9d124a31aafe6b421614654eb27cf90cec09c" -"checksum bellman 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" +"checksum bellman 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" "checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)" = "" +"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum block-buffer 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49665c62e0e700857531fa5d3763e91b539ff1abeebd56808d378b495870d60d" "checksum block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "370424437b9459f3dfd68428ed9376ddfe03d8b70ede29cc533b3557df186ab4" "checksum block-padding 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d75255892aeb580d3c566f213a2b6fdc1c66667839f45719ee1d30ebf2aea591" +"checksum bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0de79cfb98e7aa9988188784d8664b4b5dad6eaaa0863b91d9a4ed871d4f7a42" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb" @@ -1543,8 +1581,8 @@ dependencies = [ "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -"checksum ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" -"checksum ff_derive 0.3.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" +"checksum ff 0.4.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" +"checksum ff_derive 0.3.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" "checksum fpe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce3371c82bfbd984f624cab093f55e7336f5a6e589f8518e1258f54f011b89ad" "checksum fuchsia-cprng 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81f7f8eb465745ea9b02e2704612a9946a59fa40572086c6fd49d6ddcf30bf31" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" @@ -1553,7 +1591,7 @@ dependencies = [ "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592" "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" -"checksum group 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" +"checksum group 0.1.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" "checksum grpc 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8e530ef7894a104a1c8525ce68787b3491efa2098ce5e5454e8324ea78893548" "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" @@ -1585,7 +1623,7 @@ dependencies = [ "checksum opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d620c9c26834b34f039489ac0dfdb12c7ac15ccaf818350a64c9b5334a452ad7" "checksum opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "93f5bb2e8e8dec81642920ccff6b61f1eb94fa3020c5a325c9851ff604152409" "checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" -"checksum pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" +"checksum pairing 0.14.2 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" "checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" "checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" @@ -1612,11 +1650,12 @@ dependencies = [ "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" "checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" -"checksum sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" +"checksum sapling-crypto 0.0.1 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "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.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" "checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" "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" @@ -1660,7 +1699,7 @@ dependencies = [ "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "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.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" -"checksum zcash_client_sqlite 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" -"checksum zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" -"checksum zcash_proofs 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=b12ff574992219c39c694143e7faa11f095305b6)" = "" +"checksum zcash_client_backend 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" +"checksum zcash_client_sqlite 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" +"checksum zcash_primitives 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" +"checksum zcash_proofs 0.0.0 (git+https://github.com/str4d/librustzcash.git?rev=ae63116f639847e54716fbf47f19589d12038a16)" = "" diff --git a/Cargo.toml b/Cargo.toml index bb25d7a1..0e6d0c43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,31 +22,31 @@ protobuf = { version = "2", optional = true } [dependencies.ff] git = "https://github.com/str4d/librustzcash.git" -rev = "b12ff574992219c39c694143e7faa11f095305b6" +rev = "ae63116f639847e54716fbf47f19589d12038a16" [dependencies.pairing] git = "https://github.com/str4d/librustzcash.git" -rev = "b12ff574992219c39c694143e7faa11f095305b6" +rev = "ae63116f639847e54716fbf47f19589d12038a16" [dependencies.sapling-crypto] git = "https://github.com/str4d/librustzcash.git" -rev = "b12ff574992219c39c694143e7faa11f095305b6" +rev = "ae63116f639847e54716fbf47f19589d12038a16" [dependencies.zcash_client_backend] git = "https://github.com/str4d/librustzcash.git" -rev = "b12ff574992219c39c694143e7faa11f095305b6" +rev = "ae63116f639847e54716fbf47f19589d12038a16" [dependencies.zcash_client_sqlite] git = "https://github.com/str4d/librustzcash.git" -rev = "b12ff574992219c39c694143e7faa11f095305b6" +rev = "ae63116f639847e54716fbf47f19589d12038a16" [dependencies.zcash_primitives] git = "https://github.com/str4d/librustzcash.git" -rev = "b12ff574992219c39c694143e7faa11f095305b6" +rev = "ae63116f639847e54716fbf47f19589d12038a16" [dependencies.zcash_proofs] git = "https://github.com/str4d/librustzcash.git" -rev = "b12ff574992219c39c694143e7faa11f095305b6" +rev = "ae63116f639847e54716fbf47f19589d12038a16" [features] mainnet = ["zcash_client_sqlite/mainnet"] diff --git a/src/main/rust/lib.rs b/src/main/rust/lib.rs index 1d6bcf5d..49bbb184 100644 --- a/src/main/rust/lib.rs +++ b/src/main/rust/lib.rs @@ -16,12 +16,11 @@ use std::path::Path; use std::ptr; use zcash_client_backend::{ constants::SAPLING_CONSENSUS_BRANCH_ID, - encoding::{ - decode_extended_spending_key, decode_payment_address, encode_extended_spending_key, - }, + encoding::{decode_extended_spending_key, encode_extended_spending_key}, keys::spending_key, }; use zcash_client_sqlite::{ + address::RecipientAddress, chain::{rewind_to_height, validate_combined_chain}, get_address, get_balance, get_received_memo_as_utf8, get_sent_memo_as_utf8, get_verified_balance, init_accounts_table, init_blocks_table, init_data_database, @@ -36,14 +35,10 @@ use zcash_proofs::prover::LocalTxProver; use crate::utils::exception::unwrap_exc_or; #[cfg(feature = "mainnet")] -use zcash_client_backend::constants::mainnet::{ - HRP_SAPLING_EXTENDED_SPENDING_KEY, HRP_SAPLING_PAYMENT_ADDRESS, -}; +use zcash_client_backend::constants::mainnet::HRP_SAPLING_EXTENDED_SPENDING_KEY; #[cfg(not(feature = "mainnet"))] -use zcash_client_backend::constants::testnet::{ - HRP_SAPLING_EXTENDED_SPENDING_KEY, HRP_SAPLING_PAYMENT_ADDRESS, -}; +use zcash_client_backend::constants::testnet::HRP_SAPLING_EXTENDED_SPENDING_KEY; #[no_mangle] pub unsafe extern "C" fn Java_cash_z_wallet_sdk_jni_RustBackend_initLogs( @@ -369,13 +364,13 @@ pub unsafe extern "C" fn Java_cash_z_wallet_sdk_jni_RustBackend_sendToAddress( } }; - let to = match decode_payment_address(HRP_SAPLING_PAYMENT_ADDRESS, &to) { + let to = match RecipientAddress::from_str(&to) { Ok(Some(to)) => to, Ok(None) => { - return Err(format_err!("PaymentAddress is for the wrong network")); + return Err(format_err!("Address is for the wrong network")); } Err(e) => { - return Err(format_err!("Invalid PaymentAddress: {}", e)); + return Err(format_err!("Invalid Address: {}", e)); } };