MCPcopy Index your code
hub / github.com/jimmysong/programmingbitcoin / parse

Method parse

code-ch13/tx.py:108–115  ·  view source on GitHub ↗
(cls, s, testnet=False)

Source from the content-addressed store, hash-verified

106 # tag::source2[]
107 @classmethod
108 def parse(cls, s, testnet=False):
109 s.read(4) # <1>
110 if s.read(1) == b'\x00': # <2>
111 parse_method = cls.parse_segwit
112 else:
113 parse_method = cls.parse_legacy
114 s.seek(-5, 1) # <3>
115 return parse_method(s, testnet=testnet)
116
117 @classmethod
118 def parse_legacy(cls, s, testnet=False):

Callers 15

op_checksigFunction · 0.45
op_checkmultisigFunction · 0.45
fetchMethod · 0.45
load_cacheMethod · 0.45
parse_legacyMethod · 0.45
parse_segwitMethod · 0.45
verify_inputMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45
test_parse_versionMethod · 0.45
test_parse_inputsMethod · 0.45
test_parse_outputsMethod · 0.45

Calls 1

readMethod · 0.45

Tested by 9

test_parse_versionMethod · 0.36
test_parse_inputsMethod · 0.36
test_parse_outputsMethod · 0.36
test_parse_locktimeMethod · 0.36
test_serializeMethod · 0.36
test_feeMethod · 0.36
test_sign_inputMethod · 0.36
test_is_coinbaseMethod · 0.36
test_coinbase_heightMethod · 0.36