mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-02 08:51:21 +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:
@@ -189,7 +189,7 @@ class BIP68_112_113Test(BitcoinTestFramework):
|
||||
self.log.info("Generate blocks in the past for coinbase outputs.")
|
||||
long_past_time = int(time.time()) - 600 * 1000 # enough to build up to 1000 blocks 10 minutes apart without worrying about getting into the future
|
||||
self.nodes[0].setmocktime(long_past_time - 100) # enough so that the generated blocks will still all be before long_past_time
|
||||
self.coinbase_blocks = self.miniwallet.generate(COINBASE_BLOCK_COUNT) # blocks generated for inputs
|
||||
self.coinbase_blocks = self.generate(self.miniwallet, COINBASE_BLOCK_COUNT) # blocks generated for inputs
|
||||
self.nodes[0].setmocktime(0) # set time back to present so yielded blocks aren't in the future as we advance last_block_time
|
||||
self.tipheight = COINBASE_BLOCK_COUNT # height of the next block to build
|
||||
self.last_block_time = long_past_time
|
||||
@@ -235,7 +235,7 @@ class BIP68_112_113Test(BitcoinTestFramework):
|
||||
bip113input = self.send_generic_input_tx(self.coinbase_blocks)
|
||||
|
||||
self.nodes[0].setmocktime(self.last_block_time + 600)
|
||||
inputblockhash = self.nodes[0].generate(1)[0] # 1 block generated for inputs to be in chain at height 431
|
||||
inputblockhash = self.generate(self.nodes[0], 1)[0] # 1 block generated for inputs to be in chain at height 431
|
||||
self.nodes[0].setmocktime(0)
|
||||
self.tip = int(inputblockhash, 16)
|
||||
self.tipheight += 1
|
||||
|
||||
Reference in New Issue
Block a user