mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
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 e2e30e89ba
.
This commit is contained in:
parent
f34fe0806a
commit
a0eafc10f9
1 changed files with 2 additions and 9 deletions
|
@ -19,6 +19,7 @@ from test_framework.wallet import (
|
||||||
DEFAULT_FEE,
|
DEFAULT_FEE,
|
||||||
MiniWallet,
|
MiniWallet,
|
||||||
)
|
)
|
||||||
|
from test_framework import mempool_util
|
||||||
|
|
||||||
MAX_REPLACEMENT_CANDIDATES = 100
|
MAX_REPLACEMENT_CANDIDATES = 100
|
||||||
|
|
||||||
|
@ -37,15 +38,7 @@ class PackageRBFTest(BitcoinTestFramework):
|
||||||
]] * self.num_nodes
|
]] * self.num_nodes
|
||||||
|
|
||||||
def assert_mempool_contents(self, expected=None):
|
def assert_mempool_contents(self, expected=None):
|
||||||
"""Assert that all transactions in expected are in the mempool,
|
mempool_util.assert_mempool_contents(self, self.nodes[0], expected, sync=False)
|
||||||
and no additional ones exist.
|
|
||||||
"""
|
|
||||||
if not expected:
|
|
||||||
expected = []
|
|
||||||
mempool = self.nodes[0].getrawmempool(verbose=False)
|
|
||||||
assert_equal(len(mempool), len(expected))
|
|
||||||
for tx in expected:
|
|
||||||
assert tx.rehash() in mempool
|
|
||||||
|
|
||||||
def create_simple_package(self, parent_coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE, heavy_child=False):
|
def create_simple_package(self, parent_coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE, heavy_child=False):
|
||||||
"""Create a 1 parent 1 child package using the coin passed in as the parent's input. The
|
"""Create a 1 parent 1 child package using the coin passed in as the parent's input. The
|
||||||
|
|
Loading…
Add table
Reference in a new issue