test: Add basic test for BIP34

This commit is contained in:
MarcoFalke
2018-12-29 18:19:10 +01:00
parent cbb91cd0ec
commit fab17e8272
3 changed files with 26 additions and 13 deletions

View File

@ -44,9 +44,10 @@ from io import BytesIO
# From BIP141
WITNESS_COMMITMENT_HEADER = b"\xaa\x21\xa9\xed"
def create_block(hashprev, coinbase, ntime=None):
def create_block(hashprev, coinbase, ntime=None, *, version=1):
"""Create a block (with regtest difficulty)."""
block = CBlock()
block.nVersion = version
if ntime is None:
import time
block.nTime = int(time.time() + 600)