Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_balance.py
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# the fee by 0.01 here to resend, but this is BCH, so it has 0.01 BCH | # the fee by 0.01 here to resend, but this is BCH, so it has 0.01 BCH | ||||
# left to spend on goods and services | # left to spend on goods and services | ||||
self.sync_all() | self.sync_all() | ||||
self.log.info( | self.log.info( | ||||
"Test getbalance and getunconfirmedbalance with conflicted unconfirmed inputs") | "Test getbalance and getunconfirmedbalance with conflicted unconfirmed inputs") | ||||
test_balances(fee_node_1=Decimal('0.01')) | test_balances(fee_node_1=Decimal('0.01')) | ||||
# output of node 1's send | |||||
assert_equal(self.nodes[0].getwalletinfo()[ | |||||
"unconfirmed_balance"], Decimal('60')) | |||||
assert_equal(self.nodes[0].getunconfirmedbalance(), Decimal('60')) | |||||
# Doesn't include output of node 0's send since it was spent | |||||
assert_equal(self.nodes[1].getwalletinfo()[ | |||||
"unconfirmed_balance"], Decimal('0')) | |||||
assert_equal(self.nodes[1].getunconfirmedbalance(), Decimal('0')) | |||||
self.nodes[1].generatetoaddress(1, ADDRESS_WATCHONLY) | self.nodes[1].generatetoaddress(1, ADDRESS_WATCHONLY) | ||||
self.sync_all() | self.sync_all() | ||||
# balances are correct after the transactions are confirmed | # balances are correct after the transactions are confirmed | ||||
# node 1's send plus change from node 0's send | # node 1's send plus change from node 0's send | ||||
assert_equal(self.nodes[0].getbalance(), Decimal('69.99')) | assert_equal(self.nodes[0].getbalance(), Decimal('69.99')) | ||||
assert_equal(self.nodes[1].getbalance(), Decimal( | assert_equal(self.nodes[1].getbalance(), Decimal( | ||||
'29.99')) # change from node 0's send | '29.99')) # change from node 0's send | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |