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