Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
4c74d5d3
Commit
4c74d5d3
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Update Message model
parent
f24b573c
No related branches found
No related tags found
2 merge requests
!102
Release 1.0.0
,
!79
Update Bindings
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/XXClient/Models/Message.swift
+5
-1
5 additions, 1 deletion
Sources/XXClient/Models/Message.swift
Tests/XXClientTests/Models/MessageTests.swift
+5
-2
5 additions, 2 deletions
Tests/XXClientTests/Models/MessageTests.swift
with
10 additions
and
3 deletions
Sources/XXClient/Models/Message.swift
+
5
−
1
View file @
4c74d5d3
...
...
@@ -10,7 +10,8 @@ public struct Message: Equatable {
ephemeralId
:
Int
,
timestamp
:
Int
,
encrypted
:
Bool
,
roundId
:
Int
roundId
:
Int
,
roundURL
:
String
)
{
self
.
messageType
=
messageType
self
.
id
=
id
...
...
@@ -21,6 +22,7 @@ public struct Message: Equatable {
self
.
timestamp
=
timestamp
self
.
encrypted
=
encrypted
self
.
roundId
=
roundId
self
.
roundURL
=
roundURL
}
public
var
messageType
:
Int
...
...
@@ -32,6 +34,7 @@ public struct Message: Equatable {
public
var
timestamp
:
Int
public
var
encrypted
:
Bool
public
var
roundId
:
Int
public
var
roundURL
:
String
}
extension
Message
:
Codable
{
...
...
@@ -45,6 +48,7 @@ extension Message: Codable {
case
timestamp
=
"Timestamp"
case
encrypted
=
"Encrypted"
case
roundId
=
"RoundId"
case
roundURL
=
"RoundURL"
}
public
static
func
decode
(
_
data
:
Data
)
throws
->
Self
{
...
...
This diff is collapsed.
Click to expand it.
Tests/XXClientTests/Models/MessageTests.swift
+
5
−
2
View file @
4c74d5d3
...
...
@@ -13,6 +13,7 @@ final class MessageTests: XCTestCase {
let
timestamp
:
Int
=
1_653_580_439_357_351_000
let
encrypted
=
false
let
roundId
:
Int
=
19
let
roundURL
=
"https://dashboard.xx.network/rounds/25?xxmessenger=true"
let
jsonString
=
"""
{
"
MessageType
":
\(
type
)
,
...
...
@@ -23,7 +24,8 @@ final class MessageTests: XCTestCase {
"
EphemeralID
":
\(
ephemeralId
)
,
"
Timestamp
":
\(
timestamp
)
,
"
Encrypted
":
\(
encrypted
)
,
"
RoundId
":
\(
roundId
)
"
RoundId
":
\(
roundId
)
,
"
RoundURL
": "
\(
roundURL
)
"
}
"""
let
jsonData
=
jsonString
.
data
(
using
:
.
utf8
)
!
...
...
@@ -38,7 +40,8 @@ final class MessageTests: XCTestCase {
ephemeralId
:
ephemeralId
,
timestamp
:
timestamp
,
encrypted
:
encrypted
,
roundId
:
roundId
roundId
:
roundId
,
roundURL
:
roundURL
))
let
encodedModel
=
try
model
.
encode
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment