From d66813b22d434ddf7262907d74dcc22b13fe7996 Mon Sep 17 00:00:00 2001 From: kele-leanes Date: Mon, 4 Dec 2023 17:39:15 -0300 Subject: [PATCH] use correct type --- Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift | 2 +- Sources/XMTP/Messages/PrivateKeyBundle.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift b/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift index f16e6300..1684d31d 100644 --- a/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift +++ b/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift @@ -8,7 +8,7 @@ typealias EncryptedPrivateKeyBundle = Xmtp_MessageContents_EncryptedPrivateKeyBundle extension EncryptedPrivateKeyBundle { - func decrypted(with key: SigningKey, preEnableIdentityCallback: (() async throws -> Void)? = nil) async throws -> PrivateKeyBundle { + func decrypted(with key: SigningKey, preEnableIdentityCallback: PreEventCallback? = nil) async throws -> PrivateKeyBundle { try await preEnableIdentityCallback?() let signature = try await key.sign(message: Signature.enableIdentityText(key: v1.walletPreKey)) let message = try Crypto.decrypt(signature.rawDataWithNormalizedRecovery, v1.ciphertext) diff --git a/Sources/XMTP/Messages/PrivateKeyBundle.swift b/Sources/XMTP/Messages/PrivateKeyBundle.swift index 0e64ffa5..e6f21ade 100644 --- a/Sources/XMTP/Messages/PrivateKeyBundle.swift +++ b/Sources/XMTP/Messages/PrivateKeyBundle.swift @@ -20,7 +20,7 @@ extension PrivateKeyBundle { self.v1 = v1 } - func encrypted(with key: SigningKey, preEnableIdentityCallback: (() async throws -> Void)? = nil) async throws -> EncryptedPrivateKeyBundle { + func encrypted(with key: SigningKey, preEnableIdentityCallback: PreEventCallback? = nil) async throws -> EncryptedPrivateKeyBundle { let bundleBytes = try serializedData() let walletPreKey = try Crypto.secureRandomBytes(count: 32)