Migrate to `zcash/librustzcash` revision that preserves v5 tx bytes

`decrypt_and_store_transaction` internally serialized transactions, but
the previous commit only added parsing support. Fortunately we already
have the transaction bytes, so to handle this in the short term we can
just pass them through.

Once we have migrated the SDK to latest `zcash/librustzcash` the API
will return to its previous form.
This commit is contained in:
Jack Grigg 2022-05-24 21:29:37 +00:00 committed by Carter Jernigan
parent fddb5c3990
commit cc29003afb
3 changed files with 11 additions and 11 deletions

12
sdk-lib/Cargo.lock generated
View File

@ -468,7 +468,7 @@ dependencies = [
[[package]]
name = "equihash"
version = "0.1.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=36dad6282ef8101a147512ef6daa34bbb2a4b55a#36dad6282ef8101a147512ef6daa34bbb2a4b55a"
source = "git+https://github.com/zcash/librustzcash.git?rev=0a1ed9b8acf336bdc20ba49083c66f114ecf6877#0a1ed9b8acf336bdc20ba49083c66f114ecf6877"
dependencies = [
"blake2b_simd",
"byteorder",
@ -1552,7 +1552,7 @@ dependencies = [
[[package]]
name = "zcash_client_backend"
version = "0.5.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=36dad6282ef8101a147512ef6daa34bbb2a4b55a#36dad6282ef8101a147512ef6daa34bbb2a4b55a"
source = "git+https://github.com/zcash/librustzcash.git?rev=0a1ed9b8acf336bdc20ba49083c66f114ecf6877#0a1ed9b8acf336bdc20ba49083c66f114ecf6877"
dependencies = [
"base64",
"bech32",
@ -1581,7 +1581,7 @@ dependencies = [
[[package]]
name = "zcash_client_sqlite"
version = "0.3.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=36dad6282ef8101a147512ef6daa34bbb2a4b55a#36dad6282ef8101a147512ef6daa34bbb2a4b55a"
source = "git+https://github.com/zcash/librustzcash.git?rev=0a1ed9b8acf336bdc20ba49083c66f114ecf6877#0a1ed9b8acf336bdc20ba49083c66f114ecf6877"
dependencies = [
"bech32",
"bs58",
@ -1600,7 +1600,7 @@ dependencies = [
[[package]]
name = "zcash_note_encryption"
version = "0.0.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=36dad6282ef8101a147512ef6daa34bbb2a4b55a#36dad6282ef8101a147512ef6daa34bbb2a4b55a"
source = "git+https://github.com/zcash/librustzcash.git?rev=0a1ed9b8acf336bdc20ba49083c66f114ecf6877#0a1ed9b8acf336bdc20ba49083c66f114ecf6877"
dependencies = [
"blake2b_simd",
"byteorder",
@ -1614,7 +1614,7 @@ dependencies = [
[[package]]
name = "zcash_primitives"
version = "0.5.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=36dad6282ef8101a147512ef6daa34bbb2a4b55a#36dad6282ef8101a147512ef6daa34bbb2a4b55a"
source = "git+https://github.com/zcash/librustzcash.git?rev=0a1ed9b8acf336bdc20ba49083c66f114ecf6877#0a1ed9b8acf336bdc20ba49083c66f114ecf6877"
dependencies = [
"aes",
"bitvec 0.18.5",
@ -1644,7 +1644,7 @@ dependencies = [
[[package]]
name = "zcash_proofs"
version = "0.5.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=36dad6282ef8101a147512ef6daa34bbb2a4b55a#36dad6282ef8101a147512ef6daa34bbb2a4b55a"
source = "git+https://github.com/zcash/librustzcash.git?rev=0a1ed9b8acf336bdc20ba49083c66f114ecf6877#0a1ed9b8acf336bdc20ba49083c66f114ecf6877"
dependencies = [
"bellman",
"blake2b_simd",

View File

@ -30,10 +30,10 @@ secp256k1 = "0.19"
# https://github.com/zcash/librustzcash/pull/555
# https://github.com/zcash/librustzcash/pull/558
[patch.crates-io]
zcash_client_backend = { git = 'https://github.com/zcash/librustzcash.git', rev='36dad6282ef8101a147512ef6daa34bbb2a4b55a' }
zcash_client_sqlite = { git = 'https://github.com/zcash/librustzcash.git', rev='36dad6282ef8101a147512ef6daa34bbb2a4b55a' }
zcash_primitives = { git = 'https://github.com/zcash/librustzcash.git', rev='36dad6282ef8101a147512ef6daa34bbb2a4b55a' }
zcash_proofs = { git = 'https://github.com/zcash/librustzcash.git', rev='36dad6282ef8101a147512ef6daa34bbb2a4b55a' }
zcash_client_backend = { git = 'https://github.com/zcash/librustzcash.git', rev='0a1ed9b8acf336bdc20ba49083c66f114ecf6877' }
zcash_client_sqlite = { git = 'https://github.com/zcash/librustzcash.git', rev='0a1ed9b8acf336bdc20ba49083c66f114ecf6877' }
zcash_primitives = { git = 'https://github.com/zcash/librustzcash.git', rev='0a1ed9b8acf336bdc20ba49083c66f114ecf6877' }
zcash_proofs = { git = 'https://github.com/zcash/librustzcash.git', rev='0a1ed9b8acf336bdc20ba49083c66f114ecf6877' }
## Uncomment this to test librustzcash changes locally
#[patch.crates-io]

View File

@ -997,7 +997,7 @@ pub unsafe extern "C" fn Java_cash_z_ecc_android_sdk_jni_RustBackend_decryptAndS
let tx_bytes = env.convert_byte_array(tx).unwrap();
let tx = Transaction::read(&tx_bytes[..])?;
match decrypt_and_store_transaction(&network, &mut db_data, &tx) {
match decrypt_and_store_transaction(&network, &mut db_data, &tx_bytes, &tx) {
Ok(()) => Ok(JNI_TRUE),
Err(e) => Err(format_err!("Error while decrypting transaction: {}", e)),
}