File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 5
5
"""Test the ZMQ notification interface."""
6
6
import struct
7
7
from time import sleep
8
+ from io import BytesIO
8
9
9
10
from test_framework .address import (
10
11
ADDRESS_BCRT1_P2WSH_OP_TRUE ,
17
18
)
18
19
from test_framework .test_framework import BitcoinTestFramework
19
20
from test_framework .messages import (
21
+ CBlock ,
20
22
hash256 ,
21
23
tx_from_hex ,
22
24
)
@@ -203,8 +205,13 @@ def test_basic(self):
203
205
assert_equal (tx .hash , txid .hex ())
204
206
205
207
# Should receive the generated raw block.
206
- block = rawblock .receive ()
207
- assert_equal (genhashes [x ], hash256_reversed (block [:80 ]).hex ())
208
+ hex = rawblock .receive ()
209
+ block = CBlock ()
210
+ block .deserialize (BytesIO (hex ))
211
+ assert block .is_valid ()
212
+ assert_equal (block .vtx [0 ].hash , tx .hash )
213
+ assert_equal (len (block .vtx ), 1 )
214
+ assert_equal (genhashes [x ], hash256_reversed (hex [:80 ]).hex ())
208
215
209
216
# Should receive the generated block hash.
210
217
hash = hashblock .receive ().hex ()
You can’t perform that action at this time.
0 commit comments