diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-12-07 12:43:31 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-12-07 12:43:44 +0100 |
commit | 82bcf405f6db1d55b684a1f63a4aabad376cdad7 (patch) | |
tree | f03d9105ba3ee14a877db28b1fc7b40384914177 /qa/rpc-tests/test_framework | |
parent | 075faaebf2e534265ff8aca015eaf03a8a156f32 (diff) | |
parent | 2f601d215da1683ae99ab9973219044c32fa2093 (diff) |
Merge pull request #7171
2f601d2 test: remove necessity to call create_callback_map (Wladimir J. van der Laan)
Diffstat (limited to 'qa/rpc-tests/test_framework')
-rwxr-xr-x | qa/rpc-tests/test_framework/comptool.py | 1 | ||||
-rwxr-xr-x | qa/rpc-tests/test_framework/mininode.py | 24 |
2 files changed, 1 insertions, 24 deletions
diff --git a/qa/rpc-tests/test_framework/comptool.py b/qa/rpc-tests/test_framework/comptool.py index e0b3ce040d..9444424dcf 100755 --- a/qa/rpc-tests/test_framework/comptool.py +++ b/qa/rpc-tests/test_framework/comptool.py @@ -45,7 +45,6 @@ class TestNode(NodeConnCB): def __init__(self, block_store, tx_store): NodeConnCB.__init__(self) - self.create_callback_map() self.conn = None self.bestblockhash = None self.block_store = block_store diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index 64985d58e2..9d0fb713a1 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -1015,32 +1015,10 @@ class NodeConnCB(object): return time.sleep(0.05) - # Derived classes should call this function once to set the message map - # which associates the derived classes' functions to incoming messages - def create_callback_map(self): - self.cbmap = { - "version": self.on_version, - "verack": self.on_verack, - "addr": self.on_addr, - "alert": self.on_alert, - "inv": self.on_inv, - "getdata": self.on_getdata, - "getblocks": self.on_getblocks, - "tx": self.on_tx, - "block": self.on_block, - "getaddr": self.on_getaddr, - "ping": self.on_ping, - "pong": self.on_pong, - "headers": self.on_headers, - "getheaders": self.on_getheaders, - "reject": self.on_reject, - "mempool": self.on_mempool - } - def deliver(self, conn, message): with mininode_lock: try: - self.cbmap[message.command](conn, message) + getattr(self, 'on_' + message.command)(conn, message) except: print "ERROR delivering %s (%s)" % (repr(message), sys.exc_info()[0]) |