Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/jimmysong/programmingbitcoin
/ serialize
Method
serialize
code-ch13/tx.py:164–168 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
162
163
# tag::source4[]
164
def
serialize(self):
165
if
self.segwit:
166
return
self.serialize_segwit()
167
else
:
168
return
self.serialize_legacy()
169
170
def
serialize_legacy(self):
# <1>
171
result = int_to_little_endian(self.version, 4)
Callers
14
dump_cache
Method · 0.45
serialize_legacy
Method · 0.45
serialize_segwit
Method · 0.45
sig_hash
Method · 0.45
hash_outputs
Method · 0.45
sig_hash_bip143
Method · 0.45
serialize
Method · 0.45
serialize
Method · 0.45
test_parse_inputs
Method · 0.45
test_parse_outputs
Method · 0.45
test_serialize
Method · 0.45
test_input_pubkey
Method · 0.45
Calls
2
serialize_segwit
Method · 0.95
serialize_legacy
Method · 0.95
Tested by
6
test_parse_inputs
Method · 0.36
test_parse_outputs
Method · 0.36
test_serialize
Method · 0.36
test_input_pubkey
Method · 0.36
test_sign_input
Method · 0.36
test_filterload
Method · 0.36