From dad596fc37c8733ab806a0aa4224ac437d37aee5 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Fri, 17 Nov 2017 15:01:24 -0500 Subject: [tests] Make NodeConnCB a subclass of NodeConn This makes NodeConnCB a subclass of NodeConn, and removes the need for the client code to know anything about the implementation details of NodeConnCB. NodeConn can now be swapped out for any other implementation of a low-level connection without changing client code. --- test/functional/example_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/example_test.py') diff --git a/test/functional/example_test.py b/test/functional/example_test.py index ba40f33016..54cabee51c 100755 --- a/test/functional/example_test.py +++ b/test/functional/example_test.py @@ -49,14 +49,14 @@ class BaseNode(NodeConnCB): # Stores a dictionary of all blocks received self.block_receive_map = defaultdict(int) - def on_block(self, conn, message): + def on_block(self, message): """Override the standard on_block callback Store the hash of a received block in the dictionary.""" message.block.calc_sha256() self.block_receive_map[message.block.sha256] += 1 - def on_inv(self, conn, message): + def on_inv(self, message): """Override the standard on_inv callback""" pass -- cgit v1.2.3