mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 12:03:04 +02:00
Changed functional tests which do not require wallets to run without
skipping .Addreses #14216. Changed get_deterministic_priv_key() to a named tuple
This commit is contained in:
@@ -38,9 +38,6 @@ class MiningTest(BitcoinTestFramework):
|
||||
self.num_nodes = 2
|
||||
self.setup_clean_chain = False
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_wallet()
|
||||
|
||||
def run_test(self):
|
||||
node = self.nodes[0]
|
||||
|
||||
@@ -61,7 +58,7 @@ class MiningTest(BitcoinTestFramework):
|
||||
assert_equal(mining_info['pooledtx'], 0)
|
||||
|
||||
# Mine a block to leave initial block download
|
||||
node.generate(1)
|
||||
node.generatetoaddress(1, node.get_deterministic_priv_key().address)
|
||||
tmpl = node.getblocktemplate()
|
||||
self.log.info("getblocktemplate: Test capability advertised")
|
||||
assert 'proposal' in tmpl['capabilities']
|
||||
@@ -212,7 +209,7 @@ class MiningTest(BitcoinTestFramework):
|
||||
assert chain_tip(block.hash, status='active', branchlen=0) in node.getchaintips()
|
||||
|
||||
# Building a few blocks should give the same results
|
||||
node.generate(10)
|
||||
node.generatetoaddress(10, node.get_deterministic_priv_key().address)
|
||||
assert_raises_rpc_error(-25, 'time-too-old', lambda: node.submitheader(hexdata=b2x(CBlockHeader(bad_block_time).serialize())))
|
||||
assert_raises_rpc_error(-25, 'bad-prevblk', lambda: node.submitheader(hexdata=b2x(CBlockHeader(bad_block2).serialize())))
|
||||
node.submitheader(hexdata=b2x(CBlockHeader(block).serialize()))
|
||||
|
Reference in New Issue
Block a user