diff options
author | John Newbery <john@johnnewbery.com> | 2017-03-29 14:07:39 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-04-18 15:25:01 -0400 |
commit | 52e15aa4d067fc4ace12c80be5c82e85c04fcfec (patch) | |
tree | a8cc190981446a60e8c0189890cd986e8287cbc8 /test/functional/p2p-acceptblock.py | |
parent | 2584925077f9658b3953ad931b74779006e59807 (diff) |
Adds helper functions to NodeConnCB
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.
Diffstat (limited to 'test/functional/p2p-acceptblock.py')
-rwxr-xr-x | test/functional/p2p-acceptblock.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/test/functional/p2p-acceptblock.py b/test/functional/p2p-acceptblock.py index c09945baa6..e2aad3f1d1 100755 --- a/test/functional/p2p-acceptblock.py +++ b/test/functional/p2p-acceptblock.py @@ -70,17 +70,6 @@ class TestNode(NodeConnCB): def on_getdata(self, conn, message): self.last_getdata = message - # Spin until verack message is received from the node. - # We use this to signal that our test can begin. This - # is called from the testing thread, so it needs to acquire - # the global lock. - def wait_for_verack(self): - while True: - with mininode_lock: - if self.verack_received: - return - time.sleep(0.05) - # Wrapper for the NodeConn's send_message function def send_message(self, message): self.connection.send_message(message) |