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
7c279cf1
Commit
7c279cf1
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add Connection.getPartner method
parent
109d4211
No related branches found
No related tags found
1 merge request
!2
Bindings API wrapper
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ElixxirDAppsSDK/Connection.swift
+14
-0
14 additions, 0 deletions
Sources/ElixxirDAppsSDK/Connection.swift
with
14 additions
and
0 deletions
Sources/ElixxirDAppsSDK/Connection.swift
+
14
−
0
View file @
7c279cf1
...
...
@@ -2,6 +2,7 @@ import Bindings
public
struct
Connection
{
public
var
isAuthenticated
:
()
->
Bool
public
var
getPartner
:
()
->
Data
public
var
send
:
MessageSender
public
var
listen
:
MessageListener
}
...
...
@@ -12,6 +13,12 @@ extension Connection {
)
->
Connection
{
Connection
(
isAuthenticated
:
{
false
},
getPartner
:
{
guard
let
data
=
bindingsConnection
.
getPartner
()
else
{
fatalError
(
"BindingsConnection.getPartner returned `nil`"
)
}
return
data
},
send
:
.
live
(
bindingsConnection
:
bindingsConnection
),
listen
:
.
live
(
bindingsConnection
:
bindingsConnection
)
)
...
...
@@ -22,6 +29,12 @@ extension Connection {
)
->
Connection
{
Connection
(
isAuthenticated
:
bindingsAuthenticatedConnection
.
isAuthenticated
,
getPartner
:
{
guard
let
data
=
bindingsAuthenticatedConnection
.
getPartner
()
else
{
fatalError
(
"BindingsAuthenticatedConnection.getPartner returned `nil`"
)
}
return
data
},
send
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
),
listen
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
)
)
...
...
@@ -32,6 +45,7 @@ extension Connection {
extension
Connection
{
public
static
let
failing
=
Connection
(
isAuthenticated
:
{
fatalError
(
"Not implemented"
)
},
getPartner
:
{
fatalError
(
"Not implemented"
)
},
send
:
.
failing
,
listen
:
.
failing
)
...
...
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