mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
QA: mining_coin_age_priority: Test both GBT and RPC in one pass
This commit is contained in:
parent
f8db9099e0
commit
e13f3fd693
@ -41,24 +41,17 @@ def assert_approximate(a, b):
|
||||
BTC = Decimal('100000000')
|
||||
|
||||
class PriorityTest(BitcoinTestFramework):
|
||||
def add_options(self, parser):
|
||||
self.add_wallet_options(parser)
|
||||
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 3
|
||||
self.testmsg_num = 0
|
||||
|
||||
def add_options(self, parser):
|
||||
self.add_wallet_options(parser)
|
||||
parser.add_argument("--gbt", dest="test_gbt", default=False, action="store_true",
|
||||
help="Test priorities used by GBT")
|
||||
|
||||
def setup_nodes(self):
|
||||
ppopt = []
|
||||
if self.options.test_gbt:
|
||||
ppopt.append('-printpriority')
|
||||
|
||||
self.extra_args = [
|
||||
['-blockmaxsize=0'],
|
||||
['-blockprioritysize=1000000', '-blockmaxsize=1000000'] + ppopt,
|
||||
['-blockprioritysize=1000000', '-blockmaxsize=1000000', '-printpriority'],
|
||||
['-blockmaxsize=0'],
|
||||
]
|
||||
|
||||
@ -67,7 +60,6 @@ class PriorityTest(BitcoinTestFramework):
|
||||
def assert_prio(self, txid, starting, current):
|
||||
node = self.nodes[1]
|
||||
|
||||
if self.options.test_gbt:
|
||||
tmpl = node.getblocktemplate({'rules':('segwit',)})
|
||||
tmplentry = None
|
||||
for tx in tmpl['transactions']:
|
||||
@ -76,7 +68,7 @@ class PriorityTest(BitcoinTestFramework):
|
||||
break
|
||||
# GBT does not expose starting priority, so we don't check that
|
||||
assert_approximate(tmplentry['priority'], current)
|
||||
else:
|
||||
|
||||
mempoolentry = node.getrawmempool(True)[txid]
|
||||
assert_approximate(mempoolentry['startingpriority'], starting)
|
||||
assert_approximate(mempoolentry['currentpriority'], current)
|
||||
|
@ -193,7 +193,6 @@ BASE_SCRIPTS = [
|
||||
'wallet_txn_clone.py',
|
||||
'wallet_txn_clone.py --segwit',
|
||||
'mining_coin_age_priority.py',
|
||||
'mining_coin_age_priority.py --gbt',
|
||||
'rpc_getchaintips.py',
|
||||
'rpc_misc.py',
|
||||
'p2p_1p1c_network.py',
|
||||
|
Loading…
Reference in New Issue
Block a user