Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)