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
79e8e4ac
Commit
79e8e4ac
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add regCode parameter to ClientCreator
parent
bf349a01
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Bindings API wrapper
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ElixxirDAppsSDK/ClientCreator.swift
+11
-6
11 additions, 6 deletions
Sources/ElixxirDAppsSDK/ClientCreator.swift
with
11 additions
and
6 deletions
Sources/ElixxirDAppsSDK/ClientCreator.swift
+
11
−
6
View file @
79e8e4ac
import
Bindings
import
Bindings
public
struct
ClientCreator
{
public
struct
ClientCreator
{
public
var
create
:
(
URL
,
Data
,
Data
)
throws
->
Void
public
var
create
:
(
URL
,
Data
,
Data
,
String
?
)
throws
->
Void
public
func
callAsFunction
(
directoryURL
:
URL
,
ndf
:
Data
,
password
:
Data
)
throws
{
public
func
callAsFunction
(
try
create
(
directoryURL
,
ndf
,
password
)
directoryURL
:
URL
,
ndf
:
Data
,
password
:
Data
,
regCode
:
String
?
=
nil
)
throws
{
try
create
(
directoryURL
,
ndf
,
password
,
regCode
)
}
}
}
}
extension
ClientCreator
{
extension
ClientCreator
{
public
static
let
live
=
ClientCreator
{
directoryURL
,
ndf
,
password
in
public
static
let
live
=
ClientCreator
{
directoryURL
,
ndf
,
password
,
regCode
in
var
error
:
NSError
?
var
error
:
NSError
?
let
network
=
String
(
data
:
ndf
,
encoding
:
.
utf8
)
!
let
network
=
String
(
data
:
ndf
,
encoding
:
.
utf8
)
!
let
created
=
BindingsNewClient
(
network
,
directoryURL
.
path
,
password
,
nil
,
&
error
)
let
created
=
BindingsNewClient
(
network
,
directoryURL
.
path
,
password
,
regCode
,
&
error
)
if
let
error
=
error
{
if
let
error
=
error
{
throw
error
throw
error
}
}
...
@@ -24,7 +29,7 @@ extension ClientCreator {
...
@@ -24,7 +29,7 @@ extension ClientCreator {
#if DEBUG
#if DEBUG
extension
ClientCreator
{
extension
ClientCreator
{
public
static
let
failing
=
ClientCreator
{
_
,
_
,
_
in
public
static
let
failing
=
ClientCreator
{
_
,
_
,
_
,
_
in
struct
NotImplemented
:
Error
{}
struct
NotImplemented
:
Error
{}
throw
NotImplemented
()
throw
NotImplemented
()
}
}
...
...
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