Exemplo n.º 1
0
 def deserialize(data):
     n_m_data, public_keys_data = data[:8], data[8:]
     n, m  =  struct.unpack(">II", n_m_data)
     if len(public_keys_data) != m * 33:
         raise Exception("incorrect size")
     return MultiSigOutpoint(n, m, [PublicKey.from_bytestr(public_keys_data[i*33:i*33+33]) for i in range(m)])
Exemplo n.º 2
0
 def deserialize(data, outpoint_type):
     is_pubkey_hash = (outpoint_type == OutpointIndex.PUBKEY_HASH)
     return PubKeyOutpoint(PublicKey.from_bytestr(data), is_pubkey_hash=is_pubkey_hash)