diff options
author | John Newbery <john@johnnewbery.com> | 2017-03-30 08:38:46 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-04-18 17:20:09 -0400 |
commit | 2a52ae63bfdde948250df1c876dcdd5af99f03b5 (patch) | |
tree | d53a338b3c6c9eba1474330412dd0e5953822399 /test/functional/p2p-timeouts.py | |
parent | 52e15aa4d067fc4ace12c80be5c82e85c04fcfec (diff) |
Remove duplicate method definitions in NodeConnCB subclasses
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.
Diffstat (limited to 'test/functional/p2p-timeouts.py')
-rwxr-xr-x | test/functional/p2p-timeouts.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/test/functional/p2p-timeouts.py b/test/functional/p2p-timeouts.py index de4edd6800..210e561e74 100755 --- a/test/functional/p2p-timeouts.py +++ b/test/functional/p2p-timeouts.py @@ -28,20 +28,9 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class TestNode(NodeConnCB): - def __init__(self): - super().__init__() - self.connected = False - self.received_version = False - - def on_open(self, conn): - self.connected = True - - def on_close(self, conn): - self.connected = False - def on_version(self, conn, message): # Don't send a verack in response - self.received_version = True + pass class TimeoutsTest(BitcoinTestFramework): def __init__(self): @@ -83,7 +72,7 @@ class TimeoutsTest(BitcoinTestFramework): sleep(30) - assert(self.no_verack_node.received_version) + assert "version" in self.no_verack_node.last_message assert(self.no_verack_node.connected) assert(self.no_version_node.connected) |