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

Commit

Permalink
set default in init (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirahsapong authored Mar 26, 2024
1 parent cdd6355 commit c3f62e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/tbDEX/Protocol/Models/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public struct Message<D: MessageData>: Codable, Equatable {
exchangeID: String,
data: D,
externalID: String? = nil,
`protocol`: String? = nil
`protocol`: String = "1.0"
) {
let now = Date()
self.metadata = MessageMetadata(
Expand All @@ -38,7 +38,7 @@ public struct Message<D: MessageData>: Codable, Equatable {
exchangeID: exchangeID,
createdAt: now,
externalID: externalID,
protocol: `protocol` ?? "1.0"
protocol: `protocol`
)
self.data = data
self.signature = nil
Expand Down
4 changes: 2 additions & 2 deletions Sources/tbDEX/Protocol/Models/Messages/RFQ.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension RFQ {
from: String,
data: RFQData,
externalID: String? = nil,
`protocol`: String? = nil
`protocol`: String = "1.0"
) {
let id = TypeID(prefix: data.kind().rawValue)!
self.metadata = MessageMetadata(
Expand All @@ -23,7 +23,7 @@ extension RFQ {
exchangeID: id.rawValue,
createdAt: Date(),
externalID: externalID,
protocol: `protocol` ?? "1.0"
protocol: `protocol`
)
self.data = data
self.private = nil
Expand Down

0 comments on commit c3f62e4

Please sign in to comment.