From 0306d78cb49d1684cc96ba3512b582a1fdaf78cc Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Fri, 27 Mar 2020 17:20:28 +0100 Subject: [PATCH] Use getbalances in wallet_address_types tests --- test/functional/wallet_address_types.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/functional/wallet_address_types.py b/test/functional/wallet_address_types.py index 79b6db986b5..065764dcac2 100755 --- a/test/functional/wallet_address_types.py +++ b/test/functional/wallet_address_types.py @@ -97,12 +97,9 @@ class AddressTypeTest(BitcoinTestFramework): 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): @@ -307,7 +304,7 @@ class AddressTypeTest(BitcoinTestFramework): 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)):