Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-p2p-fullblocktest.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2016 The Bitcoin Core developers | # Copyright (c) 2015-2016 The Bitcoin Core developers | ||||
# Copyright (c) 2017 The Bitcoin developers | # Copyright (c) 2017 The Bitcoin 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. | ||||
""" | """ | ||||
This test checks simple acceptance of bigger blocks via p2p. | This test checks simple acceptance of bigger blocks via p2p. | ||||
It is derived from the much more complex p2p-fullblocktest. | It is derived from the much more complex p2p-fullblocktest. | ||||
The intention is that small tests can be derived from this one, or | The intention is that small tests can be derived from this one, or | ||||
this one can be extended, to cover the checks done for bigger blocks | this one can be extended, to cover the checks done for bigger blocks | ||||
(e.g. sigops limits). | (e.g. sigops limits). | ||||
""" | """ | ||||
from test_framework.test_framework import ComparisonTestFramework | from collections import deque | ||||
from test_framework.util import assert_equal | import random | ||||
from test_framework.comptool import TestManager, TestInstance, RejectResult | |||||
from test_framework.blocktools import * | |||||
import time | import time | ||||
from test_framework.blocktools import ( | |||||
create_block, | |||||
create_coinbase, | |||||
create_transaction, | |||||
make_conform_to_ctor, | |||||
) | |||||
from test_framework.cdefs import ( | |||||
MAX_BLOCK_SIGOPS_PER_MB, | |||||
MAX_TX_SIGOPS_COUNT, | |||||
ONE_MEGABYTE, | |||||
) | |||||
from test_framework.comptool import RejectResult, TestInstance, TestManager | |||||
from test_framework.key import CECKey | from test_framework.key import CECKey | ||||
from test_framework.script import * | from test_framework.messages import ( | ||||
from test_framework.cdefs import (ONE_MEGABYTE, MAX_BLOCK_SIGOPS_PER_MB, | COutPoint, | ||||
MAX_TX_SIGOPS_COUNT) | CTransaction, | ||||
from collections import deque | CTxIn, | ||||
CTxOut, | |||||
ser_compact_size, | |||||
ToHex, | |||||
) | |||||
from test_framework.mininode import network_thread_start | |||||
from test_framework.script import ( | |||||
CScript, | |||||
hash160, | |||||
OP_2DUP, | |||||
OP_CHECKSIG, | |||||
OP_CHECKSIGVERIFY, | |||||
OP_EQUAL, | |||||
OP_HASH160, | |||||
OP_RETURN, | |||||
OP_TRUE, | |||||
SIGHASH_ALL, | |||||
SIGHASH_FORKID, | |||||
SignatureHashForkId, | |||||
) | |||||
from test_framework.test_framework import ComparisonTestFramework | |||||
from test_framework.util import assert_equal | |||||
REPLAY_PROTECTION_START_TIME = 2000000000 | REPLAY_PROTECTION_START_TIME = 2000000000 | ||||
class PreviousSpendableOutput(): | class PreviousSpendableOutput(): | ||||
def __init__(self, tx=CTransaction(), n=-1): | def __init__(self, tx=CTransaction(), n=-1): | ||||
self.tx = tx | self.tx = tx | ||||
▲ Show 20 Lines • Show All 371 Lines • Show Last 20 Lines |