test: Add basic test for BIP34

This commit is contained in:
MarcoFalke committed 2018-12-29 19:39:37 +01:00
1 parent cbb91cd0ec
commit fab17e8272
3 files changed
+26 -13

No files matched your search

+2 -1
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)