MCPcopy
hub / github.com/jimmysong/programmingbitcoin / test_parse

Method test_parse

code-ch13/network.py:294–300  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

292class HeadersMessageTest(TestCase):
293
294 def test_parse(self):
295 hex_msg = '0200000020df3b053dc46f162a9b00c7f0d5124e2676d47bbe7c5d0793a500000000000000ef445fef2ed495c275892206ca533e7411907971013ab83e3b47bd0d692d14d4dc7c835b67d8001ac157e670000000002030eb2540c41025690160a1014c577061596e32e426b712c7ca00000000000000768b89f07044e6130ead292a3f51951adbd2202df447d98789339937fd006bd44880835b67d8001ade09204600'
296 stream = BytesIO(bytes.fromhex(hex_msg))
297 headers = HeadersMessage.parse(stream)
298 self.assertEqual(len(headers.blocks), 2)
299 for b in headers.blocks:
300 self.assertEqual(b.__class__, Block)
301
302
303class GetDataMessage:

Callers

nothing calls this directly

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected