From 892b62c3de22ee7f1df2360a818d7ea39d8bf8cb Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 11 Dec 2024 11:38:14 +0800 Subject: [PATCH] fix: getAggregateTorusKey, make init public for TorusGenericContainer --- Sources/CustomAuth/Common/TorusGenericContainer.swift | 2 +- Sources/CustomAuth/CustomAuth.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/CustomAuth/Common/TorusGenericContainer.swift b/Sources/CustomAuth/Common/TorusGenericContainer.swift index ca1abf0..fddec8f 100644 --- a/Sources/CustomAuth/Common/TorusGenericContainer.swift +++ b/Sources/CustomAuth/Common/TorusGenericContainer.swift @@ -3,7 +3,7 @@ import Foundation public class TorusGenericContainer: Codable { public let params: [String: String] - init(params: [String: String]) { + public init(params: [String: String]) { self.params = params } } diff --git a/Sources/CustomAuth/CustomAuth.swift b/Sources/CustomAuth/CustomAuth.swift index 2ea27aa..a8243e8 100644 --- a/Sources/CustomAuth/CustomAuth.swift +++ b/Sources/CustomAuth/CustomAuth.swift @@ -191,9 +191,9 @@ public class CustomAuth { aggregateIdTokenSeeds.sort() let joined = aggregateIdTokenSeeds.joined(separator: "\u{29}").data(using: .utf8)! - let aggregateIdToken = try keccak256(data: joined) + let aggregateIdToken = try keccak256(data: joined).hexString let params: VerifierParams = VerifierParams(verifier_id: verifierParams.verifier_id, extended_verifier_id: verifierParams.extended_verifier_id, sub_verifier_ids: subVerifierIds, verify_params: verifyParams) - return try await torus.retrieveShares(endpoints: nodeDetails.getTorusNodeEndpoints(), verifier: verifier, verifierParams: params, idToken: String(data: aggregateIdToken, encoding: .utf8)!) + return try await torus.retrieveShares(endpoints: nodeDetails.getTorusNodeEndpoints(), verifier: verifier, verifierParams: params, idToken: aggregateIdToken) } }