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
c6042614
Commit
c6042614
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Update ConnectionMaker to accept Identity model
parent
fd86cea6
No related branches found
No related tags found
1 merge request
!12
Use codable models in API
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ElixxirDAppsSDK/ConnectionMaker.swift
+6
-4
6 additions, 4 deletions
Sources/ElixxirDAppsSDK/ConnectionMaker.swift
with
6 additions
and
4 deletions
Sources/ElixxirDAppsSDK/ConnectionMaker.swift
+
6
−
4
View file @
c6042614
import
Bindings
public
struct
ConnectionMaker
{
public
var
connect
:
(
Bool
,
Data
,
Data
)
throws
->
Connection
public
var
connect
:
(
Bool
,
Data
,
Identity
)
throws
->
Connection
public
func
callAsFunction
(
withAuthentication
:
Bool
,
recipientContact
:
Data
,
myIdentity
:
Data
myIdentity
:
Identity
)
throws
->
Connection
{
try
connect
(
withAuthentication
,
recipientContact
,
myIdentity
)
}
...
...
@@ -15,18 +15,20 @@ public struct ConnectionMaker {
extension
ConnectionMaker
{
public
static
func
live
(
bindingsClient
:
BindingsClient
)
->
ConnectionMaker
{
ConnectionMaker
{
withAuthentication
,
recipientContact
,
myIdentity
in
let
encoder
=
JSONEncoder
()
let
myIdentityData
=
try
encoder
.
encode
(
myIdentity
)
if
withAuthentication
{
return
Connection
.
live
(
bindingsAuthenticatedConnection
:
try
bindingsClient
.
connect
(
withAuthentication
:
recipientContact
,
myIdentity
:
myIdentity
myIdentity
:
myIdentity
Data
)
)
}
else
{
return
Connection
.
live
(
bindingsConnection
:
try
bindingsClient
.
connect
(
recipientContact
,
myIdentity
:
myIdentity
myIdentity
:
myIdentity
Data
)
)
}
...
...
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