mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-26 05:48:20 +01:00
scripted-diff: Use generate* from TestFramework
-BEGIN VERIFY SCRIPT-
sed --regexp-extended -i \
's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \
$(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf')
-END VERIFY SCRIPT-
This commit is contained in:
@@ -58,7 +58,7 @@ class MiningTest(BitcoinTestFramework):
|
||||
self.log.info('Create some old blocks')
|
||||
for t in range(TIME_GENESIS_BLOCK, TIME_GENESIS_BLOCK + 200 * 600, 600):
|
||||
self.nodes[0].setmocktime(t)
|
||||
self.nodes[0].generate(1)
|
||||
self.generate(self.nodes[0], 1)
|
||||
mining_info = self.nodes[0].getmininginfo()
|
||||
assert_equal(mining_info['blocks'], 200)
|
||||
assert_equal(mining_info['currentblocktx'], 0)
|
||||
@@ -109,7 +109,7 @@ class MiningTest(BitcoinTestFramework):
|
||||
assert_equal(witness_commitment, script.hex())
|
||||
|
||||
# Mine a block to leave initial block download and clear the mempool
|
||||
node.generatetoaddress(1, node.get_deterministic_priv_key().address)
|
||||
self.generatetoaddress(node, 1, node.get_deterministic_priv_key().address)
|
||||
tmpl = node.getblocktemplate(NORMAL_GBT_REQUEST_PARAMS)
|
||||
self.log.info("getblocktemplate: Test capability advertised")
|
||||
assert 'proposal' in tmpl['capabilities']
|
||||
@@ -271,7 +271,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.generatetoaddress(10, node.get_deterministic_priv_key().address)
|
||||
self.generatetoaddress(node, 10, node.get_deterministic_priv_key().address)
|
||||
assert_raises_rpc_error(-25, 'time-too-old', lambda: node.submitheader(hexdata=CBlockHeader(bad_block_time).serialize().hex()))
|
||||
assert_raises_rpc_error(-25, 'bad-prevblk', lambda: node.submitheader(hexdata=CBlockHeader(bad_block2).serialize().hex()))
|
||||
node.submitheader(hexdata=CBlockHeader(block).serialize().hex())
|
||||
|
||||
Reference in New Issue
Block a user