Skip to content

Commit 6be7339

Browse files
authored
Merge pull request #28 from tkey/cocoapods
feat: update for cocoapods
2 parents 0b1020f + 8fe0cc8 commit 6be7339

File tree

60 files changed

+120
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+120
-112
lines changed

License.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright (c) 2020 Torus Labs Private Limited (https://tor.us)
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Package.swift

+7-8
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ let package = Package(
1111
products: [
1212
// Products define the executables and libraries a package produces, and make them visible to other packages.
1313
.library(
14-
name: "tkey-mpc-swift",
15-
targets: ["tkey-mpc-swift"]),
14+
name: "tkey",
15+
targets: ["tkey"]),
1616
],
1717
dependencies: [
1818
// Dependencies declare other packages that this package depends on.
1919
// .package(url: /* package url */, from: "1.0.0"),
20-
.package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.0.0"),
20+
.package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.1.0"),
2121
// dev dependencies only
22-
.package(name:"CryptoSwift", url: "https://github.com/krzyzanowskim/CryptoSwift.git",from: "1.5.1"),
2322
.package(name:"jwt-kit", url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
2423
],
2524
targets: [
@@ -28,18 +27,18 @@ let package = Package(
2827
.binaryTarget(name: "libtkey",
2928
path: "Sources/libtkey/libtkey.xcframework"
3029
),
31-
.target(name: "tkey",
30+
.target(name: "lib",
3231
dependencies: ["libtkey"],
3332
path: "Sources/libtkey"
3433
),
3534
.target(
36-
name: "tkey-mpc-swift",
37-
dependencies: ["tkey", "TorusUtils"],
35+
name: "tkey",
36+
dependencies: ["lib", "TorusUtils"],
3837
path: "Sources/ThresholdKey"
3938
),
4039
.testTarget(
4140
name: "tkey-pkgTests",
42-
dependencies: ["tkey-mpc-swift", "CryptoSwift", .product(name: "JWTKit", package: "jwt-kit")],
41+
dependencies: ["tkey", .product(name: "JWTKit", package: "jwt-kit")],
4342
path: "Tests/tkeypkgTests"
4443
),
4544
]

Sources/ThresholdKey/Common/KeyPoint.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66

Sources/ThresholdKey/Common/NodeDetails.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class NodeDetails {

Sources/ThresholdKey/Common/PrivateKey.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class PrivateKey {

Sources/ThresholdKey/Common/ShareStore.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class ShareStore {

Sources/ThresholdKey/Common/TssOptions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class TssOptions {

Sources/ThresholdKey/GenerateShareStoreResult.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class GenerateShareStoreResult {

Sources/ThresholdKey/KeyDetails.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class KeyDetails {

Sources/ThresholdKey/KeyPointArray.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

3-
#if canImport(tkey)
4-
import tkey
3+
#if canImport(lib)
4+
import lib
55
#endif
66

77
public class KeyPointArray {

Sources/ThresholdKey/KeyReconstructionDetails.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class KeyReconstructionDetails: Codable {

Sources/ThresholdKey/LocalMetadataTransitions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

3-
#if canImport(tkey)
4-
import tkey
3+
#if canImport(lib)
4+
import lib
55
#endif
66

77
public final class LocalMetadataTransitions {

Sources/ThresholdKey/Metadata.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class Metadata {

Sources/ThresholdKey/Modules/PrivateKeysModule.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public struct KeyData: Decodable {

Sources/ThresholdKey/Modules/SecurityQuestionModule.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class SecurityQuestionModule {

Sources/ThresholdKey/Modules/SeedPhraseModule.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public struct SeedPhrase: Codable {

Sources/ThresholdKey/Modules/ShareSerializationModule.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class ShareSerializationModule {

Sources/ThresholdKey/Modules/ShareTransferModule.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class ShareTransferModule {

Sources/ThresholdKey/Modules/TssModule.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import Foundation
22

33
import Foundation
4-
#if canImport(tkey)
5-
import tkey
4+
#if canImport(lib)
5+
import lib
66
#endif
7-
import CommonSources
87
import FetchNodeDetails
98
import TorusUtils
109

Sources/ThresholdKey/Polynomial.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class Polynomial {

Sources/ThresholdKey/PublicPolynomial.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class PublicPolynomial {

Sources/ThresholdKey/RssComm.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class RssComm {

Sources/ThresholdKey/ServiceProvider.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import Foundation
22
import TorusUtils
3-
#if canImport(tkey)
4-
import tkey
3+
#if canImport(lib)
4+
import lib
55
#endif
66
import FetchNodeDetails
7-
import CommonSources
87

98
public final class ServiceProvider {
109
private(set) var pointer: OpaquePointer?

Sources/ThresholdKey/ShareMap.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class ShareMap {

Sources/ThresholdKey/ShareStoreArray.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

3-
#if canImport(tkey)
4-
import tkey
3+
#if canImport(lib)
4+
import lib
55
#endif
66

77
public class ShareStoreArray {

Sources/ThresholdKey/ShareStoreMap.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class ShareStoreMap {

Sources/ThresholdKey/ShareStorePolyIdIndexMap.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class ShareStorePolyIdIndexMap {

Sources/ThresholdKey/ShareTransferStore.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
public final class ShareTransferStore {

Sources/ThresholdKey/StorageLayer.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66

Sources/ThresholdKey/ThresholdKey.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
5-
import CommonSources
5+
import FetchNodeDetails
66
import TorusUtils
77

88
public class ThresholdKey {

Sources/ThresholdKey/Version.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
#if canImport(tkey)
3-
import tkey
2+
#if canImport(lib)
3+
import lib
44
#endif
55

66
/// Returns the library version.

Tests/tkeypkgTests/IntegrationTests.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import CommonSources
21
import FetchNodeDetails
32
import Foundation
4-
@testable import tkey_mpc_swift
3+
@testable import tkey
54
import TorusUtils
65
import XCTest
76

Tests/tkeypkgTests/modules/tkey_pkgPrivateKeysModuleTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
22
import Foundation
3-
@testable import tkey_mpc_swift
3+
@testable import tkey
44
import Foundation
55

66
final class tkey_pkgPrivateKeyModuleTests: XCTestCase {

Tests/tkeypkgTests/modules/tkey_pkgSecurityQuestionModuleTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
22
import Foundation
3-
@testable import tkey_mpc_swift
3+
@testable import tkey
44
import Foundation
55

66
final class tkey_pkgSecurityQuestionModuleTests: XCTestCase {

Tests/tkeypkgTests/modules/tkey_pkgSeedPhraseModuleTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
22
import Foundation
3-
@testable import tkey_mpc_swift
3+
@testable import tkey
44
import Foundation
55

66
final class tkey_pkgSeedPhraseModuleTests: XCTestCase {

Tests/tkeypkgTests/modules/tkey_pkgShareSerializationModuleTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
22
import Foundation
3-
@testable import tkey_mpc_swift
3+
@testable import tkey
44
import Foundation
55

66
final class tkey_pkgShareSerializationModuleTests: XCTestCase {

Tests/tkeypkgTests/modules/tkey_pkgShareTransferModuleTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
22
import Foundation
3-
@testable import tkey_mpc_swift
3+
@testable import tkey
44
import Foundation
55

66
final class tkey_pkgShareTransferModuleTests: XCTestCase {

Tests/tkeypkgTests/tkey_base.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
import Foundation
99
import XCTest
1010
import Foundation
11-
@testable import tkey_mpc_swift
11+
@testable import tkey
1212
import TorusUtils
1313

1414
class tkey_baseTests: XCTestCase {
1515

16-
var torus = TorusUtils.init(clientId: "CLIENT ID")
16+
var torus = TorusUtils.init(network: .sapphire(.SAPPHIRE_DEVNET), clientId: "CLIENT ID")
1717

1818
override func setUp() async throws {
1919
let postbox_key = try! PrivateKey.generate()

0 commit comments

Comments
 (0)