Skip to content

Commit faff85a

Browse files
author
MarcoFalke
committed
test: Format feature_fee_estimation with pep8
1 parent d759b5d commit faff85a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/functional/feature_fee_estimation.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# Associated ScriptSig's to spend satisfy P2SH_1 and P2SH_2
2929
SCRIPT_SIG = [CScript([OP_TRUE, REDEEM_SCRIPT_1]), CScript([OP_TRUE, REDEEM_SCRIPT_2])]
3030

31+
3132
def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee_increment):
3233
"""Create and send a transaction with a random fee.
3334
@@ -69,6 +70,7 @@ def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee
6970

7071
return (ToHex(tx), fee)
7172

73+
7274
def split_inputs(from_node, txins, txouts, initial_split=False):
7375
"""Generate a lot of inputs so we can generate a ton of transactions.
7476
@@ -97,6 +99,7 @@ def split_inputs(from_node, txins, txouts, initial_split=False):
9799
txouts.append({"txid": txid, "vout": 0, "amount": half_change})
98100
txouts.append({"txid": txid, "vout": 1, "amount": rem_change})
99101

102+
100103
def check_estimates(node, fees_seen):
101104
"""Call estimatesmartfee and verify that the estimates meet certain invariants."""
102105

@@ -189,22 +192,22 @@ def run_test(self):
189192
split_inputs(self.nodes[0], self.nodes[0].listunspent(0), self.txouts, True)
190193

191194
# Mine
192-
while (len(self.nodes[0].getrawmempool()) > 0):
195+
while len(self.nodes[0].getrawmempool()) > 0:
193196
self.nodes[0].generate(1)
194197

195198
# Repeatedly split those 2 outputs, doubling twice for each rep
196199
# Use txouts to monitor the available utxo, since these won't be tracked in wallet
197200
reps = 0
198-
while (reps < 5):
201+
while reps < 5:
199202
# Double txouts to txouts2
200-
while (len(self.txouts) > 0):
203+
while len(self.txouts) > 0:
201204
split_inputs(self.nodes[0], self.txouts, self.txouts2)
202-
while (len(self.nodes[0].getrawmempool()) > 0):
205+
while len(self.nodes[0].getrawmempool()) > 0:
203206
self.nodes[0].generate(1)
204207
# Double txouts2 to txouts
205-
while (len(self.txouts2) > 0):
208+
while len(self.txouts2) > 0:
206209
split_inputs(self.nodes[0], self.txouts2, self.txouts)
207-
while (len(self.nodes[0].getrawmempool()) > 0):
210+
while len(self.nodes[0].getrawmempool()) > 0:
208211
self.nodes[0].generate(1)
209212
reps += 1
210213
self.log.info("Finished splitting")
@@ -244,5 +247,6 @@ def run_test(self):
244247
self.log.info("Final estimates after emptying mempools")
245248
check_estimates(self.nodes[1], self.fees_per_kb)
246249

250+
247251
if __name__ == '__main__':
248252
EstimateFeeTest().main()

0 commit comments

Comments
 (0)