From d45e2bb094ac8cb0be18da1807ba7946ca195efc Mon Sep 17 00:00:00 2001 From: Adam Mork Date: Fri, 14 Apr 2023 19:31:10 -0700 Subject: [PATCH] Add Swift Generator for HTTP Protobuf Clients (#246) * version change 4.1 * move generated and interface wrappers to libmobilecoin * update small things to make it compatible * update libmobilecoin and podfiles * latest libmobilecoin * update lock files * fix imports in libmobilecoin, update versions in podspec * fix import on test file, update libmobilecoin * remove duplicate conformance to fix warnings --- Example/Podfile.lock | 24 +- ExampleHTTP/Podfile.lock | 24 +- MobileCoin.podspec | 6 +- .../Network/HTTPS/DefaultHttpRequester.swift | 1 + .../ArbitraryHttpConnection.swift | 1 + .../HTTPInterface/HTTPCallOptions.swift | 17 -- .../HTTPInterface/HTTPClient.swift | 31 -- .../HTTPInterface/HTTPClientCall.swift | 38 --- .../HTTPInterface/HTTPMethod.swift | 14 - .../HTTPInterface/HTTPResponse.swift | 33 --- .../HTTPInterface/HTTPStatus.swift | 56 ---- .../HTTPInterface/HTTPUnaryCall.swift | 37 --- .../HttpCallable/HttpCallable.swift | 1 + .../HTTPS/HttpConnection/HttpConnection.swift | 1 + .../ConsensusHttpConnection.swift | 2 +- .../FogKeyImageHttpConnection.swift | 2 +- .../FogViewHttpConnection.swift | 2 +- .../HttpProtoGenerated/attest.http.swift | 90 ------ .../consensus_client.http.swift | 59 ---- .../consensus_common.http.swift | 83 ------ .../HttpProtoGenerated/ledger.http.swift | 276 ------------------ .../HttpProtoGenerated/report.http.swift | 78 ----- .../HttpProtoGenerated/view.http.swift | 96 ------ Sources/Network/HTTPS/RestApiRequester.swift | 1 + .../Network/HTTPS/Utils/HttpCallResult.swift | 1 + Sources/Network/HttpRequester.swift | 1 + Tests/Mocks/MockFailingHttpRequester.swift | 1 + Vendor/libmobilecoin-ios-artifacts | 2 +- 28 files changed, 39 insertions(+), 939 deletions(-) delete mode 100644 Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPCallOptions.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClient.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClientCall.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPMethod.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPResponse.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPStatus.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPUnaryCall.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/attest.http.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_client.http.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_common.http.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/ledger.http.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/report.http.swift delete mode 100644 Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/view.http.swift diff --git a/Example/Podfile.lock b/Example/Podfile.lock index da7705fd..d2801b4c 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -19,33 +19,33 @@ PODS: - SwiftNIOTransportServices (< 2.0.0, >= 1.6.0) - SwiftProtobuf (< 2.0.0, >= 1.9.0) - Keys (1.0.1) - - LibMobileCoin/Core (4.1.0): + - LibMobileCoin/Core (4.1.2): - gRPC-Swift - SwiftProtobuf (~> 1.5) - Logging (1.4.0) - - MobileCoin (4.1.0) - - MobileCoin/Core (4.1.0): + - MobileCoin (4.1.2) + - MobileCoin/Core (4.1.2): - gRPC-Swift (= 1.0.0) - - LibMobileCoin/Core (~> 4.1.0) + - LibMobileCoin/Core (~> 4.1.2) - Logging (~> 1.4) - SwiftLint - SwiftNIO (~> 2.40.0) - SwiftNIOHPACK (~> 1.16.3) - SwiftNIOHTTP1 (~> 2.40.0) - SwiftProtobuf - - MobileCoin/Core/ProtocolUnitTests (4.1.0): + - MobileCoin/Core/ProtocolUnitTests (4.1.2): - gRPC-Swift (= 1.0.0) - - LibMobileCoin/Core (~> 4.1.0) + - LibMobileCoin/Core (~> 4.1.2) - Logging (~> 1.4) - SwiftLint - SwiftNIO (~> 2.40.0) - SwiftNIOHPACK (~> 1.16.3) - SwiftNIOHTTP1 (~> 2.40.0) - SwiftProtobuf - - MobileCoin/IntegrationNonTransactingTests (4.1.0) - - MobileCoin/IntegrationTransactingTests (4.1.0) - - MobileCoin/PerformanceTests (4.1.0) - - MobileCoin/Tests (4.1.0) + - MobileCoin/IntegrationNonTransactingTests (4.1.2) + - MobileCoin/IntegrationTransactingTests (4.1.2) + - MobileCoin/PerformanceTests (4.1.2) + - MobileCoin/Tests (4.1.2) - SwiftLint (0.47.1) - SwiftNIO (2.40.0): - _NIODataStructures (= 2.40.0) @@ -224,9 +224,9 @@ SPEC CHECKSUMS: CNIOWindows: 3047f2d8165848a3936a0a755fee27c6b5ee479b gRPC-Swift: 77154009a019e97f8c4bd8f2bb75fe9726801157 Keys: a576f4c9c1c641ca913a959a9c62ed3f215a8de9 - LibMobileCoin: 754c5883520cfb03c02496b9a762bd3ecbd7d048 + LibMobileCoin: 9730ed51ef056c3e7f3ff4cdc0aff0ea0bd2626a Logging: beeb016c9c80cf77042d62e83495816847ef108b - MobileCoin: 482ffc47f96b27cb38a59c38d1568e1d42370c24 + MobileCoin: 0e736d7807c174ed94d8280230d9bb461d4d9b82 SwiftLint: f80f1be7fa96d30e0aa68e58d45d4ea1ccaac519 SwiftNIO: 829958aab300642625091f82fc2f49cb7cf4ef24 SwiftNIOConcurrencyHelpers: 697370136789b1074e4535eaae75cbd7f900370e diff --git a/ExampleHTTP/Podfile.lock b/ExampleHTTP/Podfile.lock index a85f5bed..42fbc51f 100644 --- a/ExampleHTTP/Podfile.lock +++ b/ExampleHTTP/Podfile.lock @@ -1,21 +1,21 @@ PODS: - Keys (1.0.1) - - LibMobileCoin/CoreHTTP (4.1.0): + - LibMobileCoin/CoreHTTP (4.1.2): - SwiftProtobuf (~> 1.5) - Logging (1.4.0) - - MobileCoin (4.1.0) - - MobileCoin/CoreHTTP (4.1.0): - - LibMobileCoin/CoreHTTP (~> 4.1.0) + - MobileCoin (4.1.2) + - MobileCoin/CoreHTTP (4.1.2): + - LibMobileCoin/CoreHTTP (~> 4.1.2) - Logging (~> 1.4) - SwiftLint - - MobileCoin/CoreHTTP/HttpProtocolUnitTests (4.1.0): - - LibMobileCoin/CoreHTTP (~> 4.1.0) + - MobileCoin/CoreHTTP/HttpProtocolUnitTests (4.1.2): + - LibMobileCoin/CoreHTTP (~> 4.1.2) - Logging (~> 1.4) - SwiftLint - - MobileCoin/IntegrationNonTransactingTests (4.1.0) - - MobileCoin/IntegrationTransactingTests (4.1.0) - - MobileCoin/PerformanceTests (4.1.0) - - MobileCoin/Tests (4.1.0) + - MobileCoin/IntegrationNonTransactingTests (4.1.2) + - MobileCoin/IntegrationTransactingTests (4.1.2) + - MobileCoin/PerformanceTests (4.1.2) + - MobileCoin/Tests (4.1.2) - SwiftLint (0.47.1) - SwiftProtobuf (1.19.0) @@ -48,9 +48,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Keys: a576f4c9c1c641ca913a959a9c62ed3f215a8de9 - LibMobileCoin: 754c5883520cfb03c02496b9a762bd3ecbd7d048 + LibMobileCoin: 9730ed51ef056c3e7f3ff4cdc0aff0ea0bd2626a Logging: beeb016c9c80cf77042d62e83495816847ef108b - MobileCoin: 482ffc47f96b27cb38a59c38d1568e1d42370c24 + MobileCoin: 0e736d7807c174ed94d8280230d9bb461d4d9b82 SwiftLint: f80f1be7fa96d30e0aa68e58d45d4ea1ccaac519 SwiftProtobuf: 6ef3f0e422ef90d6605ca20b21a94f6c1324d6b3 diff --git a/MobileCoin.podspec b/MobileCoin.podspec index bf53577a..4419706c 100644 --- a/MobileCoin.podspec +++ b/MobileCoin.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # s.name = "MobileCoin" - s.version = "4.1.0" + s.version = "4.1.2" s.summary = "A library for communicating with MobileCoin network" s.author = "MobileCoin" @@ -63,7 +63,7 @@ Pod::Spec.new do |s| "Sources/Network/*.{h,m,swift}", ] - subspec.dependency "LibMobileCoin/Core", "~> 4.1.0" + subspec.dependency "LibMobileCoin/Core", "~> 4.1.2" subspec.dependency "gRPC-Swift", "1.0.0" subspec.dependency "Logging", "~> 1.4" @@ -95,7 +95,7 @@ Pod::Spec.new do |s| "Sources/Network/*.{h,m,swift}", ] - subspec.dependency "LibMobileCoin/CoreHTTP", "~> 4.1.0" + subspec.dependency "LibMobileCoin/CoreHTTP", "~> 4.1.2" subspec.dependency "Logging", "~> 1.4" diff --git a/Sources/Network/HTTPS/DefaultHttpRequester.swift b/Sources/Network/HTTPS/DefaultHttpRequester.swift index 9e14eb81..2f059c08 100644 --- a/Sources/Network/HTTPS/DefaultHttpRequester.swift +++ b/Sources/Network/HTTPS/DefaultHttpRequester.swift @@ -3,6 +3,7 @@ // import Foundation +import LibMobileCoin public class DefaultHttpRequester: NSObject, HttpRequester { private var fogTrustRoots: SecSSLCertificates? diff --git a/Sources/Network/HTTPS/HttpConnection/ArbitraryHttpConnection.swift b/Sources/Network/HTTPS/HttpConnection/ArbitraryHttpConnection.swift index 1048efa5..c575bb43 100644 --- a/Sources/Network/HTTPS/HttpConnection/ArbitraryHttpConnection.swift +++ b/Sources/Network/HTTPS/HttpConnection/ArbitraryHttpConnection.swift @@ -3,6 +3,7 @@ // import Foundation +import LibMobileCoin class ArbitraryHttpConnection { private let inner: SerialDispatchLock diff --git a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPCallOptions.swift b/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPCallOptions.swift deleted file mode 100644 index e92ff263..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPCallOptions.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// - -import Foundation - -public struct HTTPCallOptions { - var headers: [String: String] - var timeoutIntervalForRequest: TimeInterval? - var timeoutIntervalForResource: TimeInterval? -} - -extension HTTPCallOptions { - public init() { - self.init(headers: [:], timeoutIntervalForRequest: 30, timeoutIntervalForResource: 30) - } -} diff --git a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClient.swift b/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClient.swift deleted file mode 100644 index 8580afc6..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClient.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// - -import Foundation -import SwiftProtobuf - -/// A HTTP client. -public protocol HTTPClient { - /// The call options to use should the user not provide per-call options. - var defaultHTTPCallOptions: HTTPCallOptions { get set } -} - -extension HTTPClient { - public func makeUnaryCall( - path: String, - request: Request, - callOptions: HTTPCallOptions? = nil, - responseType: Response.Type = Response.self - ) -> HTTPUnaryCall< - Request, - Response - > where Request: SwiftProtobuf.Message, Response: SwiftProtobuf.Message - { - HTTPUnaryCall( - path: path, - options: callOptions, - requestPayload: request, - responseType: responseType) - } -} diff --git a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClientCall.swift b/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClientCall.swift deleted file mode 100644 index 6a8e54c1..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPClientCall.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// - -import Foundation -import SwiftProtobuf - -public protocol HTTPClientCall { - /// The type of the request message for the call. - associatedtype RequestPayload: SwiftProtobuf.Message - - /// The type of the response message for the call. - associatedtype ResponsePayload: SwiftProtobuf.Message - - /// The resource path (generated) - var path: String { get } - - /// The http method to use for the call - var method: HTTPMethod { get } - - var requestPayload: RequestPayload? { get set } - - /// The response message returned from the service if the call is successful. This may be failed - /// if the call encounters an error. - /// - /// Callers should rely on the `status` of the call for the canonical outcome. - var responseType: ResponsePayload.Type { get set } - - /// The options used to make the session. - var options: HTTPCallOptions? { get } - - /// Response metadata. - var metadata: HTTPURLResponse? { get } - - /// Status of this call. - /// - var status: HTTPStatus? { get } -} diff --git a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPMethod.swift b/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPMethod.swift deleted file mode 100644 index 9d83e23e..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPMethod.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// - -import Foundation - -public enum HTTPMethod: String { - case GET - case POST - case PUT - case HEAD - case PATCH - case DELETE -} diff --git a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPResponse.swift b/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPResponse.swift deleted file mode 100644 index 690158c4..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPResponse.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// - -import Foundation - -public struct HTTPResponse { - let statusCode: Int - let url: URL? - let allHeaderFields: [AnyHashable: Any] - let responseData: Data? - - public init( - statusCode: Int, - url: URL?, - allHeaderFields: [AnyHashable: Any], - responseData: Data? - ) { - self.statusCode = statusCode - self.url = url - self.allHeaderFields = allHeaderFields - self.responseData = responseData - } -} - -extension HTTPResponse { - public init(httpUrlResponse: HTTPURLResponse, responseData: Data?) { - self.statusCode = httpUrlResponse.statusCode - self.url = httpUrlResponse.url - self.allHeaderFields = httpUrlResponse.allHeaderFields - self.responseData = responseData - } -} diff --git a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPStatus.swift b/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPStatus.swift deleted file mode 100644 index d9938e84..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPStatus.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// - -import Foundation - -/// Encapsulates the result of a HTTP call. -public struct HTTPStatus { - - /// The REST status code - public var code: Int - - /// The status message - public var message: String? - - /// Whether the status is '.ok'. - public var isOk: Bool { - (200...299).contains(code) - } - - /// The default status to return for succeeded calls. - /// - /// - Important: This should *not* be used when checking whether a returned status has an 'ok' - /// status code. Use `HTTPStatus.isOk` or check the code directly. - public static let ok: HTTPStatus = .init(code: 200, message: "Success") - - /// "Internal server error" status. - public static let processingError: HTTPStatus = .init(code: 500, message: "Error") -} - -extension HTTPStatus: CustomStringConvertible { - public var description: String { - codeDescription + (["", message].compactMap({ $0 }).joined(separator: " ")) - } - - private var codeDescription: String { - switch code { - case 200: - return "Success: " - case 400: - return "Invalid Arguments: " - case 403: - return "Unauthorized: " - case 404: - return "Not Found: " - case 500: - return "Error: " - case 501: - return "Unimplemented: " - case 503: - return "Unavailable: " - default: - return "Unknown Error: " - } - } -} diff --git a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPUnaryCall.swift b/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPUnaryCall.swift deleted file mode 100644 index 514ab89f..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HTTPInterface/HTTPUnaryCall.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// - -import Foundation -import SwiftProtobuf - -/// A unary http call. The request is sent on initialization. -/// -/// Note: while this object is a `struct`, its implementation delegates to `Call`. It therefore -/// has reference semantics. -public struct HTTPUnaryCall< - RequestPayload: SwiftProtobuf.Message, - ResponsePayload: SwiftProtobuf.Message ->: HTTPClientCall { - public var path: String - - public var method: HTTPMethod = .POST - - public var response: ResponsePayload? - - /// The options used in the URLSession - public var options: HTTPCallOptions? - - /// The initial metadata returned from the server. - public var metadata: HTTPURLResponse? - - /// The request message sent to the server - public var requestPayload: RequestPayload? - - /// The response returned by the server. - public var responseType: ResponsePayload.Type - public var responsePayload: ResponsePayload? - - /// The final status of the the RPC. - public var status: HTTPStatus? -} diff --git a/Sources/Network/HTTPS/HttpConnection/HttpCallable/HttpCallable.swift b/Sources/Network/HTTPS/HttpConnection/HttpCallable/HttpCallable.swift index f663dde6..c60c692d 100644 --- a/Sources/Network/HTTPS/HttpConnection/HttpCallable/HttpCallable.swift +++ b/Sources/Network/HTTPS/HttpConnection/HttpCallable/HttpCallable.swift @@ -3,6 +3,7 @@ // import Foundation +import LibMobileCoin public protocol HttpCallable { associatedtype Request diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnection.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnection.swift index 19221e39..bdfdbbe4 100644 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnection.swift +++ b/Sources/Network/HTTPS/HttpConnection/HttpConnection.swift @@ -3,6 +3,7 @@ // import Foundation +import LibMobileCoin class HttpConnection: ConnectionProtocol { private let inner: SerialDispatchLock diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/ConsensusHttpConnection.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/ConsensusHttpConnection.swift index 2a28f132..a41bda8f 100644 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/ConsensusHttpConnection.swift +++ b/Sources/Network/HTTPS/HttpConnection/HttpConnections/ConsensusHttpConnection.swift @@ -62,4 +62,4 @@ extension ConsensusHttpConnection { } extension ConsensusHttpConnection: ConsensusServiceConnection {} -extension Attest_AttestedApiRestClient: AuthHttpCallee, HTTPClient {} +extension Attest_AttestedApiRestClient: AuthHttpCallee {} diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogKeyImageHttpConnection.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogKeyImageHttpConnection.swift index e1f901bb..5e522822 100644 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogKeyImageHttpConnection.swift +++ b/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogKeyImageHttpConnection.swift @@ -60,4 +60,4 @@ extension FogKeyImageHttpConnection { } extension FogKeyImageHttpConnection: FogKeyImageServiceConnection {} -extension FogLedger_FogKeyImageAPIRestClient: AuthHttpCallee, CheckKeyImagesCallee, HTTPClient {} +extension FogLedger_FogKeyImageAPIRestClient: AuthHttpCallee, CheckKeyImagesCallee {} diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogViewHttpConnection.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogViewHttpConnection.swift index fb45f784..0c535837 100644 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogViewHttpConnection.swift +++ b/Sources/Network/HTTPS/HttpConnection/HttpConnections/FogViewHttpConnection.swift @@ -63,4 +63,4 @@ extension FogViewHttpConnection { } extension FogViewHttpConnection: FogViewServiceConnection {} -extension FogView_FogViewAPIRestClient: AuthHttpCallee, QueryHttpCallee, HTTPClient {} +extension FogView_FogViewAPIRestClient: AuthHttpCallee, QueryHttpCallee {} diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/attest.http.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/attest.http.swift deleted file mode 100644 index 5ae8bc7d..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/attest.http.swift +++ /dev/null @@ -1,90 +0,0 @@ -// -// DO NOT EDIT. -// -// Generated by the protocol buffer compiler. -// Source: attest.proto -// -// swiftlint:disable all - -// -// Copyright 2018, gRPC Authors All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import SwiftProtobuf -import LibMobileCoin - - -//// A server-authenticated service for SGX enclaves. The responder is the -//// attesting enclave, and the client is unauthenticated. When described -//// within the noise protocol, this is similar to the "IX" style key exchange: -//// -//// ```txt -//// IX: -//// -> e, s -//// <- e, ee, se, s, es -//// -> -//// <- -//// ``` -//// -//// The first two messages are contained within the Auth and AuthResponse -/// -/// Usage: instantiate `Attest_AttestedApiRestClient`, then call methods of this protocol to make API calls. -public protocol Attest_AttestedApiRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension Attest_AttestedApiRestClientProtocol { - public var serviceName: String { - return "attest.AttestedApi" - } - - //// This API call is made when one enclave wants to start a mutually- - //// authenticated key-exchange session with an enclave. - /// - /// - Parameters: - /// - request: Request to send to Auth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/attest.AttestedApi/Auth", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class Attest_AttestedApiRestClient: Attest_AttestedApiRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the attest.AttestedApi service. - /// - /// - Parameters: - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_client.http.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_client.http.swift deleted file mode 100644 index 2a178216..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_client.http.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// -// swiftlint:disable all - -import Foundation -import SwiftProtobuf -import LibMobileCoin - -///// Usage: instantiate `ConsensusClient_ConsensusClientAPIRestClient`, then call methods of this protocol to make APIRest calls. -public protocol ConsensusClient_ConsensusClientAPIRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func clientTxPropose( - _ request: Attest_Message, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension ConsensusClient_ConsensusClientAPIRestClientProtocol { - public var serviceName: String { - return "consensus_client.ConsensusClientAPI" - } - - //// This APIRest call is made with an encrypted payload for the enclave, - //// indicating a new value to be acted upon. - /// - /// - Parameters: - /// - request: Request to send to ClientTxPropose. - /// - callOptions: Call options. - /// - Returns: A `HTTPUnaryCall` with futures for the metadata, status and response. - public func clientTxPropose( - _ request: Attest_Message, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/consensus_client.ConsensusClientAPI/ClientTxPropose", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class ConsensusClient_ConsensusClientAPIRestClient: ConsensusClient_ConsensusClientAPIRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the consensus_client.ConsensusClientAPIRest service. - /// - /// - Parameters: - /// - channel: `HTTPChannel` to the service host. - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_common.http.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_common.http.swift deleted file mode 100644 index a6409333..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/consensus_common.http.swift +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright (c) 2020-2021 MobileCoin. All rights reserved. -// -// swiftlint:disable all - -import Foundation -import SwiftProtobuf -import LibMobileCoin - - -//// Blockchain APIRest shared between clients and peers. -/// -/// Usage: instantiate `ConsensusCommon_BlockchainAPIRestClient`, then call methods of this protocol to make APIRest calls. -public protocol ConsensusCommon_BlockchainAPIRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func getLastBlockInfo( - _ request: SwiftProtobuf.Google_Protobuf_Empty, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall - - func getBlocks( - _ request: ConsensusCommon_BlocksRequest, - callOptions: HTTPCallOptions? - ) ->HTTPUnaryCall -} - -extension ConsensusCommon_BlockchainAPIRestClientProtocol { - public var serviceName: String { - return "consensus_common.BlockchainAPI" - } - - /// Unary call to GetLastBlockInfo - /// - /// - Parameters: - /// - request: Request to send to GetLastBlockInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getLastBlockInfo( - _ request: SwiftProtobuf.Google_Protobuf_Empty, - callOptions: HTTPCallOptions? = nil - ) ->HTTPUnaryCall { - return self.makeUnaryCall( - path: "/consensus_common.BlockchainAPI/GetLastBlockInfo", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } - - /// Unary call to GetBlocks - /// - /// - Parameters: - /// - request: Request to send to GetBlocks. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getBlocks( - _ request: ConsensusCommon_BlocksRequest, - callOptions: HTTPCallOptions? = nil - ) ->HTTPUnaryCall { - return self.makeUnaryCall( - path: "/consensus_common.BlockchainAPI/GetBlocks", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class ConsensusCommon_BlockchainAPIRestClient: ConsensusCommon_BlockchainAPIRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the consensus_common.BlockchainAPIRest service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/ledger.http.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/ledger.http.swift deleted file mode 100644 index 609458ba..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/ledger.http.swift +++ /dev/null @@ -1,276 +0,0 @@ -// -// DO NOT EDIT. -// -// Generated by the protocol buffer compiler. -// Source: ledger.proto -// -// swiftlint:disable all - -// -// Copyright 2018, gRPC Authors All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -import SwiftProtobuf -import LibMobileCoin - - -/// Usage: instantiate `FogLedger_FogMerkleProofAPIRestClient`, then call methods of this protocol to make API calls. -public protocol FogLedger_FogMerkleProofAPIRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall - - func getOutputs( - _ request: Attest_Message, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension FogLedger_FogMerkleProofAPIRestClientProtocol { - public var serviceName: String { - return "fog_ledger.FogMerkleProofAPI" - } - - //// This is called to perform mc-noise IX key exchange with the enclave, - //// before calling GetOutputs. - /// - /// - Parameters: - /// - request: Request to send to Auth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_ledger.FogMerkleProofAPI/Auth", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } - - //// Get TxOut's and merkle proofs of membership for these outputs - //// These requests can be the user's "real" outputs from fog view, in order - //// to get the needed merkle proof, or their mixins for RingCT. - /// - /// - Parameters: - /// - request: Request to send to GetOutputs. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getOutputs( - _ request: Attest_Message, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_ledger.FogMerkleProofAPI/GetOutputs", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class FogLedger_FogMerkleProofAPIRestClient: FogLedger_FogMerkleProofAPIRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the fog_ledger.FogMerkleProofAPI service. - /// - /// - Parameters: - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - -/// Usage: instantiate `FogLedger_FogKeyImageAPIRestClient`, then call methods of this protocol to make API calls. -public protocol FogLedger_FogKeyImageAPIRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall - - func checkKeyImages( - _ request: Attest_Message, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension FogLedger_FogKeyImageAPIRestClientProtocol { - public var serviceName: String { - return "fog_ledger.FogKeyImageAPI" - } - - //// This is called to perform IX key exchange with the enclave before calling GetOutputs. - /// - /// - Parameters: - /// - request: Request to send to Auth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_ledger.FogKeyImageAPI/Auth", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } - - //// Check if key images have appeared in the ledger, and if so, when - /// - /// - Parameters: - /// - request: Request to send to CheckKeyImages. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func checkKeyImages( - _ request: Attest_Message, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_ledger.FogKeyImageAPI/CheckKeyImages", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class FogLedger_FogKeyImageAPIRestClient: FogLedger_FogKeyImageAPIRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the fog_ledger.FogKeyImageAPI service. - /// - /// - Parameters: - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - -/// Usage: instantiate `FogLedger_FogBlockAPIRestClient`, then call methods of this protocol to make API calls. -public protocol FogLedger_FogBlockAPIRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func getBlocks( - _ request: FogLedger_BlockRequest, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension FogLedger_FogBlockAPIRestClientProtocol { - public var serviceName: String { - return "fog_ledger.FogBlockAPI" - } - - //// Request for all of the TxOuts for a particular range of blocks. - //// This is meant to help the users recover from "missed blocks" i.e. - //// data loss in the fog service. - /// - /// - Parameters: - /// - request: Request to send to GetBlocks. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getBlocks( - _ request: FogLedger_BlockRequest, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_ledger.FogBlockAPI/GetBlocks", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class FogLedger_FogBlockAPIRestClient: FogLedger_FogBlockAPIRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the fog_ledger.FogBlockAPI service. - /// - /// - Parameters: - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - -/// Usage: instantiate `FogLedger_FogUntrustedTxOutApiRestClient`, then call methods of this protocol to make API calls. -public protocol FogLedger_FogUntrustedTxOutApiRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func getTxOuts( - _ request: FogLedger_TxOutRequest, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension FogLedger_FogUntrustedTxOutApiRestClientProtocol { - public var serviceName: String { - return "fog_ledger.FogUntrustedTxOutApi" - } - - //// This can be used by a sender who may be sharing their private keys across - //// multiple parties / devices, to confirm that a transaction that they sent - //// landed in the blockchain, by confirming that one of the random keys from - //// a TxOut that they produced appears in the ledger. - //// - //// Given the TxOut.pubkey value, we return if it is found, and the num_blocks - //// value, allowing Alice to determine that her transactions succeeded, or if - //// num_blocks exceeded her tombstone value, conclude that it failed somehow. - //// We also return the global tx out index. We don't currently return the block - //// index or time stamp in which the TxOut appeared. - //// - //// This API is NOT attested and Bob, the recipient, SHOULD NOT use it in connection - //// to the same TxOut, as that will leak the transaction graph to fog operator, - //// which breaks the privacy statement for fog as a whole. - /// - /// - Parameters: - /// - request: Request to send to GetTxOuts. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getTxOuts( - _ request: FogLedger_TxOutRequest, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_ledger.FogUntrustedTxOutApi/GetTxOuts", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class FogLedger_FogUntrustedTxOutApiRestClient: FogLedger_FogUntrustedTxOutApiRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the fog_ledger.FogUntrustedTxOutApi service. - /// - /// - Parameters: - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/report.http.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/report.http.swift deleted file mode 100644 index e0a64533..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/report.http.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// DO NOT EDIT. -// -// Generated by the protocol buffer compiler. -// Source: report.proto -// -// swiftlint:disable all - -// -// Copyright 2018, gRPC Authors All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import SwiftProtobuf -import LibMobileCoin - - -//// The public API for getting reports -/// -/// Usage: instantiate `Report_ReportAPIRestClient`, then call methods of this protocol to make API calls. -public protocol Report_ReportAPIRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func getReports( - _ request: Report_ReportRequest, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension Report_ReportAPIRestClientProtocol { - public var serviceName: String { - return "report.ReportAPI" - } - - //// Get all available pubkeys, with Intel SGX reports, fog urls, and expiry info - /// - /// - Parameters: - /// - request: Request to send to GetReports. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getReports( - _ request: Report_ReportRequest, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/report.ReportAPI/GetReports", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class Report_ReportAPIRestClient: Report_ReportAPIRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the report.ReportAPI service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - diff --git a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/view.http.swift b/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/view.http.swift deleted file mode 100644 index 2d52aed7..00000000 --- a/Sources/Network/HTTPS/HttpConnection/HttpConnections/HttpProtoGenerated/view.http.swift +++ /dev/null @@ -1,96 +0,0 @@ -// -// DO NOT EDIT. -// -// Generated by the protocol buffer compiler. -// Source: view.proto -// -// swiftlint:disable all - -// -// Copyright 2018, gRPC Authors All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -import SwiftProtobuf -import LibMobileCoin - - -/// Usage: instantiate `FogView_FogViewAPIRestClient`, then call methods of this protocol to make API calls. -public protocol FogView_FogViewAPIRestClientProtocol: HTTPClient { - var serviceName: String { get } - - func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall - - func query( - _ request: Attest_Message, - callOptions: HTTPCallOptions? - ) -> HTTPUnaryCall -} - -extension FogView_FogViewAPIRestClientProtocol { - public var serviceName: String { - return "fog_view.FogViewAPI" - } - - //// This is called to perform IX key exchange with the enclave before calling GetOutputs. - /// - /// - Parameters: - /// - request: Request to send to Auth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func auth( - _ request: Attest_AuthMessage, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_view.FogViewAPI/Auth", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } - - //// Input should be an encrypted QueryRequest, result is an encrypted QueryResponse - /// - /// - Parameters: - /// - request: Request to send to Query. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func query( - _ request: Attest_Message, - callOptions: HTTPCallOptions? = nil - ) -> HTTPUnaryCall { - return self.makeUnaryCall( - path: "/fog_view.FogViewAPI/Query", - request: request, - callOptions: callOptions ?? self.defaultHTTPCallOptions - ) - } -} - -public final class FogView_FogViewAPIRestClient: FogView_FogViewAPIRestClientProtocol { - public var defaultHTTPCallOptions: HTTPCallOptions - - /// Creates a client for the fog_view.FogViewAPI service. - /// - /// - Parameters: - /// - defaultHTTPCallOptions: Options to use for each service call if the user doesn't provide them. - public init( - defaultHTTPCallOptions: HTTPCallOptions = HTTPCallOptions() - ) { - self.defaultHTTPCallOptions = defaultHTTPCallOptions - } -} - diff --git a/Sources/Network/HTTPS/RestApiRequester.swift b/Sources/Network/HTTPS/RestApiRequester.swift index 36a856d6..c18dd628 100644 --- a/Sources/Network/HTTPS/RestApiRequester.swift +++ b/Sources/Network/HTTPS/RestApiRequester.swift @@ -3,6 +3,7 @@ // import Foundation +import LibMobileCoin public class RestApiRequester { let requester: HttpRequester diff --git a/Sources/Network/HTTPS/Utils/HttpCallResult.swift b/Sources/Network/HTTPS/Utils/HttpCallResult.swift index c41988ca..9797f2eb 100644 --- a/Sources/Network/HTTPS/Utils/HttpCallResult.swift +++ b/Sources/Network/HTTPS/Utils/HttpCallResult.swift @@ -3,6 +3,7 @@ // import Foundation +import LibMobileCoin public struct HttpCallResult { let error: Error? diff --git a/Sources/Network/HttpRequester.swift b/Sources/Network/HttpRequester.swift index cf15aa2c..000d405a 100644 --- a/Sources/Network/HttpRequester.swift +++ b/Sources/Network/HttpRequester.swift @@ -6,6 +6,7 @@ import Foundation import SwiftProtobuf +import LibMobileCoin public protocol HttpRequester { func request( diff --git a/Tests/Mocks/MockFailingHttpRequester.swift b/Tests/Mocks/MockFailingHttpRequester.swift index abba61e3..7d80bdc9 100644 --- a/Tests/Mocks/MockFailingHttpRequester.swift +++ b/Tests/Mocks/MockFailingHttpRequester.swift @@ -1,6 +1,7 @@ // // Copyright (c) 2020-2023 MobileCoin. All rights reserved. // +import LibMobileCoin @testable import MobileCoin import XCTest diff --git a/Vendor/libmobilecoin-ios-artifacts b/Vendor/libmobilecoin-ios-artifacts index 2475c374..1b96ea55 160000 --- a/Vendor/libmobilecoin-ios-artifacts +++ b/Vendor/libmobilecoin-ios-artifacts @@ -1 +1 @@ -Subproject commit 2475c37425af1de90e47f1700f3f8a5fd68979c1 +Subproject commit 1b96ea555f4971ac20aa21691f17071486a6e00c