Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
add optional readonly close success field (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirahsapong authored Mar 26, 2024
1 parent c3f62e4 commit 7436c32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/tbDEX/Protocol/Models/Messages/Close.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public struct CloseData: MessageData {
/// An explanation of why the exchange is being closed/completed
public let reason: String?

/// Indicates whether or not the exchange successfully completed
public private(set) var success: Bool?

/// Returns the MessageKind of close
public func kind() -> MessageKind {
return .close
Expand Down
1 change: 1 addition & 0 deletions Tests/tbDEXTests/Protocol/Models/Messages/CloseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class CloseTests: XCTestCase {
XCTAssertEqual(close.metadata.exchangeID, "exchange_123")
XCTAssertEqual(close.data.reason, "test reason")
XCTAssertEqual(close.metadata.protocol, "1.0")
XCTAssertEqual(close.data.success, nil)
}

func test_overrideProtocolVersion() {
Expand Down

0 comments on commit 7436c32

Please sign in to comment.