Skip to content

Commit e13f3fd

Browse files
committed
QA: mining_coin_age_priority: Test both GBT and RPC in one pass
1 parent f8db909 commit e13f3fd

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

test/functional/mining_coin_age_priority.py

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,17 @@ def assert_approximate(a, b):
4141
BTC = Decimal('100000000')
4242

4343
class PriorityTest(BitcoinTestFramework):
44+
def add_options(self, parser):
45+
self.add_wallet_options(parser)
4446

4547
def set_test_params(self):
4648
self.num_nodes = 3
4749
self.testmsg_num = 0
4850

49-
def add_options(self, parser):
50-
self.add_wallet_options(parser)
51-
parser.add_argument("--gbt", dest="test_gbt", default=False, action="store_true",
52-
help="Test priorities used by GBT")
53-
5451
def setup_nodes(self):
55-
ppopt = []
56-
if self.options.test_gbt:
57-
ppopt.append('-printpriority')
58-
5952
self.extra_args = [
6053
['-blockmaxsize=0'],
61-
['-blockprioritysize=1000000', '-blockmaxsize=1000000'] + ppopt,
54+
['-blockprioritysize=1000000', '-blockmaxsize=1000000', '-printpriority'],
6255
['-blockmaxsize=0'],
6356
]
6457

@@ -67,19 +60,18 @@ def setup_nodes(self):
6760
def assert_prio(self, txid, starting, current):
6861
node = self.nodes[1]
6962

70-
if self.options.test_gbt:
71-
tmpl = node.getblocktemplate({'rules':('segwit',)})
72-
tmplentry = None
73-
for tx in tmpl['transactions']:
74-
if tx['txid'] == txid:
75-
tmplentry = tx
76-
break
77-
# GBT does not expose starting priority, so we don't check that
78-
assert_approximate(tmplentry['priority'], current)
79-
else:
80-
mempoolentry = node.getrawmempool(True)[txid]
81-
assert_approximate(mempoolentry['startingpriority'], starting)
82-
assert_approximate(mempoolentry['currentpriority'], current)
63+
tmpl = node.getblocktemplate({'rules':('segwit',)})
64+
tmplentry = None
65+
for tx in tmpl['transactions']:
66+
if tx['txid'] == txid:
67+
tmplentry = tx
68+
break
69+
# GBT does not expose starting priority, so we don't check that
70+
assert_approximate(tmplentry['priority'], current)
71+
72+
mempoolentry = node.getrawmempool(True)[txid]
73+
assert_approximate(mempoolentry['startingpriority'], starting)
74+
assert_approximate(mempoolentry['currentpriority'], current)
8375

8476
def testmsg(self, msg):
8577
self.testmsg_num += 1

test/functional/test_runner.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@
193193
'wallet_txn_clone.py',
194194
'wallet_txn_clone.py --segwit',
195195
'mining_coin_age_priority.py',
196-
'mining_coin_age_priority.py --gbt',
197196
'rpc_getchaintips.py',
198197
'rpc_misc.py',
199198
'p2p_1p1c_network.py',

0 commit comments

Comments
 (0)