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
8df6ce7c
Commit
8df6ce7c
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Update E2ESendReport model
parent
cb6ba277
No related branches found
No related tags found
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/E2ESendReport.swift
+8
-4
8 additions, 4 deletions
Sources/XXClient/Models/E2ESendReport.swift
Tests/XXClientTests/Models/E2ESendReportTests.swift
+6
-2
6 additions, 2 deletions
Tests/XXClientTests/Models/E2ESendReportTests.swift
with
14 additions
and
6 deletions
Sources/XXClient/Models/E2ESendReport.swift
+
8
−
4
View file @
8df6ce7c
...
@@ -2,18 +2,21 @@ import Foundation
...
@@ -2,18 +2,21 @@ import Foundation
public
struct
E2ESendReport
:
Equatable
{
public
struct
E2ESendReport
:
Equatable
{
public
init
(
public
init
(
roundList
:
[
Int
]?,
rounds
:
[
Int
]?,
roundURL
:
String
?,
messageId
:
Data
?,
messageId
:
Data
?,
timestamp
:
Int
?,
timestamp
:
Int
?,
keyResidue
:
Data
?
keyResidue
:
Data
?
)
{
)
{
self
.
roundList
=
roundList
self
.
rounds
=
rounds
self
.
roundURL
=
roundURL
self
.
messageId
=
messageId
self
.
messageId
=
messageId
self
.
timestamp
=
timestamp
self
.
timestamp
=
timestamp
self
.
keyResidue
=
keyResidue
self
.
keyResidue
=
keyResidue
}
}
public
var
roundList
:
[
Int
]?
public
var
rounds
:
[
Int
]?
public
var
roundURL
:
String
?
public
var
messageId
:
Data
?
public
var
messageId
:
Data
?
public
var
timestamp
:
Int
?
public
var
timestamp
:
Int
?
public
var
keyResidue
:
Data
?
public
var
keyResidue
:
Data
?
...
@@ -21,7 +24,8 @@ public struct E2ESendReport: Equatable {
...
@@ -21,7 +24,8 @@ public struct E2ESendReport: Equatable {
extension
E2ESendReport
:
Codable
{
extension
E2ESendReport
:
Codable
{
enum
CodingKeys
:
String
,
CodingKey
{
enum
CodingKeys
:
String
,
CodingKey
{
case
roundList
=
"Rounds"
case
rounds
=
"Rounds"
case
roundURL
=
"RoundURL"
case
messageId
=
"MessageID"
case
messageId
=
"MessageID"
case
timestamp
=
"Timestamp"
case
timestamp
=
"Timestamp"
case
keyResidue
=
"KeyResidue"
case
keyResidue
=
"KeyResidue"
...
...
This diff is collapsed.
Click to expand it.
Tests/XXClientTests/Models/E2ESendReportTests.swift
+
6
−
2
View file @
8df6ce7c
...
@@ -5,12 +5,14 @@ import XCTest
...
@@ -5,12 +5,14 @@ import XCTest
final
class
E2ESendReportTests
:
XCTestCase
{
final
class
E2ESendReportTests
:
XCTestCase
{
func
testCoding
()
throws
{
func
testCoding
()
throws
{
let
rounds
=
[
1
,
5
,
9
]
let
rounds
=
[
1
,
5
,
9
]
let
roundURL
=
"https://dashboard.xx.network/rounds/25?xxmessenger=true"
let
messageIdB64
=
"iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs="
let
messageIdB64
=
"iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs="
let
timestamp
:
Int
=
1_661_532_254_302_612_000
let
timestamp
:
Int
=
1_661_532_254_302_612_000
let
keyResidueB64
=
"9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE="
let
keyResidueB64
=
"9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE="
let
jsonString
=
"""
let
jsonString
=
"""
{
{
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
RoundURL
": "
\(
roundURL
)
",
"
MessageID
": "
\(
messageIdB64
)
",
"
MessageID
": "
\(
messageIdB64
)
",
"
Timestamp
":
\(
timestamp
)
,
"
Timestamp
":
\(
timestamp
)
,
"
KeyResidue
": "
\(
keyResidueB64
)
"
"
KeyResidue
": "
\(
keyResidueB64
)
"
...
@@ -20,7 +22,8 @@ final class E2ESendReportTests: XCTestCase {
...
@@ -20,7 +22,8 @@ final class E2ESendReportTests: XCTestCase {
let
model
=
try
E2ESendReport
.
decode
(
jsonData
)
let
model
=
try
E2ESendReport
.
decode
(
jsonData
)
XCTAssertNoDifference
(
model
,
E2ESendReport
(
XCTAssertNoDifference
(
model
,
E2ESendReport
(
roundList
:
rounds
,
rounds
:
rounds
,
roundURL
:
roundURL
,
messageId
:
Data
(
base64Encoded
:
messageIdB64
)
!
,
messageId
:
Data
(
base64Encoded
:
messageIdB64
)
!
,
timestamp
:
timestamp
,
timestamp
:
timestamp
,
keyResidue
:
Data
(
base64Encoded
:
keyResidueB64
)
keyResidue
:
Data
(
base64Encoded
:
keyResidueB64
)
...
@@ -38,7 +41,8 @@ final class E2ESendReportTests: XCTestCase {
...
@@ -38,7 +41,8 @@ final class E2ESendReportTests: XCTestCase {
let
model
=
try
E2ESendReport
.
decode
(
jsonData
)
let
model
=
try
E2ESendReport
.
decode
(
jsonData
)
XCTAssertNoDifference
(
model
,
E2ESendReport
(
XCTAssertNoDifference
(
model
,
E2ESendReport
(
roundList
:
nil
,
rounds
:
nil
,
roundURL
:
nil
,
messageId
:
nil
,
messageId
:
nil
,
timestamp
:
nil
,
timestamp
:
nil
,
keyResidue
:
nil
keyResidue
:
nil
...
...
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