Skip to content

Commit a0eafc1

Browse files
committed
functional test: Deduplicate assert_mempool_contents()
Recently added mempool_util implementation probably evolved in parallel with the package RBF one before being submitted as part of ephemeral dust in e2e30e8.
1 parent f34fe08 commit a0eafc1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

test/functional/mempool_package_rbf.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
DEFAULT_FEE,
2020
MiniWallet,
2121
)
22+
from test_framework import mempool_util
2223

2324
MAX_REPLACEMENT_CANDIDATES = 100
2425

@@ -37,15 +38,7 @@ def set_test_params(self):
3738
]] * self.num_nodes
3839

3940
def assert_mempool_contents(self, expected=None):
40-
"""Assert that all transactions in expected are in the mempool,
41-
and no additional ones exist.
42-
"""
43-
if not expected:
44-
expected = []
45-
mempool = self.nodes[0].getrawmempool(verbose=False)
46-
assert_equal(len(mempool), len(expected))
47-
for tx in expected:
48-
assert tx.rehash() in mempool
41+
mempool_util.assert_mempool_contents(self, self.nodes[0], expected, sync=False)
4942

5043
def create_simple_package(self, parent_coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE, heavy_child=False):
5144
"""Create a 1 parent 1 child package using the coin passed in as the parent's input. The

0 commit comments

Comments
 (0)