Add test for Orchard contribution to z_gettotalbalance

This commit is contained in:
Kris Nuttycombe 2022-03-03 17:39:26 -07:00
parent 1732a50957
commit cf4d0f3d2d
2 changed files with 9 additions and 2 deletions

View File

@ -176,6 +176,10 @@ class WalletAccountsTest(BitcoinTestFramework):
self.check_balance(0, 0, ua0, {'sapling': 9})
self.check_balance(0, 0, ua0, {'sapling': 9, 'orchard': 10}, 0)
# The total balance with the default minconf should be just the Sapling balance
assert_equal('9.00', self.nodes[0].z_gettotalbalance()['private'])
assert_equal('19.00', self.nodes[0].z_gettotalbalance(0)['private'])
self.nodes[2].generate(1)
self.sync_all()

View File

@ -3410,6 +3410,9 @@ CAmount getBalanceZaddr(std::optional<libzcash::PaymentAddress> address, int min
for (auto & entry : saplingEntries) {
balance += CAmount(entry.note.value());
}
for (auto & entry : orchardEntries) {
balance += entry.GetNoteValue();
}
return balance;
}