From 118d220bac2c7e6a8417d0d79d7ba81878aff8d2 Mon Sep 17 00:00:00 2001 From: goncalo-frade-iohk Date: Wed, 11 Oct 2023 14:17:23 +0000 Subject: [PATCH] chore: prepare release 0.3.3 --- Package.swift | 4 +- .../Sources/Swift/anoncreds.swift | 317 ++++++++---------- 2 files changed, 150 insertions(+), 171 deletions(-) diff --git a/Package.swift b/Package.swift index 873c65ce..22498275 100644 --- a/Package.swift +++ b/Package.swift @@ -32,8 +32,8 @@ let package = Package( // RELEASE .binaryTarget( name: "libanoncreds", - url: "https://github.com/input-output-hk/anoncreds-rs/releases/download/0.2.0/libanoncreds.xcframework.zip", - checksum: "ef4b56ccb533620d191c9246ebc5eea4a706c2351601325cc66b510a322318a2" + url: "https://github.com/input-output-hk/anoncreds-rs/releases/download/0.3.3/libanoncreds.xcframework.zip", + checksum: "92cf14924012fff42794920161cd36eceec08ddd4e637427059265e01911de3b" ) ] ) diff --git a/uniffi/output-frameworks/anoncreds-swift/AnoncredsSwift/Sources/Swift/anoncreds.swift b/uniffi/output-frameworks/anoncreds-swift/AnoncredsSwift/Sources/Swift/anoncreds.swift index 809f405d..fd4ee060 100644 --- a/uniffi/output-frameworks/anoncreds-swift/AnoncredsSwift/Sources/Swift/anoncreds.swift +++ b/uniffi/output-frameworks/anoncreds-swift/AnoncredsSwift/Sources/Swift/anoncreds.swift @@ -104,12 +104,12 @@ private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: // Reads a float at the current offset. private func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { - return Float(bitPattern: try readInt(&reader)) + return try Float(bitPattern: readInt(&reader)) } // Reads a float at the current offset. private func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { - return Double(bitPattern: try readInt(&reader)) + return try Double(bitPattern: readInt(&reader)) } // Indicates if the offset has reached the end of the buffer. @@ -281,7 +281,7 @@ private func uniffiCheckCallStatus( // with the message. But if that code panics, then it just sends back // an empty buffer. if callStatus.errorBuf.len > 0 { - throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf)) + throw try UniffiInternalError.rustPanic(FfiConverterString.lift(callStatus.errorBuf)) } else { callStatus.errorBuf.deallocate() throw UniffiInternalError.rustPanic("Rust panic") @@ -369,7 +369,7 @@ private struct FfiConverterString: FfiConverter { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { let len: Int32 = try readInt(&buf) - return String(bytes: try readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! + return try String(bytes: readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! } public static func write(_ value: String, into buf: inout [UInt8]) { @@ -402,7 +402,7 @@ public class Credential: CredentialProtocol { } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_credential_new( FfiConverterString.lower(jsonString), $0 ) @@ -487,10 +487,9 @@ public class Credential: CredentialProtocol { public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_credential_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_credential_get_json(self.pointer, $0) + } ) } } @@ -552,7 +551,7 @@ public class CredentialDefinition: CredentialDefinitionProtocol { } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_credentialdefinition_new( FfiConverterString.lower(jsonString), $0 ) @@ -601,10 +600,9 @@ public class CredentialDefinition: CredentialDefinitionProtocol { public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_credentialdefinition_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_credentialdefinition_get_json(self.pointer, $0) + } ) } } @@ -662,7 +660,7 @@ public class CredentialDefinitionPrivate: CredentialDefinitionPrivateProtocol { } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_credentialdefinitionprivate_new( FfiConverterString.lower(jsonString), $0 ) @@ -675,10 +673,9 @@ public class CredentialDefinitionPrivate: CredentialDefinitionPrivateProtocol { public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_credentialdefinitionprivate_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_credentialdefinitionprivate_get_json(self.pointer, $0) + } ) } } @@ -736,7 +733,7 @@ public class CredentialKeyCorrectnessProof: CredentialKeyCorrectnessProofProtoco } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_credentialkeycorrectnessproof_new( FfiConverterString.lower(jsonString), $0 ) @@ -749,10 +746,9 @@ public class CredentialKeyCorrectnessProof: CredentialKeyCorrectnessProofProtoco public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_credentialkeycorrectnessproof_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_credentialkeycorrectnessproof_get_json(self.pointer, $0) + } ) } } @@ -815,7 +811,7 @@ public class CredentialOffer: CredentialOfferProtocol { } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_credentialoffer_new( FfiConverterString.lower(jsonString), $0 ) @@ -873,10 +869,9 @@ public class CredentialOffer: CredentialOfferProtocol { public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_credentialoffer_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_credentialoffer_get_json(self.pointer, $0) + } ) } } @@ -937,7 +932,7 @@ public class CredentialRequest: CredentialRequestProtocol { } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_credentialrequest_new( FfiConverterString.lower(jsonString), $0 ) @@ -977,10 +972,9 @@ public class CredentialRequest: CredentialRequestProtocol { public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_credentialrequest_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_credentialrequest_get_json(self.pointer, $0) + } ) } } @@ -1056,58 +1050,54 @@ public class Issuer: IssuerProtocol { public func createSchema(schemaName: String, schemaVersion: String, issuerId: String, attrNames: [String]) throws -> Schema { return try FfiConverterTypeSchema.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_issuer_create_schema(self.pointer, - FfiConverterString.lower(schemaName), - FfiConverterString.lower(schemaVersion), - FfiConverterString.lower(issuerId), - FfiConverterSequenceString.lower(attrNames), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_issuer_create_schema(self.pointer, + FfiConverterString.lower(schemaName), + FfiConverterString.lower(schemaVersion), + FfiConverterString.lower(issuerId), + FfiConverterSequenceString.lower(attrNames), $0) + } ) } public func createCredentialDefinition(schemaId: String, schema: Schema, issuerId: String, tag: String, signatureType: SignatureType, config: CredentialDefinitionConfig) throws -> IssuerCreateCredentialDefinitionReturn { return try FfiConverterTypeIssuerCreateCredentialDefinitionReturn.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_issuer_create_credential_definition(self.pointer, - FfiConverterString.lower(schemaId), - FfiConverterTypeSchema.lower(schema), - FfiConverterString.lower(issuerId), - FfiConverterString.lower(tag), - FfiConverterTypeSignatureType.lower(signatureType), - FfiConverterTypeCredentialDefinitionConfig.lower(config), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_issuer_create_credential_definition(self.pointer, + FfiConverterString.lower(schemaId), + FfiConverterTypeSchema.lower(schema), + FfiConverterString.lower(issuerId), + FfiConverterString.lower(tag), + FfiConverterTypeSignatureType.lower(signatureType), + FfiConverterTypeCredentialDefinitionConfig.lower(config), $0) + } ) } public func createRevocationRegistryDef(credDef: CredentialDefinition, credDefId: String, issuerId: String, tag: String, revRegType: RegistryType, maxCredNum: UInt32) throws -> IssuerCreateRevocationRegistryDefReturn { return try FfiConverterTypeIssuerCreateRevocationRegistryDefReturn.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_issuer_create_revocation_registry_def(self.pointer, - FfiConverterTypeCredentialDefinition.lower(credDef), - FfiConverterString.lower(credDefId), - FfiConverterString.lower(issuerId), - FfiConverterString.lower(tag), - FfiConverterTypeRegistryType.lower(revRegType), - FfiConverterUInt32.lower(maxCredNum), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_issuer_create_revocation_registry_def(self.pointer, + FfiConverterTypeCredentialDefinition.lower(credDef), + FfiConverterString.lower(credDefId), + FfiConverterString.lower(issuerId), + FfiConverterString.lower(tag), + FfiConverterTypeRegistryType.lower(revRegType), + FfiConverterUInt32.lower(maxCredNum), $0) + } ) } public func createRevocationStatusList(revRegDefId: String, revRegDef: RevocationRegistryDefinition, issuerId: String, timestamp: UInt64?, issuanceByDefault: Bool) throws -> RevocationStatusList { return try FfiConverterTypeRevocationStatusList.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_issuer_create_revocation_status_list(self.pointer, - FfiConverterString.lower(revRegDefId), - FfiConverterTypeRevocationRegistryDefinition.lower(revRegDef), - FfiConverterString.lower(issuerId), - FfiConverterOptionUInt64.lower(timestamp), - FfiConverterBool.lower(issuanceByDefault), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_issuer_create_revocation_status_list(self.pointer, + FfiConverterString.lower(revRegDefId), + FfiConverterTypeRevocationRegistryDefinition.lower(revRegDef), + FfiConverterString.lower(issuerId), + FfiConverterOptionUInt64.lower(timestamp), + FfiConverterBool.lower(issuanceByDefault), $0) + } ) } @@ -1124,44 +1114,41 @@ public class Issuer: IssuerProtocol { public func updateRevocationStatusList(timestamp: UInt64?, issued: [UInt32]?, revoked: [UInt32]?, revRegDef: RevocationRegistryDefinition, currentList: RevocationStatusList) throws -> RevocationStatusList { return try FfiConverterTypeRevocationStatusList.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_issuer_update_revocation_status_list(self.pointer, - FfiConverterOptionUInt64.lower(timestamp), - FfiConverterOptionSequenceUInt32.lower(issued), - FfiConverterOptionSequenceUInt32.lower(revoked), - FfiConverterTypeRevocationRegistryDefinition.lower(revRegDef), - FfiConverterTypeRevocationStatusList.lower(currentList), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_issuer_update_revocation_status_list(self.pointer, + FfiConverterOptionUInt64.lower(timestamp), + FfiConverterOptionSequenceUInt32.lower(issued), + FfiConverterOptionSequenceUInt32.lower(revoked), + FfiConverterTypeRevocationRegistryDefinition.lower(revRegDef), + FfiConverterTypeRevocationStatusList.lower(currentList), $0) + } ) } public func createCredentialOffer(schemaId: String, credDefId: String, correctnessProof: CredentialKeyCorrectnessProof) throws -> CredentialOffer { return try FfiConverterTypeCredentialOffer.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_issuer_create_credential_offer(self.pointer, - FfiConverterString.lower(schemaId), - FfiConverterString.lower(credDefId), - FfiConverterTypeCredentialKeyCorrectnessProof.lower(correctnessProof), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_issuer_create_credential_offer(self.pointer, + FfiConverterString.lower(schemaId), + FfiConverterString.lower(credDefId), + FfiConverterTypeCredentialKeyCorrectnessProof.lower(correctnessProof), $0) + } ) } public func createCredential(credDef: CredentialDefinition, credDefPrivate: CredentialDefinitionPrivate, credOffer: CredentialOffer, credRequest: CredentialRequest, credValues: [AttributeValues], revRegId: RevocationRegistryId?, revStatusList: RevocationStatusList?, revocationConfig: CredentialRevocationConfig?) throws -> Credential { return try FfiConverterTypeCredential.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_issuer_create_credential(self.pointer, - FfiConverterTypeCredentialDefinition.lower(credDef), - FfiConverterTypeCredentialDefinitionPrivate.lower(credDefPrivate), - FfiConverterTypeCredentialOffer.lower(credOffer), - FfiConverterTypeCredentialRequest.lower(credRequest), - FfiConverterSequenceTypeAttributeValues.lower(credValues), - FfiConverterOptionTypeRevocationRegistryId.lower(revRegId), - FfiConverterOptionTypeRevocationStatusList.lower(revStatusList), - FfiConverterOptionTypeCredentialRevocationConfig.lower(revocationConfig), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_issuer_create_credential(self.pointer, + FfiConverterTypeCredentialDefinition.lower(credDef), + FfiConverterTypeCredentialDefinitionPrivate.lower(credDefPrivate), + FfiConverterTypeCredentialOffer.lower(credOffer), + FfiConverterTypeCredentialRequest.lower(credRequest), + FfiConverterSequenceTypeAttributeValues.lower(credValues), + FfiConverterOptionTypeRevocationRegistryId.lower(revRegId), + FfiConverterOptionTypeRevocationStatusList.lower(revStatusList), + FfiConverterOptionTypeCredentialRevocationConfig.lower(revocationConfig), $0) + } ) } } @@ -1230,7 +1217,7 @@ public class LinkSecret: LinkSecretProtocol { } public static func newFromValue(valueString: String) throws -> LinkSecret { - return LinkSecret(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + return try LinkSecret(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_linksecret_new_from_value( FfiConverterString.lower(valueString), $0 ) @@ -1248,10 +1235,9 @@ public class LinkSecret: LinkSecretProtocol { public func getValue() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_linksecret_get_value(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_linksecret_get_value(self.pointer, $0) + } ) } } @@ -1319,7 +1305,7 @@ public class Nonce: NonceProtocol { } public static func newFromValue(valueString: String) throws -> Nonce { - return Nonce(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + return try Nonce(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_nonce_new_from_value( FfiConverterString.lower(valueString), $0 ) @@ -1328,10 +1314,9 @@ public class Nonce: NonceProtocol { public func getValue() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_nonce_get_value(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_nonce_get_value(self.pointer, $0) + } ) } } @@ -1402,16 +1387,15 @@ public class Prover: ProverProtocol { public func createCredentialRequest(entropy: String?, proverDid: String?, credDef: CredentialDefinition, linkSecret: LinkSecret, linkSecretId: String, credentialOffer: CredentialOffer) throws -> CreateCrendentialRequestResponse { return try FfiConverterTypeCreateCrendentialRequestResponse.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_prover_create_credential_request(self.pointer, - FfiConverterOptionString.lower(entropy), - FfiConverterOptionString.lower(proverDid), - FfiConverterTypeCredentialDefinition.lower(credDef), - FfiConverterTypeLinkSecret.lower(linkSecret), - FfiConverterString.lower(linkSecretId), - FfiConverterTypeCredentialOffer.lower(credentialOffer), $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_prover_create_credential_request(self.pointer, + FfiConverterOptionString.lower(entropy), + FfiConverterOptionString.lower(proverDid), + FfiConverterTypeCredentialDefinition.lower(credDef), + FfiConverterTypeLinkSecret.lower(linkSecret), + FfiConverterString.lower(linkSecretId), + FfiConverterTypeCredentialOffer.lower(credentialOffer), $0) + } ) } @@ -1494,7 +1478,7 @@ public class RevocationRegistryDefinition: RevocationRegistryDefinitionProtocol } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_revocationregistrydefinition_new( FfiConverterString.lower(jsonString), $0 ) @@ -1543,10 +1527,9 @@ public class RevocationRegistryDefinition: RevocationRegistryDefinitionProtocol public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_revocationregistrydefinition_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_revocationregistrydefinition_get_json(self.pointer, $0) + } ) } } @@ -1604,7 +1587,7 @@ public class RevocationRegistryDefinitionPrivate: RevocationRegistryDefinitionPr } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_revocationregistrydefinitionprivate_new( FfiConverterString.lower(jsonString), $0 ) @@ -1617,10 +1600,9 @@ public class RevocationRegistryDefinitionPrivate: RevocationRegistryDefinitionPr public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_revocationregistrydefinitionprivate_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_revocationregistrydefinitionprivate_get_json(self.pointer, $0) + } ) } } @@ -1681,7 +1663,7 @@ public class RevocationRegistryDefinitionValue: RevocationRegistryDefinitionValu } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_revocationregistrydefinitionvalue_new( FfiConverterString.lower(jsonString), $0 ) @@ -1721,10 +1703,9 @@ public class RevocationRegistryDefinitionValue: RevocationRegistryDefinitionValu public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_revocationregistrydefinitionvalue_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_revocationregistrydefinitionvalue_get_json(self.pointer, $0) + } ) } } @@ -1782,7 +1763,7 @@ public class RevocationRegistryDefinitionValuePublicKeys: RevocationRegistryDefi } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_revocationregistrydefinitionvaluepublickeys_new( FfiConverterString.lower(jsonString), $0 ) @@ -1795,10 +1776,9 @@ public class RevocationRegistryDefinitionValuePublicKeys: RevocationRegistryDefi public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_revocationregistrydefinitionvaluepublickeys_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_revocationregistrydefinitionvaluepublickeys_get_json(self.pointer, $0) + } ) } } @@ -1856,7 +1836,7 @@ public class RevocationStatusList: RevocationStatusListProtocol { } public convenience init(jsonString: String) throws { - self.init(unsafeFromRawPointer: try rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + try self.init(unsafeFromRawPointer: rustCallWithError(FfiConverterTypeAnoncredsError.lift) { uniffi_anoncreds_fn_constructor_revocationstatuslist_new( FfiConverterString.lower(jsonString), $0 ) @@ -1869,10 +1849,9 @@ public class RevocationStatusList: RevocationStatusListProtocol { public func getJson() throws -> String { return try FfiConverterString.lift( - try - rustCallWithError(FfiConverterTypeAnoncredsError.lift) { - uniffi_anoncreds_fn_method_revocationstatuslist_get_json(self.pointer, $0) - } + rustCallWithError(FfiConverterTypeAnoncredsError.lift) { + uniffi_anoncreds_fn_method_revocationstatuslist_get_json(self.pointer, $0) + } ) } } @@ -2397,48 +2376,48 @@ public struct FfiConverterTypeAnoncredsError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AnoncredsError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return .ConversionError( - message: try FfiConverterString.read(from: &buf) + case 1: return try .ConversionError( + message: FfiConverterString.read(from: &buf) ) - case 2: return .SomethingWentWrong( - message: try FfiConverterString.read(from: &buf) + case 2: return try .SomethingWentWrong( + message: FfiConverterString.read(from: &buf) ) - case 3: return .CreateCrentialRequestError( - message: try FfiConverterString.read(from: &buf) + case 3: return try .CreateCrentialRequestError( + message: FfiConverterString.read(from: &buf) ) - case 4: return .CreateSchemaError( - message: try FfiConverterString.read(from: &buf) + case 4: return try .CreateSchemaError( + message: FfiConverterString.read(from: &buf) ) - case 5: return .CreateCredentialDefinition( - message: try FfiConverterString.read(from: &buf) + case 5: return try .CreateCredentialDefinition( + message: FfiConverterString.read(from: &buf) ) - case 6: return .CreateRevocationRegistryDef( - message: try FfiConverterString.read(from: &buf) + case 6: return try .CreateRevocationRegistryDef( + message: FfiConverterString.read(from: &buf) ) - case 7: return .CreateRevocationStatusList( - message: try FfiConverterString.read(from: &buf) + case 7: return try .CreateRevocationStatusList( + message: FfiConverterString.read(from: &buf) ) - case 8: return .UpdateRevocationStatusList( - message: try FfiConverterString.read(from: &buf) + case 8: return try .UpdateRevocationStatusList( + message: FfiConverterString.read(from: &buf) ) - case 9: return .CreateCredentialOffer( - message: try FfiConverterString.read(from: &buf) + case 9: return try .CreateCredentialOffer( + message: FfiConverterString.read(from: &buf) ) - case 10: return .CreateCredential( - message: try FfiConverterString.read(from: &buf) + case 10: return try .CreateCredential( + message: FfiConverterString.read(from: &buf) ) - case 11: return .ProcessCredential( - message: try FfiConverterString.read(from: &buf) + case 11: return try .ProcessCredential( + message: FfiConverterString.read(from: &buf) ) default: throw UniffiInternalError.unexpectedEnumCase @@ -2712,7 +2691,7 @@ private struct FfiConverterSequenceUInt32: FfiConverterRustBuffer { var seq = [UInt32]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - seq.append(try FfiConverterUInt32.read(from: &buf)) + try seq.append(FfiConverterUInt32.read(from: &buf)) } return seq } @@ -2734,7 +2713,7 @@ private struct FfiConverterSequenceString: FfiConverterRustBuffer { var seq = [String]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - seq.append(try FfiConverterString.read(from: &buf)) + try seq.append(FfiConverterString.read(from: &buf)) } return seq } @@ -2756,7 +2735,7 @@ private struct FfiConverterSequenceTypeAttributeValues: FfiConverterRustBuffer { var seq = [AttributeValues]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - seq.append(try FfiConverterTypeAttributeValues.read(from: &buf)) + try seq.append(FfiConverterTypeAttributeValues.read(from: &buf)) } return seq }