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
GitLab 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
Sep 8, 2022
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Update SingleUseResponseReport model
parent
187f8502
No related branches found
No related tags found
2 merge requests
!102
Release 1.0.0
,
!78
Update Bindings
Changes
2
Show 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
...
@@ -3,12 +3,14 @@ import Foundation
public
struct
SingleUseResponseReport
:
Equatable
{
public
struct
SingleUseResponseReport
:
Equatable
{
public
init
(
public
init
(
rounds
:
[
Int
],
rounds
:
[
Int
],
roundURL
:
String
,
payload
:
Data
,
payload
:
Data
,
ephId
:
Int64
,
ephId
:
Int64
,
receptionId
:
Data
,
receptionId
:
Data
,
error
:
String
?
error
:
String
?
)
{
)
{
self
.
rounds
=
rounds
self
.
rounds
=
rounds
self
.
roundURL
=
roundURL
self
.
payload
=
payload
self
.
payload
=
payload
self
.
ephId
=
ephId
self
.
ephId
=
ephId
self
.
receptionId
=
receptionId
self
.
receptionId
=
receptionId
...
@@ -16,6 +18,7 @@ public struct SingleUseResponseReport: Equatable {
...
@@ -16,6 +18,7 @@ public struct SingleUseResponseReport: Equatable {
}
}
public
var
rounds
:
[
Int
]
public
var
rounds
:
[
Int
]
public
var
roundURL
:
String
public
var
payload
:
Data
public
var
payload
:
Data
public
var
ephId
:
Int64
public
var
ephId
:
Int64
public
var
receptionId
:
Data
public
var
receptionId
:
Data
...
@@ -25,6 +28,7 @@ public struct SingleUseResponseReport: Equatable {
...
@@ -25,6 +28,7 @@ public struct SingleUseResponseReport: Equatable {
extension
SingleUseResponseReport
:
Codable
{
extension
SingleUseResponseReport
:
Codable
{
enum
CodingKeys
:
String
,
CodingKey
{
enum
CodingKeys
:
String
,
CodingKey
{
case
rounds
=
"Rounds"
case
rounds
=
"Rounds"
case
roundURL
=
"RoundURL"
case
payload
=
"Payload"
case
payload
=
"Payload"
case
ephId
=
"EphID"
case
ephId
=
"EphID"
case
receptionId
=
"ReceptionID"
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
...
@@ -5,12 +5,14 @@ import XCTest
final
class
SingleUseResponseReportTests
:
XCTestCase
{
final
class
SingleUseResponseReportTests
:
XCTestCase
{
func
testCoding
()
throws
{
func
testCoding
()
throws
{
let
rounds
:
[
Int
]
=
[
1
,
5
,
9
]
let
rounds
:
[
Int
]
=
[
1
,
5
,
9
]
let
roundURL
=
"https://dashboard.xx.network/rounds/25?xxmessenger=true"
let
payloadB64
=
"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw=="
let
payloadB64
=
"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw=="
let
ephId
:
Int64
=
1_655_533
let
ephId
:
Int64
=
1_655_533
let
receptionIdB64
=
"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"
let
receptionIdB64
=
"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"
let
jsonString
=
"""
let
jsonString
=
"""
{
{
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
RoundURL
": "
\(
roundURL
)
",
"
Payload
": "
\(
payloadB64
)
",
"
Payload
": "
\(
payloadB64
)
",
"
EphID
":
\(
ephId
)
,
"
EphID
":
\(
ephId
)
,
"
ReceptionID
": "
\(
receptionIdB64
)
",
"
ReceptionID
": "
\(
receptionIdB64
)
",
...
@@ -22,6 +24,7 @@ final class SingleUseResponseReportTests: XCTestCase {
...
@@ -22,6 +24,7 @@ final class SingleUseResponseReportTests: XCTestCase {
XCTAssertNoDifference
(
model
,
SingleUseResponseReport
(
XCTAssertNoDifference
(
model
,
SingleUseResponseReport
(
rounds
:
rounds
,
rounds
:
rounds
,
roundURL
:
roundURL
,
payload
:
Data
(
base64Encoded
:
payloadB64
)
!
,
payload
:
Data
(
base64Encoded
:
payloadB64
)
!
,
ephId
:
ephId
,
ephId
:
ephId
,
receptionId
:
Data
(
base64Encoded
:
receptionIdB64
)
!
,
receptionId
:
Data
(
base64Encoded
:
receptionIdB64
)
!
,
...
@@ -36,6 +39,7 @@ final class SingleUseResponseReportTests: XCTestCase {
...
@@ -36,6 +39,7 @@ final class SingleUseResponseReportTests: XCTestCase {
func
testDecodingReportWithError
()
throws
{
func
testDecodingReportWithError
()
throws
{
let
rounds
:
[
Int
]
=
[
1
,
5
,
9
]
let
rounds
:
[
Int
]
=
[
1
,
5
,
9
]
let
roundURL
=
"https://dashboard.xx.network/rounds/25?xxmessenger=true"
let
payloadB64
=
"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw=="
let
payloadB64
=
"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw=="
let
ephId
:
Int64
=
1_655_533
let
ephId
:
Int64
=
1_655_533
let
receptionIdB64
=
"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"
let
receptionIdB64
=
"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"
...
@@ -43,6 +47,7 @@ final class SingleUseResponseReportTests: XCTestCase {
...
@@ -43,6 +47,7 @@ final class SingleUseResponseReportTests: XCTestCase {
let
jsonString
=
"""
let
jsonString
=
"""
{
{
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
Rounds
": [
\(
rounds
.
map
{
"
\(
$0
)
"
}
.
joined
(
separator
:
", "
)
)
],
"
RoundURL
": "
\(
roundURL
)
",
"
Payload
": "
\(
payloadB64
)
",
"
Payload
": "
\(
payloadB64
)
",
"
EphID
":
\(
ephId
)
,
"
EphID
":
\(
ephId
)
,
"
ReceptionID
": "
\(
receptionIdB64
)
",
"
ReceptionID
": "
\(
receptionIdB64
)
",
...
@@ -54,6 +59,7 @@ final class SingleUseResponseReportTests: XCTestCase {
...
@@ -54,6 +59,7 @@ final class SingleUseResponseReportTests: XCTestCase {
XCTAssertNoDifference
(
model
,
SingleUseResponseReport
(
XCTAssertNoDifference
(
model
,
SingleUseResponseReport
(
rounds
:
rounds
,
rounds
:
rounds
,
roundURL
:
roundURL
,
payload
:
Data
(
base64Encoded
:
payloadB64
)
!
,
payload
:
Data
(
base64Encoded
:
payloadB64
)
!
,
ephId
:
ephId
,
ephId
:
ephId
,
receptionId
:
Data
(
base64Encoded
:
receptionIdB64
)
!
,
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