[test] explicitly check default -minrelaytxfee and -incrementalrelayfee

Github-Pull: #33106
Rebased-From:  1fbee5d7b6
This commit is contained in:
glozow
2025-08-11 16:58:21 -04:00
parent 6b5396c4b1
commit 567c3ee3cb
2 changed files with 13 additions and 0 deletions

View File

@@ -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,
@@ -81,6 +85,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))

View File

@@ -20,6 +20,10 @@ from .wallet import (
)
ORPHAN_TX_EXPIRE_TIME = 1200
# Default for -minrelaytxfee in sat/kvB
DEFAULT_MIN_RELAY_TX_FEE = 1000
# Default for -incrementalrelayfee in sat/kvB
DEFAULT_INCREMENTAL_RELAY_FEE = 1000
def assert_mempool_contents(test_framework, node, expected=None, sync=True):
"""Assert that all transactions in expected are in the mempool,