diff options
author | Andrew Toth <andrewstoth@gmail.com> | 2024-03-12 12:47:01 -0400 |
---|---|---|
committer | Andrew Toth <andrewstoth@gmail.com> | 2024-03-12 12:47:01 -0400 |
commit | 0865ab8712429761bc69f09d93760f8c6081c99c (patch) | |
tree | 236be927c4bea4812fab8afbf65d84f0a04562bb | |
parent | 38265cc14e7d646bf27882329d374d42167eb49f (diff) |
test: check more details on zmq raw block response
-rwxr-xr-x | test/functional/interface_zmq.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py index 2358dd4387..3297f6a882 100755 --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -5,6 +5,7 @@ """Test the ZMQ notification interface.""" import struct from time import sleep +from io import BytesIO from test_framework.address import ( ADDRESS_BCRT1_P2WSH_OP_TRUE, @@ -17,6 +18,7 @@ from test_framework.blocktools import ( ) from test_framework.test_framework import BitcoinTestFramework from test_framework.messages import ( + CBlock, hash256, tx_from_hex, ) @@ -203,8 +205,13 @@ class ZMQTest (BitcoinTestFramework): assert_equal(tx.hash, txid.hex()) # Should receive the generated raw block. - block = rawblock.receive() - assert_equal(genhashes[x], hash256_reversed(block[:80]).hex()) + hex = rawblock.receive() + block = CBlock() + block.deserialize(BytesIO(hex)) + assert block.is_valid() + assert_equal(block.vtx[0].hash, tx.hash) + assert_equal(len(block.vtx), 1) + assert_equal(genhashes[x], hash256_reversed(hex[:80]).hex()) # Should receive the generated block hash. hash = hashblock.receive().hex() |