This repository was archived by the owner on Dec 12, 2024. It is now read-only.
File tree 2 files changed +11
-11
lines changed
Tests/tbDEXTests/HttpClient
2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,15 @@ public enum tbDEXHttpClient {
103
103
try await sendMessage ( message: order, messageEndpoint: " /exchanges/ \( exchangeID) " )
104
104
}
105
105
106
- /// Sends the Close message to the PFI
106
+ /// Sends the Cancel message to the PFI
107
107
/// - Parameters:
108
- /// - order : The Close message that will be sent to the PFI
108
+ /// - cancel : The Cancel message that will be sent to the PFI
109
109
/// - Throws: if message verification fails
110
110
/// - Throws: if recipient DID resolution fails
111
111
/// - Throws: if recipient DID does not have a PFI service entry
112
- public static func submitClose ( close : Close ) async throws {
113
- let exchangeID = close . metadata. exchangeID
114
- try await sendMessage ( message: close , messageEndpoint: " /exchanges/ \( exchangeID) " )
112
+ public static func submitCancel ( cancel : Cancel ) async throws {
113
+ let exchangeID = cancel . metadata. exchangeID
114
+ try await sendMessage ( message: cancel , messageEndpoint: " /exchanges/ \( exchangeID) " )
115
115
}
116
116
117
117
/// Sends a message to a PFI
Original file line number Diff line number Diff line change @@ -277,25 +277,25 @@ final class tbDEXHttpClientTests: XCTestCase {
277
277
}
278
278
}
279
279
280
- func test_submitCloseWhenSuccess ( ) async throws {
281
- var close = DevTools . createClose ( from: did. uri, to: pfiDid)
280
+ func test_submitCancelWhenSuccess ( ) async throws {
281
+ var cancel = DevTools . createCancel ( from: did. uri, to: pfiDid)
282
282
283
- try close . sign ( did: did)
283
+ try cancel . sign ( did: did)
284
284
285
285
Mocker . mode = . optin
286
286
Mock (
287
287
url: URL ( string: " \( endpoint) /exchanges/exchange_123 " ) !,
288
288
contentType: . json,
289
289
statusCode: 200 ,
290
290
data: [
291
- . put: try tbDEXJSONEncoder ( ) . encode ( close )
291
+ . put: try tbDEXJSONEncoder ( ) . encode ( cancel )
292
292
]
293
293
) . register ( )
294
294
295
295
do {
296
- try await tbDEXHttpClient. submitClose ( close : close )
296
+ try await tbDEXHttpClient. submitCancel ( cancel : cancel )
297
297
} catch {
298
- XCTFail ( " Error on submit order : \( error) " )
298
+ XCTFail ( " Error on submit cancel : \( error) " )
299
299
}
300
300
}
301
301
You can’t perform that action at this time.
0 commit comments