Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update for cocoapods #28

Merged
merged 5 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright (c) 2020 Torus Labs Private Limited (https://tor.us)

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

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.

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.

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.
15 changes: 7 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ let package = Package(
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "tkey-mpc-swift",
targets: ["tkey-mpc-swift"]),
name: "tkey",
targets: ["tkey"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.0.0"),
.package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.0.3"),
// dev dependencies only
.package(name:"CryptoSwift", url: "https://github.com/krzyzanowskim/CryptoSwift.git",from: "1.5.1"),
.package(name:"jwt-kit", url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
],
targets: [
Expand All @@ -28,18 +27,18 @@ let package = Package(
.binaryTarget(name: "libtkey",
path: "Sources/libtkey/libtkey.xcframework"
),
.target(name: "tkey",
.target(name: "lib",
dependencies: ["libtkey"],
path: "Sources/libtkey"
),
.target(
name: "tkey-mpc-swift",
dependencies: ["tkey", "TorusUtils"],
name: "tkey",
dependencies: ["lib", "TorusUtils"],
path: "Sources/ThresholdKey"
),
.testTarget(
name: "tkey-pkgTests",
dependencies: ["tkey-mpc-swift", "CryptoSwift", .product(name: "JWTKit", package: "jwt-kit")],
dependencies: ["tkey", .product(name: "JWTKit", package: "jwt-kit")],
path: "Tests/tkeypkgTests"
),
]
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/KeyPoint.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif


Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/NodeDetails.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class NodeDetails {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/PrivateKey.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class PrivateKey {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/ShareStore.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareStore {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/TssOptions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class TssOptions {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/GenerateShareStoreResult.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class GenerateShareStoreResult {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/KeyDetails.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class KeyDetails {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/KeyPointArray.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public class KeyPointArray {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/KeyReconstructionDetails.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class KeyReconstructionDetails: Codable {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/LocalMetadataTransitions.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class LocalMetadataTransitions {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Metadata.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class Metadata {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/PrivateKeysModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public struct KeyData: Decodable {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/SecurityQuestionModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class SecurityQuestionModule {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/SeedPhraseModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public struct SeedPhrase: Codable {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/ShareSerializationModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareSerializationModule {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/ShareTransferModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareTransferModule {
Expand Down
5 changes: 2 additions & 3 deletions Sources/ThresholdKey/Modules/TssModule.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Foundation

import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif
import CommonSources
import FetchNodeDetails
import TorusUtils

Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Polynomial.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class Polynomial {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/PublicPolynomial.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class PublicPolynomial {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/RssComm.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class RssComm {
Expand Down
5 changes: 2 additions & 3 deletions Sources/ThresholdKey/ServiceProvider.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Foundation
import TorusUtils
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif
import FetchNodeDetails
import CommonSources

public final class ServiceProvider {
private(set) var pointer: OpaquePointer?
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareMap.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareMap {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareStoreArray.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public class ShareStoreArray {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareStoreMap.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareStoreMap {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareStorePolyIdIndexMap.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareStorePolyIdIndexMap {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareTransferStore.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareTransferStore {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/StorageLayer.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif


Expand Down
6 changes: 3 additions & 3 deletions Sources/ThresholdKey/ThresholdKey.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif
import CommonSources
import FetchNodeDetails
import TorusUtils

public class ThresholdKey {
Expand Down
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Version.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

/// Returns the library version.
Expand Down
3 changes: 1 addition & 2 deletions Tests/tkeypkgTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import CommonSources
import FetchNodeDetails
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import TorusUtils
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgPrivateKeyModuleTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgSecurityQuestionModuleTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgSeedPhraseModuleTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareSerializationModuleTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareTransferModuleTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/tkeypkgTests/tkey_base.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import Foundation
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import TorusUtils

class tkey_baseTests: XCTestCase {

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

override func setUp() async throws {
let postbox_key = try! PrivateKey.generate()
Expand Down
Loading
Loading