Changeset View
Changeset View
Standalone View
Standalone View
test/functional/interface_zmq.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2019 The Bitcoin Core developers | # Copyright (c) 2015-2019 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Test the ZMQ notification interface.""" | """Test the ZMQ notification interface.""" | ||||
import struct | import struct | ||||
from io import BytesIO | from io import BytesIO | ||||
from time import sleep | |||||
from test_framework.address import ADDRESS_ECREG_UNSPENDABLE | from test_framework.address import ADDRESS_ECREG_UNSPENDABLE | ||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.messages import CTransaction, hash256 | from test_framework.messages import CTransaction, hash256 | ||||
from test_framework.util import ( | from test_framework.test_framework import BitcoinTestFramework | ||||
assert_equal, | from test_framework.util import assert_equal, connect_nodes | ||||
connect_nodes, | |||||
) | |||||
from time import sleep | |||||
def hash256_reversed(byte_str): | def hash256_reversed(byte_str): | ||||
return hash256(byte_str)[::-1] | return hash256(byte_str)[::-1] | ||||
class ZMQSubscriber: | class ZMQSubscriber: | ||||
def __init__(self, socket, topic): | def __init__(self, socket, topic): | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |