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
b84fd402
Commit
b84fd402
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Update SingleUseResponseReport model
parent
187f8502
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/SingleUseResponseReport.swift
+4
-0
4 additions, 0 deletions
Sources/XXClient/Models/SingleUseResponseReport.swift
Tests/XXClientTests/Models/SingleUseResponseReportTests.swift
+6
-0
6 additions, 0 deletions
...s/XXClientTests/Models/SingleUseResponseReportTests.swift
with
10 additions
and
0 deletions
Sources/XXClient/Models/SingleUseResponseReport.swift
+
4
−
0
View file @
b84fd402
...
...
@@ -3,12 +3,14 @@ import Foundation
public
struct
SingleUseResponseReport
:
Equatable
{
public
init
(
rounds
:
[
Int
],
roundURL
:
String
,
payload
:
Data
,
ephId
:
Int64
,
receptionId
:
Data
,
error
:
String
?
)
{
self
.
rounds
=
rounds
self
.
roundURL
=
roundURL
self
.
payload
=
payload
self
.
ephId
=
ephId
self
.
receptionId
=
receptionId
...
...
@@ -16,6 +18,7 @@ public struct SingleUseResponseReport: Equatable {
}
public
var
rounds
:
[
Int
]
public
var
roundURL
:
String
public
var
payload
:
Data
public
var
ephId
:
Int64
public
var
receptionId
:
Data
...
...
@@ -25,6 +28,7 @@ public struct SingleUseResponseReport: Equatable {
extension
SingleUseResponseReport
:
Codable
{
enum
CodingKeys
:
String
,
CodingKey
{
case
rounds
=
"Rounds"
case
roundURL
=
"RoundURL"
case
payload
=
"Payload"
case
ephId
=
"EphID"
case
receptionId
=
"ReceptionID"
...
...
This diff is collapsed.
Click to expand it.
Tests/XXClientTests/Models/SingleUseResponseReportTests.swift
+
6
−
0
View file @
b84fd402
...
...
@@ -5,12 +5,14 @@ import XCTest
final
class
SingleUseResponseReportTests
:
XCTestCase
{
func
testCoding
()
throws
{
let
rounds
:
[
Int
]
=
[
1
,
5
,
9
]
let
roundURL
=
"https://dashboard.xx.network/rounds/25?xxmessenger=true"
let
payloadB64
=
"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw=="
let
ephId
:
Int64
=
1_655_533
let
receptionIdB64
=
"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"
let
jsonString
=
"""
{
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
RoundURL
": "
\(
roundURL
)
",
"
Payload
": "
\(
payloadB64
)
",
"
EphID
":
\(
ephId
)
,
"
ReceptionID
": "
\(
receptionIdB64
)
",
...
...
@@ -22,6 +24,7 @@ final class SingleUseResponseReportTests: XCTestCase {
XCTAssertNoDifference
(
model
,
SingleUseResponseReport
(
rounds
:
rounds
,
roundURL
:
roundURL
,
payload
:
Data
(
base64Encoded
:
payloadB64
)
!
,
ephId
:
ephId
,
receptionId
:
Data
(
base64Encoded
:
receptionIdB64
)
!
,
...
...
@@ -36,6 +39,7 @@ final class SingleUseResponseReportTests: XCTestCase {
func
testDecodingReportWithError
()
throws
{
let
rounds
:
[
Int
]
=
[
1
,
5
,
9
]
let
roundURL
=
"https://dashboard.xx.network/rounds/25?xxmessenger=true"
let
payloadB64
=
"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw=="
let
ephId
:
Int64
=
1_655_533
let
receptionIdB64
=
"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"
...
...
@@ -43,6 +47,7 @@ final class SingleUseResponseReportTests: XCTestCase {
let
jsonString
=
"""
{
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
RoundURL
": "
\(
roundURL
)
",
"
Payload
": "
\(
payloadB64
)
",
"
EphID
":
\(
ephId
)
,
"
ReceptionID
": "
\(
receptionIdB64
)
",
...
...
@@ -54,6 +59,7 @@ final class SingleUseResponseReportTests: XCTestCase {
XCTAssertNoDifference
(
model
,
SingleUseResponseReport
(
rounds
:
rounds
,
roundURL
:
roundURL
,
payload
:
Data
(
base64Encoded
:
payloadB64
)
!
,
ephId
:
ephId
,
receptionId
:
Data
(
base64Encoded
:
receptionIdB64
)
!
,
...
...
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