7
7
8
8
from test_framework .address import ADDRESS_BCRT1_UNSPENDABLE
9
9
from test_framework .test_framework import BitcoinTestFramework
10
- from test_framework .messages import CTransaction
11
- from test_framework .util import (
12
- assert_equal ,
13
- hash256 ,
14
- )
10
+ from test_framework .messages import CTransaction , hash256
11
+ from test_framework .util import assert_equal
15
12
from io import BytesIO
16
13
17
14
ADDRESS = "tcp://127.0.0.1:28332"
18
15
16
+ def hash256_reversed (byte_str ):
17
+ return hash256 (byte_str )[::- 1 ]
18
+
19
19
class ZMQSubscriber :
20
20
def __init__ (self , socket , topic ):
21
21
self .sequence = 0
@@ -103,7 +103,7 @@ def _zmq_test(self):
103
103
104
104
# Should receive the generated raw block.
105
105
block = self .rawblock .receive ()
106
- assert_equal (genhashes [x ], hash256 (block [:80 ]).hex ())
106
+ assert_equal (genhashes [x ], hash256_reversed (block [:80 ]).hex ())
107
107
108
108
if self .is_wallet_compiled ():
109
109
self .log .info ("Wait for tx from second node" )
@@ -116,7 +116,7 @@ def _zmq_test(self):
116
116
117
117
# Should receive the broadcasted raw transaction.
118
118
hex = self .rawtx .receive ()
119
- assert_equal (payment_txid , hash256 (hex ).hex ())
119
+ assert_equal (payment_txid , hash256_reversed (hex ).hex ())
120
120
121
121
122
122
self .log .info ("Test the getzmqnotifications RPC" )
0 commit comments