aboutsummaryrefslogtreecommitdiff
path: root/test/functional/mempool_package_onemore.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/mempool_package_onemore.py')
-rwxr-xr-xtest/functional/mempool_package_onemore.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/functional/mempool_package_onemore.py b/test/functional/mempool_package_onemore.py
index 423a5bf2ee..9a981bd5a5 100755
--- a/test/functional/mempool_package_onemore.py
+++ b/test/functional/mempool_package_onemore.py
@@ -7,6 +7,9 @@
size.
"""
+from test_framework.messages import (
+ DEFAULT_ANCESTOR_LIMIT,
+)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
@@ -15,10 +18,6 @@ from test_framework.util import (
from test_framework.wallet import MiniWallet
-MAX_ANCESTORS = 25
-MAX_DESCENDANTS = 25
-
-
class MempoolPackagesTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
@@ -34,19 +33,19 @@ class MempoolPackagesTest(BitcoinTestFramework):
self.wallet = MiniWallet(self.nodes[0])
self.wallet.rescan_utxos()
- # MAX_ANCESTORS transactions off a confirmed tx should be fine
+ # DEFAULT_ANCESTOR_LIMIT transactions off a confirmed tx should be fine
chain = []
utxo = self.wallet.get_utxo()
for _ in range(4):
utxo, utxo2 = self.chain_tx([utxo], num_outputs=2)
chain.append(utxo2)
- for _ in range(MAX_ANCESTORS - 4):
+ for _ in range(DEFAULT_ANCESTOR_LIMIT - 4):
utxo, = self.chain_tx([utxo])
chain.append(utxo)
second_chain, = self.chain_tx([self.wallet.get_utxo()])
- # Check mempool has MAX_ANCESTORS + 1 transactions in it
- assert_equal(len(self.nodes[0].getrawmempool()), MAX_ANCESTORS + 1)
+ # Check mempool has DEFAULT_ANCESTOR_LIMIT + 1 transactions in it
+ assert_equal(len(self.nodes[0].getrawmempool()), DEFAULT_ANCESTOR_LIMIT + 1)
# Adding one more transaction on to the chain should fail.
assert_raises_rpc_error(-26, "too-long-mempool-chain, too many unconfirmed ancestors [limit: 25]", self.chain_tx, [utxo])
@@ -67,7 +66,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
self.nodes[0].sendrawtransaction(replacable_tx.serialize().hex())
# Finally, check that we added two transactions
- assert_equal(len(self.nodes[0].getrawmempool()), MAX_ANCESTORS + 3)
+ assert_equal(len(self.nodes[0].getrawmempool()), DEFAULT_ANCESTOR_LIMIT + 3)
if __name__ == '__main__':