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

Method serialize

code-ch08/script.py:130–136  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 return result
129
130 def serialize(self):
131 # get the raw serialization (no prepended length)
132 result = self.raw_serialize()
133 # get the length of the whole thing
134 total = len(result)
135 # encode_varint the total length of the result and prepend
136 return encode_varint(total) + result
137
138 def evaluate(self, z):
139 # create a copy as we may need to add to this list if we have a

Callers 1

test_serializeMethod · 0.45

Calls 2

raw_serializeMethod · 0.95
encode_varintFunction · 0.90

Tested by 1

test_serializeMethod · 0.36