From 2166f9f6bac3f23bfaf3719239ae3eeee7ca9504 Mon Sep 17 00:00:00 2001 From: ieow Date: Thu, 1 Feb 2024 14:41:24 +0800 Subject: [PATCH] feat: make client id required --- Sources/TorusUtils/TorusUtils.swift | 2 +- Tests/TorusUtilsTests/AquaTest.swift | 2 +- Tests/TorusUtilsTests/CyanTest.swift | 2 +- Tests/TorusUtilsTests/IntegrationTest.swift | 2 +- Tests/TorusUtilsTests/MainnetTest.swift | 2 +- Tests/TorusUtilsTests/SapphireTest.swift | 2 +- Tests/TorusUtilsTests/TestnetTest.swift | 2 +- Tests/TorusUtilsTests/oneKeyTest.swift | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/TorusUtils/TorusUtils.swift b/Sources/TorusUtils/TorusUtils.swift index 5fa7a6a2..7c9535d4 100644 --- a/Sources/TorusUtils/TorusUtils.swift +++ b/Sources/TorusUtils/TorusUtils.swift @@ -30,7 +30,7 @@ open class TorusUtils: AbstractTorusUtils { signerHost: String = "https://signer.tor.us/api/sign", allowHost: String = "https://signer.tor.us/api/allow", network: TorusNetwork = TorusNetwork.legacy(.MAINNET), - clientId: String = "", + clientId: String, legacyMetadataHost: String = "https://metadata.tor.us" ) { self.urlSession = urlSession diff --git a/Tests/TorusUtilsTests/AquaTest.swift b/Tests/TorusUtilsTests/AquaTest.swift index 8d1d9696..c96e5864 100644 --- a/Tests/TorusUtilsTests/AquaTest.swift +++ b/Tests/TorusUtilsTests/AquaTest.swift @@ -26,7 +26,7 @@ class AquaTest: XCTestCase { func getFNDAndTUData(verifer: String, veriferID: String, enableOneKey: Bool = false) async throws -> AllNodeDetailsModel { let nodeDetails = try await fnd.getNodeDetails(verifier: verifer, verifierID: veriferID) - tu = TorusUtils(enableOneKey: enableOneKey, signerHost: signerHost, allowHost: allowHost, network: .legacy(.AQUA)) + tu = TorusUtils(enableOneKey: enableOneKey, signerHost: signerHost, allowHost: allowHost, network: .legacy(.AQUA), clientId: "YOUR_CLIENT_ID") return nodeDetails } diff --git a/Tests/TorusUtilsTests/CyanTest.swift b/Tests/TorusUtilsTests/CyanTest.swift index 959efec2..f1ba0934 100644 --- a/Tests/TorusUtilsTests/CyanTest.swift +++ b/Tests/TorusUtilsTests/CyanTest.swift @@ -26,7 +26,7 @@ class CyanTest: XCTestCase { func getFNDAndTUData(verifer: String, veriferID: String, enableOneKey: Bool = false) async throws -> AllNodeDetailsModel { let nodeDetails = try await fnd.getNodeDetails(verifier: verifer, verifierID: veriferID) - tu = TorusUtils(enableOneKey: enableOneKey, signerHost: signerHost, allowHost: allowHost, network: .legacy(.CYAN)) + tu = TorusUtils(enableOneKey: enableOneKey, signerHost: signerHost, allowHost: allowHost, network: .legacy(.CYAN), clientId: "YOUR_CLIENT_ID") return nodeDetails } diff --git a/Tests/TorusUtilsTests/IntegrationTest.swift b/Tests/TorusUtilsTests/IntegrationTest.swift index 43e61525..c4aeeb1a 100644 --- a/Tests/TorusUtilsTests/IntegrationTest.swift +++ b/Tests/TorusUtilsTests/IntegrationTest.swift @@ -40,7 +40,7 @@ class IntegrationTests: XCTestCase { func get_fnd_and_tu_data(verifer: String, veriferID: String, enableOneKey: Bool = false) async throws -> AllNodeDetailsModel { let nodeDetails = try await fnd.getNodeDetails(verifier: verifer, verifierID: veriferID) - tu = TorusUtils(enableOneKey: enableOneKey, network: .legacy(.TESTNET)) + tu = TorusUtils(enableOneKey: enableOneKey, network: .legacy(.TESTNET), clientId: "YOUR_CLIENT_ID") return nodeDetails } diff --git a/Tests/TorusUtilsTests/MainnetTest.swift b/Tests/TorusUtilsTests/MainnetTest.swift index 5449a984..41f202d7 100644 --- a/Tests/TorusUtilsTests/MainnetTest.swift +++ b/Tests/TorusUtilsTests/MainnetTest.swift @@ -36,7 +36,7 @@ class MainnetTests: XCTestCase { func get_fnd_and_tu_data(verifer: String, veriferID: String, enableOneKey: Bool = false) async throws -> AllNodeDetailsModel { let nodeDetails = try await fnd.getNodeDetails(verifier: verifer, verifierID: veriferID) - tu = TorusUtils(enableOneKey: enableOneKey, network: .legacy(.MAINNET)) + tu = TorusUtils(enableOneKey: enableOneKey, network: .legacy(.MAINNET), clientId: "YOUR_CLIENT_ID") return nodeDetails } diff --git a/Tests/TorusUtilsTests/SapphireTest.swift b/Tests/TorusUtilsTests/SapphireTest.swift index f7eef28f..979d1ab9 100644 --- a/Tests/TorusUtilsTests/SapphireTest.swift +++ b/Tests/TorusUtilsTests/SapphireTest.swift @@ -38,7 +38,7 @@ final class SapphireTest: XCTestCase { func get_fnd_and_tu_data(verifer: String, veriferID: String, enableOneKey: Bool = false) async throws -> AllNodeDetailsModel { let nodeDetails = try await fnd.getNodeDetails(verifier: verifer, verifierID: veriferID) - torus = TorusUtils(enableOneKey: enableOneKey, network: .sapphire(.SAPPHIRE_DEVNET)) + torus = TorusUtils(enableOneKey: enableOneKey, network: .sapphire(.SAPPHIRE_DEVNET), clientId: "YOUR_CLIENT_ID") return nodeDetails } diff --git a/Tests/TorusUtilsTests/TestnetTest.swift b/Tests/TorusUtilsTests/TestnetTest.swift index 362e4489..6a6c31d5 100644 --- a/Tests/TorusUtilsTests/TestnetTest.swift +++ b/Tests/TorusUtilsTests/TestnetTest.swift @@ -26,7 +26,7 @@ class TestnetTest: XCTestCase { func getFNDAndTUData(verifer: String, veriferID: String, enableOneKey: Bool = false) async throws -> AllNodeDetailsModel { let nodeDetails = try await fnd.getNodeDetails(verifier: verifer, verifierID: veriferID) - tu = TorusUtils(enableOneKey: enableOneKey, signerHost: signerHost, allowHost: allowHost, network: .legacy(.TESTNET)) + tu = TorusUtils(enableOneKey: enableOneKey, signerHost: signerHost, allowHost: allowHost, network: .legacy(.TESTNET), clientId: "YOUR_CLIENT_ID") return nodeDetails } diff --git a/Tests/TorusUtilsTests/oneKeyTest.swift b/Tests/TorusUtilsTests/oneKeyTest.swift index 75ea8b04..2646bd51 100644 --- a/Tests/TorusUtilsTests/oneKeyTest.swift +++ b/Tests/TorusUtilsTests/oneKeyTest.swift @@ -25,7 +25,7 @@ class OneKeyTest: XCTestCase { func getFNDAndTUData(verifer: String, veriferID: String, enableOneKey: Bool = true) async throws -> AllNodeDetailsModel { do { let nodeDetails = try await fnd.getNodeDetails(verifier: verifer, verifierID: veriferID) - tu = TorusUtils(enableOneKey: enableOneKey, network: .legacy(.TESTNET)) + tu = TorusUtils(enableOneKey: enableOneKey, network: .legacy(.TESTNET), clientId: "YOUR_CLIENT_ID") return nodeDetails } catch { throw error