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-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. | ||||
"""Test node responses to invalid transactions. | |||||
In this test we connect to one node over p2p, and test tx requests. | |||||
""" | |||||
import time | import time | ||||
from test_framework.blocktools import ( | from test_framework.blocktools import ( | ||||
create_block, | create_block, | ||||
create_coinbase, | create_coinbase, | ||||
create_transaction, | create_transaction, | ||||
) | ) | ||||
from test_framework.comptool import RejectResult, TestInstance, TestManager | from test_framework.comptool import RejectResult, TestInstance, TestManager | ||||
from test_framework.messages import COIN | from test_framework.messages import COIN | ||||
from test_framework.mininode import network_thread_start | from test_framework.mininode import network_thread_start | ||||
from test_framework.test_framework import ComparisonTestFramework | from test_framework.test_framework import ComparisonTestFramework | ||||
''' | |||||
In this test we connect to one node over p2p, and test tx requests. | |||||
''' | |||||
# Use the ComparisonTestFramework with 1 node: only use --testbinary. | # Use the ComparisonTestFramework with 1 node: only use --testbinary. | ||||
class InvalidTxRequestTest(ComparisonTestFramework): | class InvalidTxRequestTest(ComparisonTestFramework): | ||||
''' Can either run this test as 1 node with expected answers, or two and compare them. | ''' Can either run this test as 1 node with expected answers, or two and compare them. | ||||
Change the "outcome" variable from each TestInstance object to only do the comparison. ''' | Change the "outcome" variable from each TestInstance object to only do the comparison. ''' | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |