Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_balance.py
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# 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('10000')) | assert_equal(self.nodes[1].getbalance(minconf=2), Decimal('10000')) | ||||
# check mempool transactions count for wallet unconfirmed balance after | # check mempool transactions count for wallet unconfirmed balance after | ||||
# dynamically loading the wallet. | # dynamically loading the wallet. | ||||
before = self.nodes[1].getbalances()['mine']['untrusted_pending'] | before = self.nodes[1].getbalances()['mine']['untrusted_pending'] | ||||
dst = self.nodes[1].getnewaddress() | dst = self.nodes[1].getnewaddress() | ||||
self.nodes[1].unloadwallet('') | self.nodes[1].unloadwallet(self.default_wallet_name) | ||||
self.nodes[0].sendtoaddress(dst, 100000) | self.nodes[0].sendtoaddress(dst, 100000) | ||||
self.sync_all() | self.sync_all() | ||||
self.nodes[1].loadwallet('') | self.nodes[1].loadwallet(self.default_wallet_name) | ||||
after = self.nodes[1].getbalances()['mine']['untrusted_pending'] | after = self.nodes[1].getbalances()['mine']['untrusted_pending'] | ||||
assert_equal(before + Decimal('100000'), after) | assert_equal(before + Decimal('100000'), after) | ||||
# Create 3 more wallet txs, where the last is not accepted to the | # Create 3 more wallet txs, where the last is not accepted to the | ||||
# mempool because it is the third descendant of the tx above | # mempool because it is the third descendant of the tx above | ||||
for _ in range(3): | for _ in range(3): | ||||
# Set amount high enough such that all coins are spent by each tx | # Set amount high enough such that all coins are spent by each tx | ||||
txid = self.nodes[0].sendtoaddress( | txid = self.nodes[0].sendtoaddress( | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |