From e3273e03b1aea0c3ee3aeca802c984ab007f91ed Mon Sep 17 00:00:00 2001 From: glozow Date: Mon, 11 Aug 2025 16:58:21 -0400 Subject: [PATCH] [test] explicitly check default -minrelaytxfee and -incrementalrelayfee Github-Pull: #33106 Rebased-From: 1fbee5d7b61b83e68e4230c8a97ca308de92c4c3 --- test/functional/mempool_accept.py | 9 +++++++++ test/functional/test_framework/mempool_util.py | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py index 4d08575255b..1380f4e57b6 100755 --- a/test/functional/mempool_accept.py +++ b/test/functional/mempool_accept.py @@ -9,6 +9,10 @@ from decimal import Decimal import math from test_framework.test_framework import BitcoinTestFramework +from test_framework.mempool_util import ( + DEFAULT_MIN_RELAY_TX_FEE, + DEFAULT_INCREMENTAL_RELAY_FEE, +) from test_framework.messages import ( MAX_BIP125_RBF_SEQUENCE, COIN, @@ -80,6 +84,11 @@ class MempoolAcceptanceTest(BitcoinTestFramework): assert_equal(node.getblockcount(), 200) assert_equal(node.getmempoolinfo()['size'], self.mempool_size) + self.log.info("Check default settings") + # Settings are listed in BTC/kvB + assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN) + assert_equal(node.getmempoolinfo()['incrementalrelayfee'], Decimal(DEFAULT_INCREMENTAL_RELAY_FEE) / COIN) + self.log.info('Should not accept garbage to testmempoolaccept') assert_raises_rpc_error(-3, 'JSON value of type string is not of expected type array', lambda: node.testmempoolaccept(rawtxs='ff00baar')) assert_raises_rpc_error(-8, 'Array must contain between 1 and 25 transactions.', lambda: node.testmempoolaccept(rawtxs=['ff22']*26)) diff --git a/test/functional/test_framework/mempool_util.py b/test/functional/test_framework/mempool_util.py index 148cc935ed5..9c514a7d548 100644 --- a/test/functional/test_framework/mempool_util.py +++ b/test/functional/test_framework/mempool_util.py @@ -18,6 +18,10 @@ from .wallet import ( MiniWallet, ) +# Default for -minrelaytxfee in sat/kvB +DEFAULT_MIN_RELAY_TX_FEE = 1000 +# Default for -incrementalrelayfee in sat/kvB +DEFAULT_INCREMENTAL_RELAY_FEE = 1000 def fill_mempool(test_framework, node): """Fill mempool until eviction.