Changeset View
Changeset View
Standalone View
Standalone View
test/functional/bip9-softforks.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 | ||||
# 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. | ||||
from test_framework.blockstore import BlockStore | |||||
from test_framework.test_framework import ComparisonTestFramework | |||||
from test_framework.util import * | |||||
from test_framework.mininode import CTransaction, NetworkThread | |||||
from test_framework.blocktools import create_coinbase, create_block | |||||
from test_framework.comptool import TestInstance, TestManager | |||||
from test_framework.script import CScript, OP_1NEGATE, OP_CHECKSEQUENCEVERIFY, OP_DROP | |||||
from io import BytesIO | |||||
import time | |||||
import itertools | |||||
''' | ''' | ||||
This test is meant to exercise BIP forks | This test is meant to exercise BIP forks | ||||
Connect to a single node. | Connect to a single node. | ||||
regtest lock-in with 108/144 block signalling | regtest lock-in with 108/144 block signalling | ||||
activation after a further 144 blocks | activation after a further 144 blocks | ||||
mine 2 block and save coinbases for later use | mine 2 block and save coinbases for later use | ||||
mine 141 blocks to transition from DEFINED to STARTED | mine 141 blocks to transition from DEFINED to STARTED | ||||
mine 100 blocks signalling readiness and 44 not in order to fail to change state this period | mine 100 blocks signalling readiness and 44 not in order to fail to change state this period | ||||
mine 108 blocks signalling readiness and 36 blocks not signalling readiness (STARTED->LOCKED_IN) | mine 108 blocks signalling readiness and 36 blocks not signalling readiness (STARTED->LOCKED_IN) | ||||
mine a further 143 blocks (LOCKED_IN) | mine a further 143 blocks (LOCKED_IN) | ||||
test that enforcement has not triggered (which triggers ACTIVE) | test that enforcement has not triggered (which triggers ACTIVE) | ||||
test that enforcement has triggered | test that enforcement has triggered | ||||
''' | ''' | ||||
from test_framework.test_framework import ComparisonTestFramework | |||||
from test_framework.util import * | |||||
from test_framework.mininode import CTransaction, NetworkThread | |||||
from test_framework.blocktools import create_coinbase, create_block | |||||
from test_framework.comptool import TestInstance, TestManager | |||||
from test_framework.script import CScript, OP_1NEGATE, OP_CHECKSEQUENCEVERIFY, OP_DROP | |||||
from io import BytesIO | |||||
import time | |||||
import shutil | |||||
import itertools | |||||
class BIP9SoftForksTest(ComparisonTestFramework): | class BIP9SoftForksTest(ComparisonTestFramework): | ||||
def __init__(self): | def __init__(self): | ||||
super().__init__() | super().__init__() | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.extra_args = [['-whitelist=127.0.0.1']] | self.extra_args = [['-whitelist=127.0.0.1']] | ||||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |