MCPcopy Create free account
hub / github.com/ElementsProject/elements / serialize

Method serialize

test/functional/test_framework/messages.py:1129–1147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1127 self.hash = None
1128
1129 def serialize(self):
1130 r = b""
1131 nVersion = self.nVersion
1132 is_dyna = False
1133 if not self.m_dynafed_params.is_null():
1134 nVersion -= HEADER_HF_BIT
1135 is_dyna = True
1136
1137 r += struct.pack("<i", nVersion)
1138 r += ser_uint256(self.hashPrevBlock)
1139 r += ser_uint256(self.hashMerkleRoot)
1140 r += struct.pack("<I", self.nTime)
1141 r += struct.pack("<I", self.block_height)
1142 if is_dyna:
1143 r += self.m_dynafed_params.serialize()
1144 r += ser_string_vector(self.m_signblock_witness.stack)
1145 else:
1146 r += self.proof.serialize()
1147 return r
1148
1149 def calc_sha256(self):
1150 if self.sha256 is None:

Callers

nothing calls this directly

Calls 4

ser_uint256Function · 0.70
ser_string_vectorFunction · 0.70
is_nullMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected