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 55"""Test the ZMQ notification interface."""
66import struct
77from time import sleep
8+ from io import BytesIO
89
910from test_framework .address import (
1011 ADDRESS_BCRT1_P2WSH_OP_TRUE ,
1718)
1819from test_framework .test_framework import BitcoinTestFramework
1920from test_framework .messages import (
21+ CBlock ,
2022 hash256 ,
2123 tx_from_hex ,
2224)
@@ -203,8 +205,13 @@ def test_basic(self):
203205 assert_equal (tx .hash , txid .hex ())
204206
205207 # 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 ())
208215
209216 # Should receive the generated block hash.
210217 hash = hashblock .receive ().hex ()
You can’t perform that action at this time.
0 commit comments