|
|
@ -7,15 +7,15 @@ import struct
|
|
|
|
|
|
|
|
|
|
|
|
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
|
|
|
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
|
|
|
from test_framework.test_framework import BitcoinTestFramework
|
|
|
|
from test_framework.test_framework import BitcoinTestFramework
|
|
|
|
from test_framework.messages import CTransaction
|
|
|
|
from test_framework.messages import CTransaction, hash256
|
|
|
|
from test_framework.util import (
|
|
|
|
from test_framework.util import assert_equal
|
|
|
|
assert_equal,
|
|
|
|
|
|
|
|
hash256,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
from io import BytesIO
|
|
|
|
from io import BytesIO
|
|
|
|
|
|
|
|
|
|
|
|
ADDRESS = "tcp://127.0.0.1:28332"
|
|
|
|
ADDRESS = "tcp://127.0.0.1:28332"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def hash256_reversed(byte_str):
|
|
|
|
|
|
|
|
return hash256(byte_str)[::-1]
|
|
|
|
|
|
|
|
|
|
|
|
class ZMQSubscriber:
|
|
|
|
class ZMQSubscriber:
|
|
|
|
def __init__(self, socket, topic):
|
|
|
|
def __init__(self, socket, topic):
|
|
|
|
self.sequence = 0
|
|
|
|
self.sequence = 0
|
|
|
@ -103,7 +103,7 @@ class ZMQTest (BitcoinTestFramework):
|
|
|
|
|
|
|
|
|
|
|
|
# Should receive the generated raw block.
|
|
|
|
# Should receive the generated raw block.
|
|
|
|
block = self.rawblock.receive()
|
|
|
|
block = self.rawblock.receive()
|
|
|
|
assert_equal(genhashes[x], hash256(block[:80]).hex())
|
|
|
|
assert_equal(genhashes[x], hash256_reversed(block[:80]).hex())
|
|
|
|
|
|
|
|
|
|
|
|
if self.is_wallet_compiled():
|
|
|
|
if self.is_wallet_compiled():
|
|
|
|
self.log.info("Wait for tx from second node")
|
|
|
|
self.log.info("Wait for tx from second node")
|
|
|
@ -116,7 +116,7 @@ class ZMQTest (BitcoinTestFramework):
|
|
|
|
|
|
|
|
|
|
|
|
# Should receive the broadcasted raw transaction.
|
|
|
|
# Should receive the broadcasted raw transaction.
|
|
|
|
hex = self.rawtx.receive()
|
|
|
|
hex = self.rawtx.receive()
|
|
|
|
assert_equal(payment_txid, hash256(hex).hex())
|
|
|
|
assert_equal(payment_txid, hash256_reversed(hex).hex())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.log.info("Test the getzmqnotifications RPC")
|
|
|
|
self.log.info("Test the getzmqnotifications RPC")
|
|
|
|