v31.1-roots.1 · Commit 4: [PATCH 04/17] feat(mining): preserve Roots priority and template policies
test/functional/mempool_dynamic_dust.py
Before: test/functional/mempool_dynamic_dust.py · After: test/functional/mempool_dynamic_dust.py
File metadata
index de571c276440f5717bbefa99d4307e2e5f202fed..56078d36fd9f35bc3f8703cfe97ae90a36e63456 100644
Download original patch · Release notes
Diff rows 1–22 of 22. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
test/functional/mempool_dynamic_dust.py
CHANGED
|
@@ -54,9 +54,20 @@ class DynamicDustTest(BitcoinTestFramework):
|
|
|
54
54
|
second = self.probe(wallet, value=100)
|
|
55
55
|
second_id = node.sendrawtransaction(second.serialize().hex())
|
|
56
56
|
assert_equal(node.getmempoolentry(second_id)["fees"]["modified"], Decimal(100000 - 10900) / COIN)
|
|
57
|
-
# Existing entries retain their admission deficit, and valid blocks use
|
|
58
|
-
# actual fees even after the live policy rate changes.
|
|
57
|
+
# Priority/residual templates retain immutable deficits after publication,
|
|
58
|
+
# but their fee fields and coinbase reward use actual fees.
|
|
59
|
+
template = node.getblocktemplate({"rules": ["segwit"]})
|
|
60
|
+
fees = {entry["txid"]: entry["fee"] for entry in template["transactions"]}
|
|
61
|
+
assert_equal(fees[first_id], 100000)
|
|
62
|
+
assert_equal(fees[second_id], 100000)
|
|
63
|
+
subsidy = Decimal(50) / (2 ** ((node.getblockcount() + 1) // 150))
|
|
64
|
+
expected_reward = subsidy + Decimal(sum(fees.values())) / COIN
|
|
65
|
+
assert_equal(Decimal(template["coinbasevalue"]) / COIN, expected_reward)
|
|
59
66
|
self.generate(wallet, 1)
|
|
67
|
+
mined = node.getblock(node.getbestblockhash(), 2)
|
|
68
|
+
assert first_id in [entry["txid"] for entry in mined["tx"]]
|
|
69
|
+
assert second_id in [entry["txid"] for entry in mined["tx"]]
|
|
70
|
+
assert_equal(sum(output["value"] for output in mined["tx"][0]["vout"]), expected_reward)
|
|
60
71
|
with node.assert_debug_log(["Updating dust feerate to 3.000 sat/vB"]):
|
|
61
72
|
node.mockscheduler(901)
|
|
62
73
|
wallet.rescan_utxos()
|