Skip to content

Commit

Permalink
Use getbalances in wallet_address_types tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Apr 5, 2020
1 parent 7eacdc5 commit 0306d78
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/functional/wallet_address_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@ def setup_network(self):
connect_nodes(self.nodes[i], j)
self.sync_all()

def get_balances(self, confirmed=True):
"""Return a list of confirmed or unconfirmed balances."""
if confirmed:
return [self.nodes[i].getbalance() for i in range(4)]
else:
return [self.nodes[i].getunconfirmedbalance() for i in range(4)]
def get_balances(self, key='trusted'):
"""Return a list of balances."""
return [self.nodes[i].getbalances()['mine'][key] for i in range(4)]

# Quick test of python bech32 implementation
def test_python_bech32(self, addr):
Expand Down Expand Up @@ -307,7 +304,7 @@ def run_test(self):
self.nodes[from_node].sendmany("", sends)
self.sync_mempools()

unconf_balances = self.get_balances(False)
unconf_balances = self.get_balances('untrusted_pending')
self.log.debug("Check unconfirmed balances: {}".format(unconf_balances))
assert_equal(unconf_balances[from_node], 0)
for n, to_node in enumerate(range(from_node + 1, from_node + 4)):
Expand Down

0 comments on commit 0306d78

Please sign in to comment.