Merge pull request #1453 from zcash/fix-tx-view-bug
`zcash_client_sqlite`: Fix bug in `utxos_to_txos` migration
This commit is contained in:
commit
104c0c2aed
|
@ -1,10 +1,9 @@
|
|||
use std::ffi::OsStr;
|
||||
use std::fmt;
|
||||
use std::num::NonZeroU32;
|
||||
use std::{collections::BTreeMap, convert::Infallible};
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
use std::fs::File;
|
||||
use std::{ffi::OsStr, fs::File};
|
||||
|
||||
use group::ff::Field;
|
||||
use incrementalmerkletree::{Marking, Position, Retention};
|
||||
|
|
|
@ -313,6 +313,7 @@ pub(crate) fn send_multi_step_proposed_transfer<T: ShieldedPoolTester>() {
|
|||
legacy::keys::{NonHardenedChildIndex, TransparentKeyScope},
|
||||
transaction::builder::{BuildConfig, Builder},
|
||||
};
|
||||
use zcash_protocol::value::ZatBalance;
|
||||
|
||||
use crate::wallet::{sapling::tests::test_prover, GAP_LIMIT};
|
||||
|
||||
|
@ -452,6 +453,34 @@ pub(crate) fn send_multi_step_proposed_transfer<T: ShieldedPoolTester>() {
|
|||
(sent_v, sent_to_addr, None, None)
|
||||
if sent_v == u64::try_from(transfer_amount).unwrap() && sent_to_addr == Some(tex_addr.encode(&st.wallet().params)));
|
||||
|
||||
// Check that the transaction history matches what we expect.
|
||||
let tx_history = st.get_tx_history().unwrap();
|
||||
|
||||
let tx_0 = tx_history
|
||||
.iter()
|
||||
.find(|tx| tx.txid() == *txids.first())
|
||||
.unwrap();
|
||||
let tx_1 = tx_history
|
||||
.iter()
|
||||
.find(|tx| tx.txid() == *txids.last())
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(tx_0.account_id(), &account_id);
|
||||
assert!(!tx_0.expired_unmined());
|
||||
assert_eq!(tx_0.has_change(), expected_step0_change.is_positive());
|
||||
assert_eq!(
|
||||
tx_0.account_value_delta(),
|
||||
-ZatBalance::from(expected_step0_fee),
|
||||
);
|
||||
|
||||
assert_eq!(tx_1.account_id(), &account_id);
|
||||
assert!(!tx_1.expired_unmined());
|
||||
assert!(!tx_1.has_change());
|
||||
assert_eq!(
|
||||
tx_1.account_value_delta(),
|
||||
-ZatBalance::from(expected_ephemeral),
|
||||
);
|
||||
|
||||
(ephemeral_addr.unwrap(), txids)
|
||||
};
|
||||
|
||||
|
|
|
@ -700,7 +700,7 @@ notes AS (
|
|||
ON ros.pool = ro.pool
|
||||
AND ros.received_output_id = ro.id_within_pool_table
|
||||
JOIN transactions
|
||||
ON transactions.id_tx = ro.transaction_id
|
||||
ON transactions.id_tx = ros.transaction_id
|
||||
),
|
||||
-- Obtain a count of the notes that the wallet created in each transaction,
|
||||
-- not counting change notes.
|
||||
|
|
|
@ -229,7 +229,7 @@ impl RusqliteMigration for Migration {
|
|||
ON ros.pool = ro.pool
|
||||
AND ros.received_output_id = ro.id_within_pool_table
|
||||
JOIN transactions
|
||||
ON transactions.id_tx = ro.transaction_id
|
||||
ON transactions.id_tx = ros.transaction_id
|
||||
),
|
||||
-- Obtain a count of the notes that the wallet created in each transaction,
|
||||
-- not counting change notes.
|
||||
|
|
Loading…
Reference in New Issue