diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -13,6 +13,8 @@ hash256, ) +ADDRESS = "tcp://127.0.0.1:28332" + class ZMQSubscriber: def __init__(self, socket, topic): @@ -50,11 +52,10 @@ # test fails if the publishing order changes. # Note that the publishing order is not defined in the documentation and # is subject to change. - address = "tcp://127.0.0.1:28332" self.zmq_context = zmq.Context() socket = self.zmq_context.socket(zmq.SUB) socket.set(zmq.RCVTIMEO, 60000) - socket.connect(address) + socket.connect(ADDRESS) # Subscribe to all available topics. self.hashblock = ZMQSubscriber(socket, b"hashblock") @@ -63,7 +64,7 @@ self.rawtx = ZMQSubscriber(socket, b"rawtx") self.extra_args = [ - ["-zmqpub{}={}".format(sub.topic.decode(), address) for sub in [ + ["-zmqpub{}={}".format(sub.topic.decode(), ADDRESS) for sub in [ self.hashblock, self.hashtx, self.rawblock, self.rawtx]], [], ] @@ -119,6 +120,16 @@ hex = self.rawtx.receive() assert_equal(payment_txid, hash256(hex).hex()) + self.log.info("Test the getzmqnotifications RPC") + assert_equal(self.nodes[0].getzmqnotifications(), [ + {"type": "pubhashblock", "address": ADDRESS}, + {"type": "pubhashtx", "address": ADDRESS}, + {"type": "pubrawblock", "address": ADDRESS}, + {"type": "pubrawtx", "address": ADDRESS}, + ]) + + assert_equal(self.nodes[1].getzmqnotifications(), []) + if __name__ == '__main__': ZMQTest().main() diff --git a/test/functional/timing.json b/test/functional/timing.json --- a/test/functional/timing.json +++ b/test/functional/timing.json @@ -407,10 +407,6 @@ "name": "rpc_users.py", "time": 2 }, - { - "name": "rpc_zmq.py", - "time": 1 - }, { "name": "wallet_abandonconflict.py", "time": 19