Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_balance.py
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# getbalance with a minconf incorrectly excludes coins that have been spent more recently than the minconf blocks ago | # getbalance with a minconf incorrectly excludes coins that have been spent more recently than the minconf blocks ago | ||||
# TODO: fix getbalance tracking of coin spentness depth | # TODO: fix getbalance tracking of coin spentness depth | ||||
# getbalance with minconf=3 should still show the old balance | # getbalance with minconf=3 should still show the old balance | ||||
assert_equal(self.nodes[1].getbalance(minconf=3), Decimal('0')) | assert_equal(self.nodes[1].getbalance(minconf=3), Decimal('0')) | ||||
# getbalance with minconf=2 will show the new balance. | # getbalance with minconf=2 will show the new balance. | ||||
assert_equal(self.nodes[1].getbalance(minconf=2), Decimal('0.01')) | assert_equal(self.nodes[1].getbalance(minconf=2), Decimal('0.01')) | ||||
# check mempool transactions count for wallet unconfirmed balance after | |||||
# dynamically loading the wallet. | |||||
before = self.nodes[1].getunconfirmedbalance() | |||||
dst = self.nodes[1].getnewaddress() | |||||
self.nodes[1].unloadwallet('') | |||||
self.nodes[0].sendtoaddress(dst, 0.1) | |||||
self.sync_all() | |||||
self.nodes[1].loadwallet('') | |||||
after = self.nodes[1].getunconfirmedbalance() | |||||
assert_equal(before + Decimal('0.1'), after) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
WalletTest().main() | WalletTest().main() |