mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-12 02:05:47 +00:00
Add check for balance/zbalance
This commit is contained in:
parent
b928d5f096
commit
05bf4a6459
@ -706,6 +706,12 @@ fn test_z_spend_to_z() {
|
|||||||
let branch_id = u32::from_str_radix("2bb40e60", 16).unwrap();
|
let branch_id = u32::from_str_radix("2bb40e60", 16).unwrap();
|
||||||
let (ss, so) = get_sapling_params().unwrap();
|
let (ss, so) = get_sapling_params().unwrap();
|
||||||
|
|
||||||
|
// Make sure that the balance exists
|
||||||
|
{
|
||||||
|
assert_eq!(wallet.zbalance(None), AMOUNT1);
|
||||||
|
assert_eq!(wallet.verified_zbalance(None), AMOUNT1);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a tx and send to address
|
// Create a tx and send to address
|
||||||
let raw_tx = wallet.send_to_address(branch_id, &ss, &so,
|
let raw_tx = wallet.send_to_address(branch_id, &ss, &so,
|
||||||
vec![(&ext_address, AMOUNT_SENT, Some(outgoing_memo.clone()))]).unwrap();
|
vec![(&ext_address, AMOUNT_SENT, Some(outgoing_memo.clone()))]).unwrap();
|
||||||
@ -736,6 +742,12 @@ fn test_z_spend_to_z() {
|
|||||||
assert_eq!(mem[&sent_txid].outgoing_metadata[0].memo.to_utf8().unwrap().unwrap(), outgoing_memo);
|
assert_eq!(mem[&sent_txid].outgoing_metadata[0].memo.to_utf8().unwrap().unwrap(), outgoing_memo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// The wallet should deduct this from the balance and verified balance
|
||||||
|
assert_eq!(wallet.zbalance(None), 0);
|
||||||
|
assert_eq!(wallet.verified_zbalance(None), 0);
|
||||||
|
}
|
||||||
|
|
||||||
let mut cb3 = FakeCompactBlock::new(2, block_hash);
|
let mut cb3 = FakeCompactBlock::new(2, block_hash);
|
||||||
cb3.add_tx(&sent_tx);
|
cb3.add_tx(&sent_tx);
|
||||||
wallet.scan_block(&cb3.as_bytes()).unwrap();
|
wallet.scan_block(&cb3.as_bytes()).unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user