def serialize(self): assert (len(self.regTxHash) == 32 and len(self.hashPrevSubTx) == 32 and len(self.payloadSig) == 96) return ( pack_le_uint16(self.version) + # version self.regTxHash + # regTxHash self.hashPrevSubTx + # hashPrevSubTx pack_le_int64(self.creditFee) + # creditFee self.payloadSig # payloadSig )
def serialize(self): return b''.join(( pack_le_int64(self.value), pack_varbytes(self.pk_script), ))