Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/blocktools.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2019 The Bitcoin Core developers | # Copyright (c) 2015-2019 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Utilities for manipulating blocks and transactions.""" | """Utilities for manipulating blocks and transactions.""" | ||||
import unittest | import unittest | ||||
from .script import ( | |||||
CScript, | |||||
CScriptNum, | |||||
CScriptOp, | |||||
OP_1, | |||||
OP_CHECKSIG, | |||||
OP_DUP, | |||||
OP_EQUALVERIFY, | |||||
OP_HASH160, | |||||
OP_RETURN, | |||||
OP_TRUE, | |||||
) | |||||
from .messages import ( | from .messages import ( | ||||
CBlock, | |||||
COIN, | COIN, | ||||
XEC, | XEC, | ||||
CBlock, | |||||
COutPoint, | COutPoint, | ||||
CTransaction, | CTransaction, | ||||
CTxIn, | CTxIn, | ||||
CTxOut, | CTxOut, | ||||
FromHex, | FromHex, | ||||
ToHex, | ToHex, | ||||
) | ) | ||||
from .script import ( | |||||
OP_1, | |||||
OP_CHECKSIG, | |||||
OP_DUP, | |||||
OP_EQUALVERIFY, | |||||
OP_HASH160, | |||||
OP_RETURN, | |||||
OP_TRUE, | |||||
CScript, | |||||
CScriptNum, | |||||
CScriptOp, | |||||
) | |||||
from .txtools import pad_tx | from .txtools import pad_tx | ||||
from .util import assert_equal, satoshi_round | from .util import assert_equal, satoshi_round | ||||
# Genesis block time (regtest) | # Genesis block time (regtest) | ||||
TIME_GENESIS_BLOCK = 1296688602 | TIME_GENESIS_BLOCK = 1296688602 | ||||
def create_block(hashprev, coinbase, ntime=None, *, version=1): | def create_block(hashprev, coinbase, ntime=None, *, version=1): | ||||
▲ Show 20 Lines • Show All 199 Lines • Show Last 20 Lines |