diff --git a/Sources/ElixxirDAppsSDK/Legacy/PasswordGenerator.swift b/Sources/ElixxirDAppsSDK/GenerateSecret.swift similarity index 51% rename from Sources/ElixxirDAppsSDK/Legacy/PasswordGenerator.swift rename to Sources/ElixxirDAppsSDK/GenerateSecret.swift index 4c5b978e7fd7e14ee367f437482aee25872fd655..3cf80be8712889deb0e3e035aaa7415e186408d4 100644 --- a/Sources/ElixxirDAppsSDK/Legacy/PasswordGenerator.swift +++ b/Sources/ElixxirDAppsSDK/GenerateSecret.swift @@ -1,6 +1,7 @@ import Bindings +import XCTestDynamicOverlay -public struct PasswordGenerator { +public struct GenerateSecret { public var run: (Int) -> Data public func callAsFunction(numBytes: Int = 32) -> Data { @@ -8,8 +9,8 @@ public struct PasswordGenerator { } } -extension PasswordGenerator { - public static let live = PasswordGenerator { numBytes in +extension GenerateSecret { + public static let live = GenerateSecret { numBytes in guard let secret = BindingsGenerateSecret(numBytes) else { fatalError("BindingsGenerateSecret returned `nil`") } @@ -17,10 +18,8 @@ extension PasswordGenerator { } } -#if DEBUG -extension PasswordGenerator { - public static let failing = PasswordGenerator { _ in - fatalError("Not implemented") - } +extension GenerateSecret { + public static let unimplemented = GenerateSecret( + run: XCTUnimplemented("\(Self.self)") + ) } -#endif