Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_invalid_tx.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2017 The Bitcoin Core developers | # Copyright (c) 2015-2017 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. | ||||
"""Test node responses to invalid transactions. | """Test node responses to invalid transactions. | ||||
In this test we connect to one node over p2p, and test tx requests. | In this test we connect to one node over p2p, and test tx requests. | ||||
""" | """ | ||||
from test_framework.blocktools import ( | from data import invalid_txs | ||||
create_block, | from test_framework.blocktools import create_block, create_coinbase | ||||
create_coinbase, | |||||
) | |||||
from test_framework.txtools import pad_tx | |||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
COIN, | COIN, | ||||
COutPoint, | COutPoint, | ||||
CTransaction, | CTransaction, | ||||
CTxIn, | CTxIn, | ||||
CTxOut, | CTxOut, | ||||
) | ) | ||||
from test_framework.p2p import P2PDataStore | from test_framework.p2p import P2PDataStore | ||||
from test_framework.script import ( | from test_framework.script import OP_TRUE, CScript | ||||
CScript, | |||||
OP_TRUE, | |||||
) | |||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import ( | from test_framework.txtools import pad_tx | ||||
assert_equal, | from test_framework.util import assert_equal, wait_until | ||||
wait_until, | |||||
) | |||||
from data import invalid_txs | |||||
class InvalidTxRequestTest(BitcoinTestFramework): | class InvalidTxRequestTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.extra_args = [ | self.extra_args = [ | ||||
["-acceptnonstdtxn=1", ] | ["-acceptnonstdtxn=1", ] | ||||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |