From 0c14db06421cbc0b82560323fd8f61fb5b73e4a3 Mon Sep 17 00:00:00 2001 From: Pat Nakajima Date: Mon, 25 Sep 2023 13:31:39 -0700 Subject: [PATCH] wip --- Package.resolved | 9 --------- Package.swift | 2 -- Sources/XMTP/ApiClient.swift | 2 -- Sources/XMTP/Client.swift | 1 - Sources/XMTP/Extensions/Data.swift | 5 ----- Sources/XMTP/Extensions/RustVec.swift | 19 ------------------- Sources/XMTP/KeyUtil.swift | 1 - Sources/XMTP/Messages/ContactBundle.swift | 1 - Sources/XMTP/Messages/MessageV2.swift | 1 - Sources/XMTP/Messages/PrivateKey.swift | 1 - .../XMTP/Messages/PrivateKeyBundleV1.swift | 2 -- .../XMTP/Messages/PrivateKeyBundleV2.swift | 1 - Sources/XMTP/Messages/PublicKey.swift | 2 -- Sources/XMTP/Messages/Signature.swift | 1 - Sources/XMTP/Messages/SignedPublicKey.swift | 2 -- Sources/XMTP/SigningKey.swift | 1 - Sources/XMTPTestHelpers/TestHelpers.swift | 1 - Tests/XMTPTests/ClientTests.swift | 1 - Tests/XMTPTests/IntegrationTests.swift | 2 -- Tests/XMTPTests/MessageTests.swift | 1 - Tests/XMTPTests/PaginationTests.swift | 1 - .../xcshareddata/swiftpm/Package.resolved | 9 --------- dev/local/docker-compose.yml | 1 - 23 files changed, 67 deletions(-) delete mode 100644 Sources/XMTP/Extensions/RustVec.swift diff --git a/Package.resolved b/Package.resolved index e5bfa207..44b91f0b 100644 --- a/Package.resolved +++ b/Package.resolved @@ -143,15 +143,6 @@ "revision" : "2d9d2188a08eef4a869d368daab21b3c08510991", "version" : "2.6.1" } - }, - { - "identity" : "xmtp-rust-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/xmtp/xmtp-rust-swift", - "state" : { - "revision" : "4a76e5401fa780c40610e2f0d248f695261d08dd", - "version" : "0.3.1-beta0" - } } ], "version" : 2 diff --git a/Package.swift b/Package.swift index 7c10ff07..f0308884 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,6 @@ let package = Package( .package(url: "https://github.com/1024jp/GzipSwift", from: "5.2.0"), .package(url: "https://github.com/bufbuild/connect-swift", from: "0.3.0"), .package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.0.0"), - .package(url: "https://github.com/xmtp/xmtp-rust-swift", from: "0.3.1-beta0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -38,7 +37,6 @@ let package = Package( "web3.swift", .product(name: "Gzip", package: "GzipSwift"), .product(name: "Connect", package: "connect-swift"), - .product(name: "XMTPRust", package: "xmtp-rust-swift"), ] ), .target( diff --git a/Sources/XMTP/ApiClient.swift b/Sources/XMTP/ApiClient.swift index 3d2d335a..01b32b52 100644 --- a/Sources/XMTP/ApiClient.swift +++ b/Sources/XMTP/ApiClient.swift @@ -6,8 +6,6 @@ // import Foundation -import XMTPRust -import XMTPRustSwift public typealias PublishRequest = Xmtp_MessageApi_V1_PublishRequest public typealias PublishResponse = Xmtp_MessageApi_V1_PublishResponse diff --git a/Sources/XMTP/Client.swift b/Sources/XMTP/Client.swift index 2ebffcf1..ba6bd3c0 100644 --- a/Sources/XMTP/Client.swift +++ b/Sources/XMTP/Client.swift @@ -7,7 +7,6 @@ import Foundation import web3 -import XMTPRust public enum ClientError: Error { case creationError(String) diff --git a/Sources/XMTP/Extensions/Data.swift b/Sources/XMTP/Extensions/Data.swift index 5d2ba4fc..e2bbdba3 100644 --- a/Sources/XMTP/Extensions/Data.swift +++ b/Sources/XMTP/Extensions/Data.swift @@ -6,17 +6,12 @@ // import Foundation -import XMTPRust extension Data { init?(base64String: String) { self.init(base64Encoded: Data(base64String.utf8)) } - init(_ rustVec: RustVec) { - self.init(rustVec.map { $0 }) - } - var toHex: String { return reduce("") { $0 + String(format: "%02x", $1) } } diff --git a/Sources/XMTP/Extensions/RustVec.swift b/Sources/XMTP/Extensions/RustVec.swift deleted file mode 100644 index f63d1f7d..00000000 --- a/Sources/XMTP/Extensions/RustVec.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// File.swift -// -// -// Created by Pat Nakajima on 4/24/23. -// - -import Foundation -import XMTPRust - -extension RustVec where T == UInt8 { - convenience init(_ data: Data) { - self.init() - - for byte in data { - push(value: byte) - } - } -} diff --git a/Sources/XMTP/KeyUtil.swift b/Sources/XMTP/KeyUtil.swift index dff570ba..149bb079 100644 --- a/Sources/XMTP/KeyUtil.swift +++ b/Sources/XMTP/KeyUtil.swift @@ -6,7 +6,6 @@ import Foundation import Logging import secp256k1 import web3 -import XMTPRust enum KeyUtilError: Error { case invalidContext diff --git a/Sources/XMTP/Messages/ContactBundle.swift b/Sources/XMTP/Messages/ContactBundle.swift index 267ac63d..6b85165d 100644 --- a/Sources/XMTP/Messages/ContactBundle.swift +++ b/Sources/XMTP/Messages/ContactBundle.swift @@ -6,7 +6,6 @@ // import web3 -import XMTPRust typealias ContactBundle = Xmtp_MessageContents_ContactBundle typealias ContactBundleV1 = Xmtp_MessageContents_ContactBundleV1 diff --git a/Sources/XMTP/Messages/MessageV2.swift b/Sources/XMTP/Messages/MessageV2.swift index 0b65ffbf..d4527419 100644 --- a/Sources/XMTP/Messages/MessageV2.swift +++ b/Sources/XMTP/Messages/MessageV2.swift @@ -7,7 +7,6 @@ import CryptoKit import Foundation -import XMTPRust typealias MessageV2 = Xmtp_MessageContents_MessageV2 diff --git a/Sources/XMTP/Messages/PrivateKey.swift b/Sources/XMTP/Messages/PrivateKey.swift index 35e7a3a3..a88adf16 100644 --- a/Sources/XMTP/Messages/PrivateKey.swift +++ b/Sources/XMTP/Messages/PrivateKey.swift @@ -6,7 +6,6 @@ // import Foundation -import XMTPRust import CryptoKit /// Represents a secp256k1 private key. ``PrivateKey`` conforms to ``SigningKey`` so you can use it diff --git a/Sources/XMTP/Messages/PrivateKeyBundleV1.swift b/Sources/XMTP/Messages/PrivateKeyBundleV1.swift index 5161f1d3..5afa0d91 100644 --- a/Sources/XMTP/Messages/PrivateKeyBundleV1.swift +++ b/Sources/XMTP/Messages/PrivateKeyBundleV1.swift @@ -7,8 +7,6 @@ import CryptoKit import Foundation -import XMTPRust - public typealias PrivateKeyBundleV1 = Xmtp_MessageContents_PrivateKeyBundleV1 diff --git a/Sources/XMTP/Messages/PrivateKeyBundleV2.swift b/Sources/XMTP/Messages/PrivateKeyBundleV2.swift index 031642b9..66ef9577 100644 --- a/Sources/XMTP/Messages/PrivateKeyBundleV2.swift +++ b/Sources/XMTP/Messages/PrivateKeyBundleV2.swift @@ -6,7 +6,6 @@ // import Foundation -import XMTPRust public typealias PrivateKeyBundleV2 = Xmtp_MessageContents_PrivateKeyBundleV2 diff --git a/Sources/XMTP/Messages/PublicKey.swift b/Sources/XMTP/Messages/PublicKey.swift index 6a3f7d79..06c2e479 100644 --- a/Sources/XMTP/Messages/PublicKey.swift +++ b/Sources/XMTP/Messages/PublicKey.swift @@ -6,8 +6,6 @@ // import Foundation - -import XMTPRust import web3 import CryptoKit diff --git a/Sources/XMTP/Messages/Signature.swift b/Sources/XMTP/Messages/Signature.swift index df390e87..7bb23f33 100644 --- a/Sources/XMTP/Messages/Signature.swift +++ b/Sources/XMTP/Messages/Signature.swift @@ -6,7 +6,6 @@ // import Foundation -import XMTPRust /// Represents a secp256k1 compact recoverable signature. public typealias Signature = Xmtp_MessageContents_Signature diff --git a/Sources/XMTP/Messages/SignedPublicKey.swift b/Sources/XMTP/Messages/SignedPublicKey.swift index bf0aabbd..2cbb4744 100644 --- a/Sources/XMTP/Messages/SignedPublicKey.swift +++ b/Sources/XMTP/Messages/SignedPublicKey.swift @@ -7,8 +7,6 @@ import CryptoKit import Foundation - -import XMTPRust import web3 typealias SignedPublicKey = Xmtp_MessageContents_SignedPublicKey diff --git a/Sources/XMTP/SigningKey.swift b/Sources/XMTP/SigningKey.swift index 7b9131a8..5360c0c8 100644 --- a/Sources/XMTP/SigningKey.swift +++ b/Sources/XMTP/SigningKey.swift @@ -7,7 +7,6 @@ import Foundation import web3 -import XMTPRust /// Defines a type that is used by a ``Client`` to sign keys and messages. /// diff --git a/Sources/XMTPTestHelpers/TestHelpers.swift b/Sources/XMTPTestHelpers/TestHelpers.swift index eb67dac6..ded6c0f8 100644 --- a/Sources/XMTPTestHelpers/TestHelpers.swift +++ b/Sources/XMTPTestHelpers/TestHelpers.swift @@ -9,7 +9,6 @@ import Combine import XCTest @testable import XMTP -import XMTPRust public struct TestConfig { static let TEST_SERVER_ENABLED = _env("TEST_SERVER_ENABLED") == "true" diff --git a/Tests/XMTPTests/ClientTests.swift b/Tests/XMTPTests/ClientTests.swift index 164043ae..93b37f8e 100644 --- a/Tests/XMTPTests/ClientTests.swift +++ b/Tests/XMTPTests/ClientTests.swift @@ -9,7 +9,6 @@ import Foundation import XCTest @testable import XMTP -import XMTPRust import XMTPTestHelpers @available(iOS 15, *) diff --git a/Tests/XMTPTests/IntegrationTests.swift b/Tests/XMTPTests/IntegrationTests.swift index abaae304..6684e75e 100644 --- a/Tests/XMTPTests/IntegrationTests.swift +++ b/Tests/XMTPTests/IntegrationTests.swift @@ -9,9 +9,7 @@ import Foundation import secp256k1 import web3 import XCTest -import XMTPRust @testable import XMTP -import XMTPRust import XMTPTestHelpers @available(macOS 13.0, *) diff --git a/Tests/XMTPTests/MessageTests.swift b/Tests/XMTPTests/MessageTests.swift index fda95262..bda8ef65 100644 --- a/Tests/XMTPTests/MessageTests.swift +++ b/Tests/XMTPTests/MessageTests.swift @@ -7,7 +7,6 @@ import CryptoKit import XCTest -import XMTPRust @testable import XMTP import XMTPTestHelpers diff --git a/Tests/XMTPTests/PaginationTests.swift b/Tests/XMTPTests/PaginationTests.swift index 8b792ab9..fac003bb 100644 --- a/Tests/XMTPTests/PaginationTests.swift +++ b/Tests/XMTPTests/PaginationTests.swift @@ -9,7 +9,6 @@ import Foundation import XCTest @testable import XMTP -import XMTPRust import XMTPTestHelpers @available(iOS 15, *) diff --git a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6187659e..a51a2425 100644 --- a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -170,15 +170,6 @@ "revision" : "2d9d2188a08eef4a869d368daab21b3c08510991", "version" : "2.6.1" } - }, - { - "identity" : "xmtp-rust-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/xmtp/xmtp-rust-swift", - "state" : { - "revision" : "4a76e5401fa780c40610e2f0d248f695261d08dd", - "version" : "0.3.1-beta0" - } } ], "version" : 2 diff --git a/dev/local/docker-compose.yml b/dev/local/docker-compose.yml index 227d5b80..90f2ed4f 100644 --- a/dev/local/docker-compose.yml +++ b/dev/local/docker-compose.yml @@ -2,7 +2,6 @@ version: "3.8" services: wakunode: image: xmtp/node-go - platform: linux/arm64 environment: - GOWAKU-NODEKEY=8a30dcb604b0b53627a5adc054dbf434b446628d4bd1eccc681d223f0550ce67 command: