aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p-acceptblock.py
AgeCommit message (Collapse)Author
2017-11-02[qa] test that invalid blocks on an invalid chain get a disconnectMatt Corallo
Github-Pull: #11531 Rebased-From: 00dcda60f6ee63d35bec640f27efe2338dd71270
2017-11-02Accept unrequested blocks with work equal to our tipMatt Corallo
This is a simple change that makes our accept requirements the same as our request requirements, (ever so slightly) further decoupling our consensus logic from our FindNextBlocksToDownload logic in net_processing. Github-Pull: #11531 Rebased-From: 932f118e6a3779bb3d6c3cc83963cf34ac150e42
2017-11-02Rewrite p2p-acceptblock in preparation for slight behavior changesMatt Corallo
Removes checking whitelisted behavior (which will be removed, the difference in behavior here makes little sense) and no longer requires that blocks at the same work as our tip be dropped if not requested (in part because we *do* request those blocks). Github-Pull: #11531 Rebased-From: 3b4ac43bc371561b5fa559bccb17dc0702bd4b69
2017-11-02qa: add test for minchainwork use in acceptblockSuhas Daftuar
Github-Pull: #11458 Rebased-From: 08fd822771bf8dae1c21698811f57aa691b2f25d
2017-11-01qa: Remove never used return value of sync_with_pingMarcoFalke
Github-Pull: #11472 Rebased-From: fafa0039708e15d1067be091b2bfc10195afa480
2017-11-01scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc errorJohn Newbery
-BEGIN VERIFY SCRIPT- sed -i 's/assert_raises_jsonrpc/assert_raises_rpc_error/g' test/functional/*py test/functional/test_framework/*py -END VERIFY SCRIPT- Github-Pull: #10853 Rebased-From: 47ba8cf71e9a3a6f7452488fc9ab3b350f0fae36
2017-10-03[tests] don't override __init__() in individual testsJohn Newbery
Almost all test scripts currently need to override the __init__() method. When they do that they need to call into super().__init__() as the base class does some generic initialization. This commit makes the base class __init__() call into set_test_params() method. Individual test cases can override set_test_params() to setup their test parameters. Github-Pull: #11121 Rebased-From: 5448a1471d6fc638a2220ea5a2f3782172efe14c
2017-05-02[tests] Remove is_network_split from funtional test casesJohn Newbery
2017-04-18Remove duplicate method definitions in NodeConnCB subclassesJohn Newbery
All Node classes in individual test cases subclass from NodeConnCB. Many have duplicate definitions for methods that are defined in the base class. This commit removes those duplicate definitions. This commit removes ~290 lines of duplicate code.
2017-04-18Adds helper functions to NodeConnCBJohn Newbery
This commit adds some helper functions to NodeConnCB which are useful for many tests: - NodeConnCB now keeps track of the number of each message type that it's received and the most recent message of each type. Many tests assert on the most recent block, tx or reject message. - NodeConnCB now keeps track of its connection state by setting a connected boolean in on_open() and on_close() - NodeConnCB now has wait_for_block, wait_for_getdata, wait_for_getheaders, wait_for_inv and wait_for_verack methods I have updated the individual test cases to make sure that there are no namespace problems that cause them to fail with these new definitions. Future commits will remove the duplicate code.
2017-03-30[tests] sync_with_ping should assert that ping hasn't timed outJohn Newbery
sync_with_ping currently returns false if the timeout expires, and it is the caller's responsibility to fail the test. However, none of the tests currently assert on sync_with_ping()'s return code. This commit adds an assert to sync_with_ping so the test will fail if the timeout expires. This commit also removes all the duplicate implementations of sync_with_ping() from the individual tests.
2017-03-28Remove SingleNodeConnCBJohn Newbery
This commit merges the NodeConnCB and SingleNodeConnCB into a single class (called NodeConnCB). The original intent for the NodeConnCB was to be able to have a python 'mininode' connect to multiple running bitcoinds. This has never been used and can be achieved more easily by having multiple NodeConns backed by a common datastore if it is ever needed. The changes in mininode.py are just code moves (and merging the two classes into a single class). The code changes in the individual test cases are changing the subclasses to subclass from NodeConnCB instead of SingleNodeConnCB. There is a lot of duplicate code in the subclasses that can be removed in future commits.
2017-03-20Rename rpc-tests directory to functionalJohn Newbery