@@ -68,7 +68,7 @@ def run_test(self):
68
68
69
69
# In mempool txs from self should increase balance from change
70
70
newbalance = self .nodes [0 ].getbalance ()
71
- assert (newbalance == balance - Decimal ("30" ) + Decimal ("24.9996" ))
71
+ assert_equal (newbalance , balance - Decimal ("30" ) + Decimal ("24.9996" ))
72
72
balance = newbalance
73
73
74
74
# Restart the node with a higher min relay fee so the parent tx is no longer in mempool
@@ -78,16 +78,16 @@ def run_test(self):
78
78
self .nodes [0 ]= start_node (0 , self .options .tmpdir , ["-debug" ,"-logtimemicros" ,"-minrelaytxfee=0.0001" ])
79
79
80
80
# Verify txs no longer in mempool
81
- assert (len (self .nodes [0 ].getrawmempool ()) == 0 )
81
+ assert_equal (len (self .nodes [0 ].getrawmempool ()), 0 )
82
82
83
83
# Not in mempool txs from self should only reduce balance
84
84
# inputs are still spent, but change not received
85
85
newbalance = self .nodes [0 ].getbalance ()
86
- assert (newbalance == balance - Decimal ("24.9996" ))
86
+ assert_equal (newbalance , balance - Decimal ("24.9996" ))
87
87
# Unconfirmed received funds that are not in mempool, also shouldn't show
88
88
# up in unconfirmed balance
89
89
unconfbalance = self .nodes [0 ].getunconfirmedbalance () + self .nodes [0 ].getbalance ()
90
- assert (unconfbalance == newbalance )
90
+ assert_equal (unconfbalance , newbalance )
91
91
# Also shouldn't show up in listunspent
92
92
assert (not txABC2 in [utxo ["txid" ] for utxo in self .nodes [0 ].listunspent (0 )])
93
93
balance = newbalance
@@ -96,35 +96,35 @@ def run_test(self):
96
96
# including that the child tx was also abandoned
97
97
self .nodes [0 ].abandontransaction (txAB1 )
98
98
newbalance = self .nodes [0 ].getbalance ()
99
- assert (newbalance == balance + Decimal ("30" ))
99
+ assert_equal (newbalance , balance + Decimal ("30" ))
100
100
balance = newbalance
101
101
102
102
# Verify that even with a low min relay fee, the tx is not reaccepted from wallet on startup once abandoned
103
103
stop_node (self .nodes [0 ],0 )
104
104
self .nodes [0 ]= start_node (0 , self .options .tmpdir , ["-debug" ,"-logtimemicros" ,"-minrelaytxfee=0.00001" ])
105
- assert (len (self .nodes [0 ].getrawmempool ()) == 0 )
106
- assert (self .nodes [0 ].getbalance () == balance )
105
+ assert_equal (len (self .nodes [0 ].getrawmempool ()), 0 )
106
+ assert_equal (self .nodes [0 ].getbalance (), balance )
107
107
108
108
# But if its received again then it is unabandoned
109
109
# And since now in mempool, the change is available
110
110
# But its child tx remains abandoned
111
111
self .nodes [0 ].sendrawtransaction (signed ["hex" ])
112
112
newbalance = self .nodes [0 ].getbalance ()
113
- assert (newbalance == balance - Decimal ("20" ) + Decimal ("14.99998" ))
113
+ assert_equal (newbalance , balance - Decimal ("20" ) + Decimal ("14.99998" ))
114
114
balance = newbalance
115
115
116
116
# Send child tx again so its unabandoned
117
117
self .nodes [0 ].sendrawtransaction (signed2 ["hex" ])
118
118
newbalance = self .nodes [0 ].getbalance ()
119
- assert (newbalance == balance - Decimal ("10" ) - Decimal ("14.99998" ) + Decimal ("24.9996" ))
119
+ assert_equal (newbalance , balance - Decimal ("10" ) - Decimal ("14.99998" ) + Decimal ("24.9996" ))
120
120
balance = newbalance
121
121
122
122
# Remove using high relay fee again
123
123
stop_node (self .nodes [0 ],0 )
124
124
self .nodes [0 ]= start_node (0 , self .options .tmpdir , ["-debug" ,"-logtimemicros" ,"-minrelaytxfee=0.0001" ])
125
- assert (len (self .nodes [0 ].getrawmempool ()) == 0 )
125
+ assert_equal (len (self .nodes [0 ].getrawmempool ()), 0 )
126
126
newbalance = self .nodes [0 ].getbalance ()
127
- assert (newbalance == balance - Decimal ("24.9996" ))
127
+ assert_equal (newbalance , balance - Decimal ("24.9996" ))
128
128
balance = newbalance
129
129
130
130
# Create a double spend of AB1 by spending again from only A's 10 output
@@ -143,15 +143,15 @@ def run_test(self):
143
143
144
144
# Verify that B and C's 10 BTC outputs are available for spending again because AB1 is now conflicted
145
145
newbalance = self .nodes [0 ].getbalance ()
146
- assert (newbalance == balance + Decimal ("20" ))
146
+ assert_equal (newbalance , balance + Decimal ("20" ))
147
147
balance = newbalance
148
148
149
149
# There is currently a minor bug around this and so this test doesn't work. See Issue #7315
150
150
# Invalidate the block with the double spend and B's 10 BTC output should no longer be available
151
151
# Don't think C's should either
152
152
self .nodes [0 ].invalidateblock (self .nodes [0 ].getbestblockhash ())
153
153
newbalance = self .nodes [0 ].getbalance ()
154
- #assert (newbalance == balance - Decimal("10"))
154
+ #assert_equal (newbalance, balance - Decimal("10"))
155
155
print ("If balance has not declined after invalidateblock then out of mempool wallet tx which is no longer" )
156
156
print ("conflicted has not resumed causing its inputs to be seen as spent. See Issue #7315" )
157
157
print (str (balance ) + " -> " + str (newbalance ) + " ?" )
0 commit comments