From b0f1d643aa123b810cda87104f81a0d08aaf1556 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 10 Mar 2018 10:19:44 +0000 Subject: [PATCH] test: Fetch coinbase address from coinbase UTXOs After upstream PR bitcoin/bitcoin#5994, the first call to getnewaddress after startup does not return the address being used by the miner. --- qa/rpc-tests/finalsaplingroot.py | 3 ++- qa/rpc-tests/mempool_nu_activation.py | 5 +++-- qa/rpc-tests/mempool_tx_input_limit.py | 5 +++-- qa/rpc-tests/paymentdisclosure.py | 5 +++-- qa/rpc-tests/signrawtransaction_offline.py | 2 +- qa/rpc-tests/test_framework/util.py | 9 +++++++++ qa/rpc-tests/wallet_1941.py | 5 +++-- qa/rpc-tests/wallet_anchorfork.py | 4 ++-- qa/rpc-tests/wallet_listnotes.py | 13 ++++++++----- qa/rpc-tests/wallet_nullifiers.py | 6 ++++-- qa/rpc-tests/wallet_overwintertx.py | 5 +++-- qa/rpc-tests/wallet_persistence.py | 3 ++- qa/rpc-tests/wallet_protectcoinbase.py | 5 +++-- qa/rpc-tests/wallet_sapling.py | 20 +++++++++++--------- qa/rpc-tests/wallet_shieldcoinbase.py | 16 +++++++--------- qa/rpc-tests/wallet_treestate.py | 5 +++-- 16 files changed, 67 insertions(+), 44 deletions(-) diff --git a/qa/rpc-tests/finalsaplingroot.py b/qa/rpc-tests/finalsaplingroot.py index 59b184f03..85d74aaf3 100755 --- a/qa/rpc-tests/finalsaplingroot.py +++ b/qa/rpc-tests/finalsaplingroot.py @@ -9,6 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, connect_nodes_bi, + get_coinbase_address, initialize_chain_clean, start_nodes, wait_and_assert_operationid_status, @@ -56,7 +57,7 @@ class FinalSaplingRootTest(BitcoinTestFramework): assert_equal(blk["finalsaplingroot"], SAPLING_TREE_EMPTY_ROOT) # Node 0 shields some funds - taddr0 = self.nodes[0].getnewaddress() + taddr0 = get_coinbase_address(self.nodes[0], 100) saplingAddr0 = self.nodes[0].z_getnewaddress('sapling') recipients = [] recipients.append({"address": saplingAddr0, "amount": Decimal('20')}) diff --git a/qa/rpc-tests/mempool_nu_activation.py b/qa/rpc-tests/mempool_nu_activation.py index cb54cb7e8..6b187a1d1 100755 --- a/qa/rpc-tests/mempool_nu_activation.py +++ b/qa/rpc-tests/mempool_nu_activation.py @@ -7,7 +7,8 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ - start_node, connect_nodes, wait_and_assert_operationid_status + start_node, connect_nodes, wait_and_assert_operationid_status, \ + get_coinbase_address from test_framework.authproxy import JSONRPCException from decimal import Decimal @@ -43,7 +44,7 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework): self.sync_all() # Shield some ZEC - node1_taddr = self.nodes[1].getnewaddress() + node1_taddr = get_coinbase_address(self.nodes[1], 97) node0_zaddr = self.nodes[0].z_getnewaddress('sprout') recipients = [{'address': node0_zaddr, 'amount': Decimal('10')}] myopid = self.nodes[1].z_sendmany(node1_taddr, recipients, 1, Decimal('0')) diff --git a/qa/rpc-tests/mempool_tx_input_limit.py b/qa/rpc-tests/mempool_tx_input_limit.py index 34896a756..1ace7a02f 100755 --- a/qa/rpc-tests/mempool_tx_input_limit.py +++ b/qa/rpc-tests/mempool_tx_input_limit.py @@ -8,7 +8,8 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException from test_framework.util import assert_equal, initialize_chain_clean, \ - start_node, connect_nodes, wait_and_assert_operationid_status + start_node, connect_nodes, wait_and_assert_operationid_status, \ + get_coinbase_address from decimal import Decimal @@ -50,7 +51,7 @@ class MempoolTxInputLimitTest(BitcoinTestFramework): node0_zaddr = self.nodes[0].z_getnewaddress('sprout') # Send three inputs from node 0 taddr to zaddr to get out of coinbase - node0_taddr = self.nodes[0].getnewaddress() + node0_taddr = get_coinbase_address(self.nodes[0], 3) recipients = [] recipients.append({"address":node0_zaddr, "amount":Decimal('30.0')-Decimal('0.0001')}) # utxo amount less fee myopid = self.nodes[0].z_sendmany(node0_taddr, recipients) diff --git a/qa/rpc-tests/paymentdisclosure.py b/qa/rpc-tests/paymentdisclosure.py index ca73fcb6b..63260ff61 100755 --- a/qa/rpc-tests/paymentdisclosure.py +++ b/qa/rpc-tests/paymentdisclosure.py @@ -8,7 +8,8 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException from test_framework.util import assert_equal, initialize_chain_clean, \ - start_node, connect_nodes_bi, wait_and_assert_operationid_status + start_node, connect_nodes_bi, wait_and_assert_operationid_status, \ + get_coinbase_address from decimal import Decimal @@ -48,7 +49,7 @@ class PaymentDisclosureTest (BitcoinTestFramework): assert_equal(self.nodes[1].getbalance(), 10) assert_equal(self.nodes[2].getbalance(), 30) - mytaddr = self.nodes[0].getnewaddress() + mytaddr = get_coinbase_address(self.nodes[0], 4) myzaddr = self.nodes[0].z_getnewaddress('sprout') # Check that Node 2 has payment disclosure disabled. diff --git a/qa/rpc-tests/signrawtransaction_offline.py b/qa/rpc-tests/signrawtransaction_offline.py index 34e29aa25..a4478c3c4 100755 --- a/qa/rpc-tests/signrawtransaction_offline.py +++ b/qa/rpc-tests/signrawtransaction_offline.py @@ -27,12 +27,12 @@ class SignOfflineTest (BitcoinTestFramework): assert_equal(0, len(offline_node.getpeerinfo())) # make sure node 1 has no peers - privkeys = [self.nodes[0].dumpprivkey(self.nodes[0].getnewaddress())] taddr = self.nodes[0].getnewaddress() tx = self.nodes[0].listunspent()[0] txid = tx['txid'] scriptpubkey = tx['scriptPubKey'] + privkeys = [self.nodes[0].dumpprivkey(tx['address'])] create_inputs = [{'txid': txid, 'vout': 0}] sign_inputs = [{'txid': txid, 'vout': 0, 'scriptPubKey': scriptpubkey, 'amount': 10}] diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index 0a57e6ddf..afc7a0f2d 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -419,3 +419,12 @@ def wait_and_assert_operationid_status(node, myopid, in_status='success', in_err return result # if there was an error return the result else: return txid # otherwise return the txid + +# Find a coinbase address on the node, filtering by the number of UTXOs it has. +# The default cached chain has one address per coinbase output. +def get_coinbase_address(node, expected_utxos): + addrs = [utxo['address'] for utxo in node.listunspent() if utxo['generated']] + assert(len(set(addrs)) > 0) + addrs = [a for a in set(addrs) if addrs.count(a) == expected_utxos] + assert(len(addrs) > 0) + return addrs[0] diff --git a/qa/rpc-tests/wallet_1941.py b/qa/rpc-tests/wallet_1941.py index 01bfb8cbb..b4a2089b7 100755 --- a/qa/rpc-tests/wallet_1941.py +++ b/qa/rpc-tests/wallet_1941.py @@ -10,7 +10,8 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ initialize_datadir, start_nodes, start_node, connect_nodes_bi, \ - bitcoind_processes, wait_and_assert_operationid_status + bitcoind_processes, wait_and_assert_operationid_status, \ + get_coinbase_address from decimal import Decimal @@ -48,7 +49,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework): self.nodes[0].setmocktime(starttime) self.nodes[0].generate(101) - mytaddr = self.nodes[0].getnewaddress() # where coins were mined + mytaddr = get_coinbase_address(self.nodes[0], 1) myzaddr = self.nodes[0].z_getnewaddress('sprout') # Send 10 coins to our zaddr. diff --git a/qa/rpc-tests/wallet_anchorfork.py b/qa/rpc-tests/wallet_anchorfork.py index 3dfd3c46a..e83d1be9f 100755 --- a/qa/rpc-tests/wallet_anchorfork.py +++ b/qa/rpc-tests/wallet_anchorfork.py @@ -8,7 +8,7 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ start_nodes, stop_nodes, connect_nodes_bi, \ - wait_and_assert_operationid_status, wait_bitcoinds + wait_and_assert_operationid_status, wait_bitcoinds, get_coinbase_address from decimal import Decimal class WalletAnchorForkTest (BitcoinTestFramework): @@ -45,7 +45,7 @@ class WalletAnchorForkTest (BitcoinTestFramework): # At this point in time, commitment tree is the empty root # Node 0 creates a joinsplit transaction - mytaddr0 = self.nodes[0].getnewaddress() + mytaddr0 = get_coinbase_address(self.nodes[0], 4) myzaddr0 = self.nodes[0].z_getnewaddress('sprout') recipients = [] recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - Decimal('0.0001')}) diff --git a/qa/rpc-tests/wallet_listnotes.py b/qa/rpc-tests/wallet_listnotes.py index 5e5974e5a..98d844f84 100755 --- a/qa/rpc-tests/wallet_listnotes.py +++ b/qa/rpc-tests/wallet_listnotes.py @@ -6,7 +6,12 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x." from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, start_nodes, wait_and_assert_operationid_status +from test_framework.util import ( + assert_equal, + get_coinbase_address, + start_nodes, + wait_and_assert_operationid_status, +) from decimal import Decimal @@ -35,12 +40,10 @@ class WalletListNotes(BitcoinTestFramework): self.sync_all() assert_equal(201, self.nodes[0].getblockcount()) - mining_addr = self.nodes[0].listunspent()[0]['address'] - # Shield coinbase funds (must be a multiple of 10, no change allowed pre-sapling) receive_amount_10 = Decimal('10.0') - Decimal('0.0001') recipients = [{"address":sproutzaddr, "amount":receive_amount_10}] - myopid = self.nodes[0].z_sendmany(mining_addr, recipients) + myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0], 1), recipients) txid_1 = wait_and_assert_operationid_status(self.nodes[0], myopid) self.sync_all() @@ -119,7 +122,7 @@ class WalletListNotes(BitcoinTestFramework): # so send from coin base) receive_amount_2 = Decimal('2.0') - Decimal('0.0001') recipients = [{"address": saplingzaddr, "amount":receive_amount_2}] - myopid = self.nodes[0].z_sendmany(mining_addr, recipients) + myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0], 1), recipients) txid_3 = wait_and_assert_operationid_status(self.nodes[0], myopid) self.sync_all() unspent_tx = self.nodes[0].z_listunspent(0) diff --git a/qa/rpc-tests/wallet_nullifiers.py b/qa/rpc-tests/wallet_nullifiers.py index bbf9e64f3..05a154f5b 100755 --- a/qa/rpc-tests/wallet_nullifiers.py +++ b/qa/rpc-tests/wallet_nullifiers.py @@ -7,7 +7,8 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_true, bitcoind_processes, \ - connect_nodes_bi, start_node, start_nodes, wait_and_assert_operationid_status + connect_nodes_bi, start_node, start_nodes, wait_and_assert_operationid_status, \ + get_coinbase_address from decimal import Decimal @@ -22,7 +23,8 @@ class WalletNullifiersTest (BitcoinTestFramework): myzaddr0 = self.nodes[0].z_getnewaddress('sprout') # send node 0 taddr to zaddr to get out of coinbase - mytaddr = self.nodes[0].getnewaddress() + # Tests using the default cached chain have one address per coinbase output + mytaddr = get_coinbase_address(self.nodes[0], 1) recipients = [] recipients.append({"address":myzaddr0, "amount":Decimal('10.0')-Decimal('0.0001')}) # utxo amount less fee diff --git a/qa/rpc-tests/wallet_overwintertx.py b/qa/rpc-tests/wallet_overwintertx.py index 21dc58a81..4004c8ebe 100755 --- a/qa/rpc-tests/wallet_overwintertx.py +++ b/qa/rpc-tests/wallet_overwintertx.py @@ -7,7 +7,8 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ - start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, assert_greater_than + start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \ + assert_greater_than, get_coinbase_address from test_framework.authproxy import JSONRPCException from decimal import Decimal @@ -34,7 +35,7 @@ class WalletOverwinterTxTest (BitcoinTestFramework): self.sync_all() # Node 0 has reward from blocks 1 to 98 which are spendable. - taddr0 = self.nodes[0].getnewaddress() + taddr0 = get_coinbase_address(self.nodes[0], 98) taddr1 = self.nodes[1].getnewaddress() taddr2 = self.nodes[2].getnewaddress() zaddr2 = self.nodes[2].z_getnewaddress('sprout') diff --git a/qa/rpc-tests/wallet_persistence.py b/qa/rpc-tests/wallet_persistence.py index cdc4af3f7..6b2efb9e9 100755 --- a/qa/rpc-tests/wallet_persistence.py +++ b/qa/rpc-tests/wallet_persistence.py @@ -8,6 +8,7 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_true, + get_coinbase_address, start_nodes, stop_nodes, initialize_chain_clean, connect_nodes_bi, wait_bitcoinds, wait_and_assert_operationid_status @@ -58,7 +59,7 @@ class WalletPersistenceTest (BitcoinTestFramework): self.sync_all() # Node 0 shields funds to Sapling address - taddr0 = self.nodes[0].getnewaddress() + taddr0 = get_coinbase_address(self.nodes[0], 101) recipients = [] recipients.append({"address": sapling_addr, "amount": Decimal('20')}) myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0) diff --git a/qa/rpc-tests/wallet_protectcoinbase.py b/qa/rpc-tests/wallet_protectcoinbase.py index 54fc6c580..7b1152683 100755 --- a/qa/rpc-tests/wallet_protectcoinbase.py +++ b/qa/rpc-tests/wallet_protectcoinbase.py @@ -9,7 +9,8 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException from test_framework.mininode import COIN from test_framework.util import assert_equal, initialize_chain_clean, \ - start_nodes, connect_nodes_bi, wait_and_assert_operationid_status + start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \ + get_coinbase_address import sys import timeit @@ -75,7 +76,7 @@ class WalletProtectCoinbaseTest (BitcoinTestFramework): assert_equal("Coinbase funds can only be sent to a zaddr" in errorString, True) # Prepare to send taddr->zaddr - mytaddr = self.nodes[0].getnewaddress() + mytaddr = get_coinbase_address(self.nodes[0], 4) myzaddr = self.nodes[0].z_getnewaddress('sprout') # Node 3 will test that watch only address utxos are not selected diff --git a/qa/rpc-tests/wallet_sapling.py b/qa/rpc-tests/wallet_sapling.py index 134e83e53..06e564465 100755 --- a/qa/rpc-tests/wallet_sapling.py +++ b/qa/rpc-tests/wallet_sapling.py @@ -9,6 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException from test_framework.util import ( assert_equal, + get_coinbase_address, start_nodes, wait_and_assert_operationid_status, ) @@ -34,18 +35,18 @@ class WalletSaplingTest(BitcoinTestFramework): self.sync_all() # Verify RPCs disallow Sapling value transfer if Sapling is not active - tmp_taddr = self.nodes[3].getnewaddress() + tmp_taddr = get_coinbase_address(self.nodes[3], 1) tmp_zaddr = self.nodes[3].z_getnewaddress('sapling') try: recipients = [] - recipients.append({"address": tmp_zaddr, "amount": Decimal('20')}) + recipients.append({"address": tmp_zaddr, "amount": Decimal('10')}) self.nodes[3].z_sendmany(tmp_taddr, recipients, 1, 0) raise AssertionError("Should have thrown an exception") except JSONRPCException as e: assert_equal("Invalid parameter, Sapling has not activated", e.error['message']) try: recipients = [] - recipients.append({"address": tmp_taddr, "amount": Decimal('20')}) + recipients.append({"address": tmp_taddr, "amount": Decimal('10')}) self.nodes[3].z_sendmany(tmp_zaddr, recipients, 1, 0) raise AssertionError("Should have thrown an exception") except JSONRPCException as e: @@ -75,9 +76,6 @@ class WalletSaplingTest(BitcoinTestFramework): self.nodes[2].generate(2) self.sync_all() - taddr0 = self.nodes[0].getnewaddress() - # Skip over the address containing node 1's coinbase - self.nodes[1].getnewaddress() taddr1 = self.nodes[1].getnewaddress() saplingAddr0 = self.nodes[0].z_getnewaddress('sapling') saplingAddr1 = self.nodes[1].z_getnewaddress('sapling') @@ -95,10 +93,9 @@ class WalletSaplingTest(BitcoinTestFramework): # Node 0 shields some funds # taddr -> Sapling - # -> taddr (change) recipients = [] - recipients.append({"address": saplingAddr0, "amount": Decimal('20')}) - myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0) + recipients.append({"address": saplingAddr0, "amount": Decimal('10')}) + myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0], 1), recipients, 1, 0) mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid) self.sync_all() @@ -107,6 +104,11 @@ class WalletSaplingTest(BitcoinTestFramework): mempool = self.nodes[0].getrawmempool(True) assert(Decimal(mempool[mytxid]['startingpriority']) == Decimal('1E+16')) + # Shield another coinbase UTXO + myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0], 1), recipients, 1, 0) + mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid) + + self.sync_all() self.nodes[2].generate(1) self.sync_all() diff --git a/qa/rpc-tests/wallet_shieldcoinbase.py b/qa/rpc-tests/wallet_shieldcoinbase.py index 232d772c5..6aa08b32a 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase.py +++ b/qa/rpc-tests/wallet_shieldcoinbase.py @@ -9,7 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException from test_framework.util import assert_equal, initialize_chain_clean, \ start_node, connect_nodes_bi, sync_blocks, sync_mempools, \ - wait_and_assert_operationid_status + wait_and_assert_operationid_status, get_coinbase_address from decimal import Decimal @@ -46,17 +46,13 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework): print "Mining blocks..." self.nodes[0].generate(1) - do_not_shield_taddr = self.nodes[0].getnewaddress() - self.nodes[0].generate(4) walletinfo = self.nodes[0].getwalletinfo() assert_equal(walletinfo['immature_balance'], 50) assert_equal(walletinfo['balance'], 0) self.sync_all() self.nodes[2].generate(1) - self.nodes[2].getnewaddress() self.nodes[2].generate(1) - self.nodes[2].getnewaddress() self.nodes[2].generate(1) self.sync_all() self.nodes[1].generate(101) @@ -65,8 +61,10 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework): assert_equal(self.nodes[1].getbalance(), 10) assert_equal(self.nodes[2].getbalance(), 30) + do_not_shield_taddr = get_coinbase_address(self.nodes[0], 1) + # Prepare to send taddr->zaddr - mytaddr = self.nodes[0].getnewaddress() + mytaddr = get_coinbase_address(self.nodes[0], 4) myzaddr = self.nodes[0].z_getnewaddress(self.addr_type) # Shielding will fail when trying to spend from watch-only address @@ -145,7 +143,7 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework): self.sync_all() self.nodes[1].generate(100) self.sync_all() - mytaddr = self.nodes[0].getnewaddress() + mytaddr = get_coinbase_address(self.nodes[0], 800) def verify_locking(first, second, limit): result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, 0, limit) @@ -186,7 +184,7 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework): if self.addr_type == 'sprout': # Verify maximum number of utxos which node 2 can shield is limited by option -mempooltxinputlimit # This option is used when the limit parameter is set to 0. - mytaddr = self.nodes[2].getnewaddress() + mytaddr = get_coinbase_address(self.nodes[2], 20) result = self.nodes[2].z_shieldcoinbase(mytaddr, myzaddr, Decimal('0.0001'), 0) assert_equal(result["shieldingUTXOs"], Decimal('7')) assert_equal(result["remainingUTXOs"], Decimal('13')) @@ -198,7 +196,7 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework): # Verify maximum number of utxos which node 0 can shield is set by default limit parameter of 50 self.nodes[0].generate(200) self.sync_all() - mytaddr = self.nodes[0].getnewaddress() + mytaddr = get_coinbase_address(self.nodes[0], 100) result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, Decimal('0.0001')) assert_equal(result["shieldingUTXOs"], Decimal('50')) assert_equal(result["remainingUTXOs"], Decimal('50')) diff --git a/qa/rpc-tests/wallet_treestate.py b/qa/rpc-tests/wallet_treestate.py index eca42eb69..425cb4641 100755 --- a/qa/rpc-tests/wallet_treestate.py +++ b/qa/rpc-tests/wallet_treestate.py @@ -7,7 +7,8 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Py from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ - start_nodes, connect_nodes_bi, wait_and_assert_operationid_status + start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \ + get_coinbase_address import time from decimal import Decimal @@ -35,7 +36,7 @@ class WalletTreeStateTest (BitcoinTestFramework): self.nodes[1].generate(101) self.sync_all() - mytaddr = self.nodes[0].getnewaddress() # where coins were mined + mytaddr = get_coinbase_address(self.nodes[0], 100) myzaddr = self.nodes[0].z_getnewaddress('sprout') # Spend coinbase utxos to create three notes of 9.99990000 each