Skip to content

Commit d5a6adc

Browse files
committed
test: use f-strings in feature_fee_estimation.py
1 parent a2de33c commit d5a6adc

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/functional/feature_fee_estimation.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee
7272
total_in += t["amount"]
7373
tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), b""))
7474
if total_in <= amount + fee:
75-
raise RuntimeError("Insufficient funds: need %d, have %d" % (amount + fee, total_in))
75+
raise RuntimeError(f"Insufficient funds: need {amount + fee}, have {total_in}")
7676
tx.vout.append(CTxOut(int((total_in - amount - fee) * COIN), P2SH_1))
7777
tx.vout.append(CTxOut(int(amount * COIN), P2SH_2))
7878
# These transactions don't need to be signed, but we still have to insert
@@ -124,8 +124,7 @@ def check_raw_estimates(node, fees_seen):
124124
assert_greater_than(feerate, 0)
125125

126126
if feerate + delta < min(fees_seen) or feerate - delta > max(fees_seen):
127-
raise AssertionError("Estimated fee (%f) out of range (%f,%f)"
128-
% (feerate, min(fees_seen), max(fees_seen)))
127+
raise AssertionError(f"Estimated fee ({feerate}) out of range ({min(fees_seen)},{max(fees_seen)})")
129128

130129
def check_smart_estimates(node, fees_seen):
131130
"""Call estimatesmartfee and verify that the estimates meet certain invariants."""
@@ -138,11 +137,9 @@ def check_smart_estimates(node, fees_seen):
138137
assert_greater_than(feerate, 0)
139138

140139
if feerate + delta < min(fees_seen) or feerate - delta > max(fees_seen):
141-
raise AssertionError("Estimated fee (%f) out of range (%f,%f)"
142-
% (feerate, min(fees_seen), max(fees_seen)))
140+
raise AssertionError(f"Estimated fee ({feerate}) out of range ({min(fees_seen)},{max(fees_seen)})")
143141
if feerate - delta > last_feerate:
144-
raise AssertionError("Estimated fee (%f) larger than last fee (%f) for lower number of confirms"
145-
% (feerate, last_feerate))
142+
raise AssertionError(f"Estimated fee ({feerate}) larger than last fee ({last_feerate}) for lower number of confirms")
146143
last_feerate = feerate
147144

148145
if i == 0:

0 commit comments

Comments
 (0)