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
6d175767
Commit
6d175767
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Unify code formatting
parent
f9c29dc3
No related branches found
No related tags found
2 merge requests
!13
Update Bindings
,
!8
Clean up latest merge
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ElixxirDAppsSDK/MessageSendReport.swift
+32
-32
32 additions, 32 deletions
Sources/ElixxirDAppsSDK/MessageSendReport.swift
Sources/ElixxirDAppsSDK/RestlikeMessage.swift
+40
-40
40 additions, 40 deletions
Sources/ElixxirDAppsSDK/RestlikeMessage.swift
with
72 additions
and
72 deletions
Sources/ElixxirDAppsSDK/MessageSendReport.swift
+
32
−
32
View file @
6d175767
import
Foundation
import
Foundation
public
struct
MessageSendReport
:
Equatable
{
public
struct
MessageSendReport
:
Equatable
{
public
init
(
public
init
(
roundList
:
[
Int
],
roundList
:
[
Int
],
messageId
:
Data
,
messageId
:
Data
,
timestamp
:
Int
timestamp
:
Int
)
{
)
{
self
.
roundList
=
roundList
self
.
roundList
=
roundList
self
.
messageId
=
messageId
self
.
messageId
=
messageId
self
.
timestamp
=
timestamp
self
.
timestamp
=
timestamp
}
}
public
var
roundList
:
[
Int
]?
public
var
roundList
:
[
Int
]?
public
var
messageId
:
Data
?
public
var
messageId
:
Data
?
public
var
timestamp
:
Int
?
public
var
timestamp
:
Int
?
}
}
extension
MessageSendReport
:
Codable
{
extension
MessageSendReport
:
Codable
{
enum
CodingKeys
:
String
,
CodingKey
{
enum
CodingKeys
:
String
,
CodingKey
{
case
roundList
=
"Rounds"
case
roundList
=
"Rounds"
case
messageId
=
"MessageID"
case
messageId
=
"MessageID"
case
timestamp
=
"Timestamp"
case
timestamp
=
"Timestamp"
}
}
public
init
(
from
decoder
:
Decoder
)
throws
{
public
init
(
from
decoder
:
Decoder
)
throws
{
let
container
=
try
decoder
.
container
(
keyedBy
:
CodingKeys
.
self
)
let
container
=
try
decoder
.
container
(
keyedBy
:
CodingKeys
.
self
)
messageId
=
try
container
.
decodeIfPresent
(
Data
.
self
,
forKey
:
.
messageId
)
messageId
=
try
container
.
decodeIfPresent
(
Data
.
self
,
forKey
:
.
messageId
)
timestamp
=
try
container
.
decodeIfPresent
(
Int
.
self
,
forKey
:
.
timestamp
)
timestamp
=
try
container
.
decodeIfPresent
(
Int
.
self
,
forKey
:
.
timestamp
)
roundList
=
try
container
.
decodeIfPresent
([
Int
]
.
self
,
forKey
:
.
roundList
)
roundList
=
try
container
.
decodeIfPresent
([
Int
]
.
self
,
forKey
:
.
roundList
)
}
}
public
func
encode
(
to
encoder
:
Encoder
)
throws
{
public
func
encode
(
to
encoder
:
Encoder
)
throws
{
var
container
=
encoder
.
container
(
keyedBy
:
CodingKeys
.
self
)
var
container
=
encoder
.
container
(
keyedBy
:
CodingKeys
.
self
)
try
container
.
encode
(
messageId
,
forKey
:
.
messageId
)
try
container
.
encode
(
messageId
,
forKey
:
.
messageId
)
try
container
.
encode
(
timestamp
,
forKey
:
.
timestamp
)
try
container
.
encode
(
timestamp
,
forKey
:
.
timestamp
)
try
container
.
encode
(
roundList
,
forKey
:
.
roundList
)
try
container
.
encode
(
roundList
,
forKey
:
.
roundList
)
}
}
}
}
This diff is collapsed.
Click to expand it.
Sources/ElixxirDAppsSDK/RestlikeMessage.swift
+
40
−
40
View file @
6d175767
import
Foundation
import
Foundation
public
struct
RestlikeMessage
:
Equatable
{
public
struct
RestlikeMessage
:
Equatable
{
public
init
(
public
init
(
version
:
Int
,
version
:
Int
,
headers
:
Data
,
headers
:
Data
,
content
:
Data
,
content
:
Data
,
method
:
Int
,
method
:
Int
,
uri
:
String
,
uri
:
String
,
error
:
String
error
:
String
)
{
)
{
self
.
version
=
version
self
.
version
=
version
self
.
headers
=
headers
self
.
headers
=
headers
self
.
content
=
content
self
.
content
=
content
self
.
method
=
method
self
.
method
=
method
self
.
uri
=
uri
self
.
uri
=
uri
self
.
error
=
error
self
.
error
=
error
}
}
public
var
version
:
Int
?
public
var
version
:
Int
?
public
var
headers
:
Data
?
public
var
headers
:
Data
?
public
var
content
:
Data
?
public
var
content
:
Data
?
public
var
method
:
Int
?
public
var
method
:
Int
?
public
var
uri
:
String
?
public
var
uri
:
String
?
public
var
error
:
String
?
public
var
error
:
String
?
}
}
extension
RestlikeMessage
:
Codable
{
extension
RestlikeMessage
:
Codable
{
enum
CodingKeys
:
String
,
CodingKey
{
enum
CodingKeys
:
String
,
CodingKey
{
case
version
=
"Version"
case
version
=
"Version"
case
headers
=
"Headers"
case
headers
=
"Headers"
case
content
=
"Content"
case
content
=
"Content"
case
method
=
"Method"
case
method
=
"Method"
case
uri
=
"URI"
case
uri
=
"URI"
case
error
=
"Error"
case
error
=
"Error"
}
}
public
init
(
from
decoder
:
Decoder
)
throws
{
public
init
(
from
decoder
:
Decoder
)
throws
{
let
container
=
try
decoder
.
container
(
keyedBy
:
CodingKeys
.
self
)
let
container
=
try
decoder
.
container
(
keyedBy
:
CodingKeys
.
self
)
version
=
try
container
.
decodeIfPresent
(
Int
.
self
,
forKey
:
.
version
)
version
=
try
container
.
decodeIfPresent
(
Int
.
self
,
forKey
:
.
version
)
headers
=
try
container
.
decodeIfPresent
(
Data
.
self
,
forKey
:
.
headers
)
headers
=
try
container
.
decodeIfPresent
(
Data
.
self
,
forKey
:
.
headers
)
content
=
try
container
.
decodeIfPresent
(
Data
.
self
,
forKey
:
.
content
)
content
=
try
container
.
decodeIfPresent
(
Data
.
self
,
forKey
:
.
content
)
method
=
try
container
.
decodeIfPresent
(
Int
.
self
,
forKey
:
.
method
)
method
=
try
container
.
decodeIfPresent
(
Int
.
self
,
forKey
:
.
method
)
uri
=
try
container
.
decodeIfPresent
(
String
.
self
,
forKey
:
.
uri
)
uri
=
try
container
.
decodeIfPresent
(
String
.
self
,
forKey
:
.
uri
)
error
=
try
container
.
decodeIfPresent
(
String
.
self
,
forKey
:
.
error
)
error
=
try
container
.
decodeIfPresent
(
String
.
self
,
forKey
:
.
error
)
}
}
}
}
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