Skip to content

Commit 8803c91

Browse files
author
MarcoFalke
committed
Merge #13138: [tests] Remove accounts from wallet_importprunedfunds.py
38040c3 [tests] Remove accounts from wallet_importprunedfunds.py (John Newbery) Pull request description: This was split from #13075 to not block review/merge of that PR. Tree-SHA512: 631d7139ed2bda5222ec395cc75720261e2e1f741dba04723d09fe04ef6cf92222a3679d886026ec33e2db2d1e2fa1a0f36c2451581d0f733a9939a98c7118ab
2 parents b25a4c2 + 38040c3 commit 8803c91

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

test/functional/wallet_importprunedfunds.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
1515
def set_test_params(self):
1616
self.setup_clean_chain = True
1717
self.num_nodes = 2
18-
self.extra_args = [['-deprecatedrpc=accounts']] * 2
1918

2019
def run_test(self):
2120
self.log.info("Mining blocks...")
@@ -74,22 +73,20 @@ def run_test(self):
7473
# Import with no affiliated address
7574
assert_raises_rpc_error(-5, "No addresses", self.nodes[1].importprunedfunds, rawtxn1, proof1)
7675

77-
balance1 = self.nodes[1].getbalance("", 0, True)
76+
balance1 = self.nodes[1].getbalance()
7877
assert_equal(balance1, Decimal(0))
7978

8079
# Import with affiliated address with no rescan
81-
self.nodes[1].importaddress(address2, "add2", False)
80+
self.nodes[1].importaddress(address=address2, rescan=False)
8281
self.nodes[1].importprunedfunds(rawtxn2, proof2)
83-
balance2 = self.nodes[1].getbalance("add2", 0, True)
84-
assert_equal(balance2, Decimal('0.05'))
82+
assert [tx for tx in self.nodes[1].listtransactions(include_watchonly=True) if tx['txid'] == txnid2]
8583

8684
# Import with private key with no rescan
87-
self.nodes[1].importprivkey(privkey=address3_privkey, label="add3", rescan=False)
85+
self.nodes[1].importprivkey(privkey=address3_privkey, rescan=False)
8886
self.nodes[1].importprunedfunds(rawtxn3, proof3)
89-
balance3 = self.nodes[1].getbalance("add3", 0, False)
87+
assert [tx for tx in self.nodes[1].listtransactions() if tx['txid'] == txnid3]
88+
balance3 = self.nodes[1].getbalance()
9089
assert_equal(balance3, Decimal('0.025'))
91-
balance3 = self.nodes[1].getbalance("*", 0, True)
92-
assert_equal(balance3, Decimal('0.075'))
9390

9491
# Addresses Test - after import
9592
address_info = self.nodes[1].getaddressinfo(address1)
@@ -104,17 +101,13 @@ def run_test(self):
104101

105102
# Remove transactions
106103
assert_raises_rpc_error(-8, "Transaction does not exist in wallet.", self.nodes[1].removeprunedfunds, txnid1)
107-
108-
balance1 = self.nodes[1].getbalance("*", 0, True)
109-
assert_equal(balance1, Decimal('0.075'))
104+
assert not [tx for tx in self.nodes[1].listtransactions(include_watchonly=True) if tx['txid'] == txnid1]
110105

111106
self.nodes[1].removeprunedfunds(txnid2)
112-
balance2 = self.nodes[1].getbalance("*", 0, True)
113-
assert_equal(balance2, Decimal('0.025'))
107+
assert not [tx for tx in self.nodes[1].listtransactions(include_watchonly=True) if tx['txid'] == txnid2]
114108

115109
self.nodes[1].removeprunedfunds(txnid3)
116-
balance3 = self.nodes[1].getbalance("*", 0, True)
117-
assert_equal(balance3, Decimal('0.0'))
110+
assert not [tx for tx in self.nodes[1].listtransactions(include_watchonly=True) if tx['txid'] == txnid3]
118111

119112
if __name__ == '__main__':
120113
ImportPrunedFundsTest().main()

0 commit comments

Comments
 (0)