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
c13c63a9
Commit
c13c63a9
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Update GroupSendReport model
parent
1444ea9a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!102
Release 1.0.0
,
!78
Update Bindings
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/XXClient/Models/GroupSendReport.swift
+8
-4
8 additions, 4 deletions
Sources/XXClient/Models/GroupSendReport.swift
Tests/XXClientTests/Models/GroupSendReportTests.swift
+8
-5
8 additions, 5 deletions
Tests/XXClientTests/Models/GroupSendReportTests.swift
with
16 additions
and
9 deletions
Sources/XXClient/Models/GroupSendReport.swift
+
8
−
4
View file @
c13c63a9
...
...
@@ -2,23 +2,27 @@ import Foundation
public
struct
GroupSendReport
:
Equatable
{
public
init
(
roundId
:
UInt64
,
rounds
:
[
Int
],
roundURL
:
String
,
timestamp
:
Int64
,
messageId
:
Data
)
{
self
.
roundId
=
roundId
self
.
rounds
=
rounds
self
.
roundURL
=
roundURL
self
.
timestamp
=
timestamp
self
.
messageId
=
messageId
}
public
var
roundId
:
UInt64
public
var
rounds
:
[
Int
]
public
var
roundURL
:
String
public
var
timestamp
:
Int64
public
var
messageId
:
Data
}
extension
GroupSendReport
:
Codable
{
enum
CodingKeys
:
String
,
CodingKey
{
case
roundId
=
"RoundID"
case
rounds
=
"Rounds"
case
roundURL
=
"RoundURL"
case
timestamp
=
"Timestamp"
case
messageId
=
"MessageID"
}
...
...
This diff is collapsed.
Click to expand it.
Tests/XXClientTests/Models/GroupSendReportTests.swift
+
8
−
5
View file @
c13c63a9
...
...
@@ -4,12 +4,14 @@ import XCTest
final
class
GroupSendReportTests
:
XCTestCase
{
func
testCoding
()
throws
{
let
roundId
:
UInt64
=
123
let
timestamp
:
Int64
=
321
let
messageIdB64
=
"EB/70R5HYEw5htZ4Hg9ondrn3+cAc/lH2G0mjQMja3w="
let
rounds
:
[
Int
]
=
[
25
,
64
]
let
roundURL
=
"https://dashboard.xx.network/rounds/25?xxmessenger=true"
let
timestamp
:
Int64
=
1_662_577_352_813_112_000
let
messageIdB64
=
"69ug6FA50UT2q6MWH3hne9PkHQ+H9DnEDsBhc0m0Aww="
let
jsonString
=
"""
{
"
RoundID
":
\(
roundId
)
,
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
RoundURL
": "
\(
roundURL
)
",
"
Timestamp
":
\(
timestamp
)
,
"
MessageID
": "
\(
messageIdB64
)
"
}
...
...
@@ -18,7 +20,8 @@ final class GroupSendReportTests: XCTestCase {
let
model
=
try
GroupSendReport
.
decode
(
jsonData
)
XCTAssertNoDifference
(
model
,
GroupSendReport
(
roundId
:
roundId
,
rounds
:
rounds
,
roundURL
:
roundURL
,
timestamp
:
timestamp
,
messageId
:
Data
(
base64Encoded
:
messageIdB64
)
!
))
...
...
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