Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-replay-protection.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 activation of UAHF and the different consensus | This test checks activation of UAHF and the different consensus | ||||
related to this activation. | related to this activation. | ||||
It is derived from the much more complex p2p-fullblocktest. | It is derived from the much more complex p2p-fullblocktest. | ||||
""" | """ | ||||
from test_framework.test_framework import ComparisonTestFramework | |||||
from test_framework.util import assert_equal, assert_raises_rpc_error | |||||
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.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 ( | ||||
COIN, | |||||
COutPoint, | |||||
CTransaction, | |||||
CTxIn, | |||||
CTxOut, | |||||
ToHex, | |||||
) | |||||
from test_framework.mininode import network_thread_start | |||||
from test_framework.script import ( | |||||
CScript, | |||||
OP_CHECKSIG, | |||||
OP_TRUE, | |||||
SIGHASH_ALL, | |||||
SIGHASH_FORKID, | |||||
SignatureHashForkId, | |||||
) | |||||
from test_framework.test_framework import ComparisonTestFramework | |||||
from test_framework.util import assert_equal, assert_raises_rpc_error | |||||
# far into the future | # far into the future | ||||
REPLAY_PROTECTION_START_TIME = 2000000000 | REPLAY_PROTECTION_START_TIME = 2000000000 | ||||
# Error due to invalid signature | # Error due to invalid signature | ||||
INVALID_SIGNATURE_ERROR = b'mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)' | INVALID_SIGNATURE_ERROR = b'mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)' | ||||
RPC_INVALID_SIGNATURE_ERROR = "16: " + \ | RPC_INVALID_SIGNATURE_ERROR = "16: " + \ | ||||
INVALID_SIGNATURE_ERROR.decode("utf-8") | INVALID_SIGNATURE_ERROR.decode("utf-8") | ||||
▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines |