mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +02:00
test: introduce generate_to_height
helper, use in rpc_signrawtransaction
This will speed up the test a bit and avoid potential .generate() RPC timeouts (in sub-test `test_signing_with_cltv()`) on slower machines.
This commit is contained in:
@ -15,6 +15,7 @@ from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
find_vout_for_address,
|
||||
generate_to_height,
|
||||
hex_str_to_bytes,
|
||||
)
|
||||
from test_framework.messages import (
|
||||
@ -270,7 +271,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
|
||||
getcontext().prec = 8
|
||||
|
||||
# Make sure CSV is active
|
||||
self.nodes[0].generate(500)
|
||||
generate_to_height(self.nodes[0], 500)
|
||||
assert self.nodes[0].getblockchaininfo()['softforks']['csv']['active']
|
||||
|
||||
# Create a P2WSH script with CSV
|
||||
@ -306,7 +307,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
|
||||
getcontext().prec = 8
|
||||
|
||||
# Make sure CLTV is active
|
||||
self.nodes[0].generate(1500)
|
||||
generate_to_height(self.nodes[0], 1500)
|
||||
assert self.nodes[0].getblockchaininfo()['softforks']['bip65']['active']
|
||||
|
||||
# Create a P2WSH script with CLTV
|
||||
|
Reference in New Issue
Block a user