@@ -15,7 +15,6 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
15
15
def set_test_params (self ):
16
16
self .setup_clean_chain = True
17
17
self .num_nodes = 2
18
- self .extra_args = [['-deprecatedrpc=accounts' ]] * 2
19
18
20
19
def run_test (self ):
21
20
self .log .info ("Mining blocks..." )
@@ -74,22 +73,20 @@ def run_test(self):
74
73
# Import with no affiliated address
75
74
assert_raises_rpc_error (- 5 , "No addresses" , self .nodes [1 ].importprunedfunds , rawtxn1 , proof1 )
76
75
77
- balance1 = self .nodes [1 ].getbalance ("" , 0 , True )
76
+ balance1 = self .nodes [1 ].getbalance ()
78
77
assert_equal (balance1 , Decimal (0 ))
79
78
80
79
# Import with affiliated address with no rescan
81
- self .nodes [1 ].importaddress (address2 , "add2" , False )
80
+ self .nodes [1 ].importaddress (address = address2 , rescan = False )
82
81
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 ]
85
83
86
84
# 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 )
88
86
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 ()
90
89
assert_equal (balance3 , Decimal ('0.025' ))
91
- balance3 = self .nodes [1 ].getbalance ("*" , 0 , True )
92
- assert_equal (balance3 , Decimal ('0.075' ))
93
90
94
91
# Addresses Test - after import
95
92
address_info = self .nodes [1 ].getaddressinfo (address1 )
@@ -104,17 +101,13 @@ def run_test(self):
104
101
105
102
# Remove transactions
106
103
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 ]
110
105
111
106
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 ]
114
108
115
109
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 ]
118
111
119
112
if __name__ == '__main__' :
120
113
ImportPrunedFundsTest ().main ()
0 commit comments