示例#1
0
 def deserialize(json):
     asc = dumps(json).encode('ascii')
     c_str = ffi.new('char[]', asc)  # freed by cffi
     obj = lib.p2partialsig_new_deserialize(c_str)
     if obj == ffi.cast('struct PartialSig *', 0):
         raise Exception('could not deserialize')
     return P2PartialSig(obj)
示例#2
0
 def deserialize(json):
     asc = dumps(json).encode('ascii')
     c_str = ffi.new('char[]', asc)  # freed by cffi
     obj = lib.encryption_key_new_deserialize(c_str)
     if obj == ffi.cast('struct EncryptionKey *', 0):
         raise Exception('could not deserialize')
     return EncryptionKey(obj)
示例#3
0
 def deserialize(json):
     asc = dumps(json).encode('ascii')
     c_str = ffi.new('char[]', asc)  # freed by cffi
     obj = lib.bigint_new_deserialize(c_str)
     if obj == ffi.cast('struct BigInt *', 0):
         raise Exception('could not deserialize')
     return BigInt(obj)
示例#4
0
 def deserialize(json):
     asc = dumps(json).encode('ascii')
     c_str = ffi.new('char[]', asc)  # freed by cffi
     obj = lib.verification_aid_new_deserialize(c_str)
     if obj == ffi.cast('struct VerificationAid *', 0):
         raise Exception('could not deserialize')
     return VerificationAid(obj)
示例#5
0
 def deserialize(json):
     asc = dumps(json).encode('ascii')
     c_str = ffi.new('char[]', asc)  # freed by cffi
     obj = lib.challenge_new_deserialize(c_str)
     if obj == ffi.cast('struct Challenge *', 0):
         raise Exception('could not deserialize')
     return Challenge(obj)
示例#6
0
 def deserialize(json):
     asc = dumps(json).encode('ascii')
     c_str = ffi.new('char[]', asc)  # freed by cffi
     obj = lib.correct_key_proof_new_deserialize(c_str)
     if obj == ffi.cast('struct CorrectKeyProof *', 0):
         raise Exception('could not deserialize')
     return CorrectKeyProof(obj)
示例#7
0
 def deserialize(json):
     asc = dumps(json).encode('ascii')
     c_str = ffi.new('char[]', asc)  # freed by cffi
     obj = lib.d_log_proof_nullable_new_deserialize(c_str)
     if obj == ffi.cast('struct DLogProof *', 0):
         raise Exception('could not deserialize')
     return DLogProof(obj)