Skip to content

Commit 1fbee5d

Browse files
committed
[test] explicitly check default -minrelaytxfee and -incrementalrelayfee
1 parent 72dc184 commit 1fbee5d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

test/functional/mempool_accept.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
from test_framework.test_framework import BitcoinTestFramework
1212
from test_framework.blocktools import MAX_STANDARD_TX_WEIGHT
13+
from test_framework.mempool_util import (
14+
DEFAULT_MIN_RELAY_TX_FEE,
15+
DEFAULT_INCREMENTAL_RELAY_FEE,
16+
)
1317
from test_framework.messages import (
1418
MAX_BIP125_RBF_SEQUENCE,
1519
COIN,
@@ -85,6 +89,11 @@ def run_test(self):
8589
assert_equal(node.getblockcount(), 200)
8690
assert_equal(node.getmempoolinfo()['size'], self.mempool_size)
8791

92+
self.log.info("Check default settings")
93+
# Settings are listed in BTC/kvB
94+
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN)
95+
assert_equal(node.getmempoolinfo()['incrementalrelayfee'], Decimal(DEFAULT_INCREMENTAL_RELAY_FEE) / COIN)
96+
8897
self.log.info('Should not accept garbage to testmempoolaccept')
8998
assert_raises_rpc_error(-3, 'JSON value of type string is not of expected type array', lambda: node.testmempoolaccept(rawtxs='ff00baar'))
9099
assert_raises_rpc_error(-8, 'Array must contain between 1 and 25 transactions.', lambda: node.testmempoolaccept(rawtxs=['ff22']*26))

test/functional/test_framework/mempool_util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
MiniWallet,
3131
)
3232

33+
# Default for -minrelaytxfee in sat/kvB
34+
DEFAULT_MIN_RELAY_TX_FEE = 1000
35+
# Default for -incrementalrelayfee in sat/kvB
36+
DEFAULT_INCREMENTAL_RELAY_FEE = 1000
37+
3338
def assert_mempool_contents(test_framework, node, expected=None, sync=True):
3439
"""Assert that all transactions in expected are in the mempool,
3540
and no additional ones exist. 'expected' is an array of

0 commit comments

Comments
 (0)