Merge fix Android 32-bit

This commit is contained in:
Hanh 2023-03-21 16:54:57 +10:00
parent ecdddf37cb
commit 945cf8941e
4 changed files with 19 additions and 15 deletions

View File

@ -59,10 +59,10 @@ zip = "0.6"
# Workaround for https://github.com/gyscos/zstd-rs/issues/177
zstd-sys = "=2.0.1+zstd.1.5.2"
age = "0.9"
jubjub = "0.9.0"
jubjub = "0.10.0"
bls12_381 = "0.7"
ff = "0.12"
group = "0.12.0"
ff = "0.13"
group = "0.13.0"
byteorder = "^1.4"
secp256k1 = "0.21.3"
tiny-hderive = "0.3.0"
@ -120,38 +120,38 @@ sqlcipher = ["rusqlite/bundled-sqlcipher-vendored-openssl"]
[dependencies.zcash_params]
git = "https://github.com/hhanh00/zcash-params.git"
rev = "c43d03dda4a78172fe5283168510cd41ee8f1430"
rev = "154f3544781500c27f58923ccc6c7e779eecf9df"
#path = "../zcash-params"
[dependencies.zcash_client_backend]
git = "https://github.com/hhanh00/librustzcash.git"
rev = "7469d70261e8e72f2bbf3163704ddf8fd825b1aa"
rev = "f39dd6c2af20662fd1aaa9e00172efebd3435ff4"
#path = "../../librustzcash/zcash_client_backend"
[dependencies.zcash_primitives]
git = "https://github.com/hhanh00/librustzcash.git"
rev = "7469d70261e8e72f2bbf3163704ddf8fd825b1aa"
rev = "f39dd6c2af20662fd1aaa9e00172efebd3435ff4"
#path = "../../librustzcash/zcash_primitives"
features = [ "transparent-inputs" ]
[dependencies.zcash_proofs]
git = "https://github.com/hhanh00/librustzcash.git"
rev = "7469d70261e8e72f2bbf3163704ddf8fd825b1aa"
rev = "f39dd6c2af20662fd1aaa9e00172efebd3435ff4"
#path = "../../librustzcash/zcash_proofs"
[dependencies.zcash_address]
git = "https://github.com/hhanh00/librustzcash.git"
rev = "7469d70261e8e72f2bbf3163704ddf8fd825b1aa"
rev = "f39dd6c2af20662fd1aaa9e00172efebd3435ff4"
#path = "../../librustzcash/components/zcash_address"
[dependencies.zcash_encoding]
git = "https://github.com/hhanh00/librustzcash.git"
rev = "7469d70261e8e72f2bbf3163704ddf8fd825b1aa"
rev = "f39dd6c2af20662fd1aaa9e00172efebd3435ff4"
#path = "../../librustzcash/components/zcash_encoding"
[dependencies.zcash_note_encryption]
git = "https://github.com/hhanh00/librustzcash.git"
rev = "7469d70261e8e72f2bbf3163704ddf8fd825b1aa"
rev = "f39dd6c2af20662fd1aaa9e00172efebd3435ff4"
#path = "../../librustzcash/components/zcash_note_encryption"
[build-dependencies]

View File

@ -1,5 +1,5 @@
use crate::{AccountData, Empty, Hash, RawTransaction};
use orchard::keys::{FullViewingKey, IncomingViewingKey, Scope};
use orchard::keys::{FullViewingKey, IncomingViewingKey, Scope, PreparedEphemeralPublicKey};
use orchard::note_encryption::OrchardDomain;
use std::collections::HashMap;
use tokio::runtime::Runtime;
@ -277,6 +277,7 @@ impl MemPoolImpl {
}
if let Some(orchard_bundle) = tx.orchard_bundle() {
if let Some(ref oivk) = self.oivk {
let poivk = orchard::keys::PreparedIncomingViewingKey::new(oivk);
for a in orchard_bundle.actions().iter() {
let nf = a.nullifier().to_bytes();
if let Some(&value) = self.nfs.get(&nf) {
@ -284,7 +285,7 @@ impl MemPoolImpl {
balance -= value as i64;
}
let domain = OrchardDomain::for_action(a);
if let Some((note, _, _)) = try_note_decryption(&domain, oivk, a) {
if let Some((note, _, _)) = try_note_decryption(&domain, &poivk, a) {
balance += note.value().inner() as i64; // value is incoming
}
}

View File

@ -4,6 +4,7 @@ use crate::sync::{
CompactOutputBytes, DecryptedNote, Node, OutputPosition, TrialDecrypter, ViewKey,
};
use crate::CompactTx;
use orchard::keys::PreparedIncomingViewingKey;
use orchard::note_encryption::OrchardDomain;
use zcash_primitives::consensus::{BlockHeight, Parameters};
@ -18,8 +19,9 @@ impl ViewKey<OrchardDomain> for OrchardViewKey {
self.account
}
fn ivk(&self) -> orchard::keys::IncomingViewingKey {
self.fvk.to_ivk(orchard::keys::Scope::External)
fn ivk(&self) -> orchard::keys::PreparedIncomingViewingKey {
let ivk = self.fvk.to_ivk(orchard::keys::Scope::External);
PreparedIncomingViewingKey::new(&ivk)
}
}

View File

@ -173,13 +173,14 @@ pub fn decode_transaction(
if let Some(orchard_bundle) = tx.orchard_bundle() {
let mut contact_decoder = ContactDecoder::new(orchard_bundle.actions().len());
if let Some((orchard_ivk, orchard_ovk)) = decryption_keys.orchard_keys.clone() {
let poivk = orchard::keys::PreparedIncomingViewingKey::new(&orchard_ivk);
for action in orchard_bundle.actions().iter() {
let mut incoming = false;
let mut outgoing = false;
let mut temp_address = String::new();
let domain = OrchardDomain::for_action(action);
if let Some((_note, pa, memo)) =
try_note_decryption(&domain, &orchard_ivk, action)
try_note_decryption(&domain, &poivk, action)
{
if let Ok(memo) = Memo::try_from(MemoBytes::from_bytes(&memo)?) {
if memo != Memo::Empty {