mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-01-30 18:42:15 +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 (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
|
||||
let raw_tx = wallet.send_to_address(branch_id, &ss, &so,
|
||||
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);
|
||||
}
|
||||
|
||||
{
|
||||
// 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);
|
||||
cb3.add_tx(&sent_tx);
|
||||
wallet.scan_block(&cb3.as_bytes()).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user