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
e05b4269
Commit
e05b4269
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add ConnectionGetPartner functor
parent
f8547499
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!102
Release 1.0.0
,
!18
Update Bindings
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ElixxirDAppsSDK/Connection.swift
+7
-3
7 additions, 3 deletions
Sources/ElixxirDAppsSDK/Connection.swift
Sources/ElixxirDAppsSDK/ConnectionGetPartner.swift
+36
-0
36 additions, 0 deletions
Sources/ElixxirDAppsSDK/ConnectionGetPartner.swift
with
43 additions
and
3 deletions
Sources/ElixxirDAppsSDK/Connection.swift
+
7
−
3
View file @
e05b4269
...
...
@@ -2,24 +2,28 @@ import Bindings
public
struct
Connection
{
public
var
getId
:
ConnectionGetId
public
var
getPartner
:
ConnectionGetPartner
}
extension
Connection
{
public
static
func
live
(
_
bindingsConnection
:
BindingsConnection
)
->
Connection
{
Connection
(
getId
:
.
live
(
bindingsConnection
)
getId
:
.
live
(
bindingsConnection
),
getPartner
:
.
live
(
bindingsConnection
)
)
}
public
static
func
live
(
_
bindingsConnection
:
BindingsAuthenticatedConnection
)
->
Connection
{
Connection
(
getId
:
.
live
(
bindingsConnection
)
getId
:
.
live
(
bindingsConnection
),
getPartner
:
.
live
(
bindingsConnection
)
)
}
}
extension
Connection
{
public
static
let
unimplemented
=
Connection
(
getId
:
.
unimplemented
getId
:
.
unimplemented
,
getPartner
:
.
unimplemented
)
}
This diff is collapsed.
Click to expand it.
Sources/ElixxirDAppsSDK/
Legacy/
ConnectionPartner
Provider
.swift
→
Sources/ElixxirDAppsSDK/Connection
Get
Partner.swift
+
36
−
0
View file @
e05b4269
import
Bindings
import
XCTestDynamicOverlay
public
struct
ConnectionPartner
Provider
{
public
var
get
:
()
->
Data
public
struct
Connection
Get
Partner
{
public
var
run
:
()
->
Data
public
func
callAsFunction
()
->
Data
{
get
()
run
()
}
}
extension
ConnectionPartnerProvider
{
public
static
func
live
(
bindingsConnection
:
BindingsConnection
)
->
ConnectionPartnerProvider
{
ConnectionPartnerProvider
{
extension
ConnectionGetPartner
{
public
static
func
live
(
_
bindingsConnection
:
BindingsConnection
)
->
ConnectionGetPartner
{
ConnectionGetPartner
{
guard
let
data
=
bindingsConnection
.
getPartner
()
else
{
fatalError
(
"BindingsConnection.getPartner returned `nil`"
)
}
...
...
@@ -20,11 +19,9 @@ extension ConnectionPartnerProvider {
}
}
public
static
func
live
(
bindingsAuthenticatedConnection
:
BindingsAuthenticatedConnection
)
->
ConnectionPartnerProvider
{
ConnectionPartnerProvider
{
guard
let
data
=
bindingsAuthenticatedConnection
.
getPartner
()
else
{
public
static
func
live
(
_
bindingsConnection
:
BindingsAuthenticatedConnection
)
->
ConnectionGetPartner
{
ConnectionGetPartner
{
guard
let
data
=
bindingsConnection
.
getPartner
()
else
{
fatalError
(
"BindingsAuthenticatedConnection.getPartner returned `nil`"
)
}
return
data
...
...
@@ -32,10 +29,8 @@ extension ConnectionPartnerProvider {
}
}
#if DEBUG
extension
ConnectionPartnerProvider
{
public
static
let
failing
=
ConnectionPartnerProvider
{
fatalError
(
"Not implemented"
)
}
extension
ConnectionGetPartner
{
public
static
let
unimplemented
=
ConnectionGetPartner
(
run
:
XCTUnimplemented
(
"
\(
Self
.
self
)
"
)
)
}
#endif
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