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
245bf8b6
Commit
245bf8b6
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add NDFDownloader
parent
5ac8999d
No related branches found
No related tags found
1 merge request
!1
Client management
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ElixxirDAppsSDK/Errors.swift
+3
-0
3 additions, 0 deletions
Sources/ElixxirDAppsSDK/Errors.swift
Sources/ElixxirDAppsSDK/NDFDownloader.swift
+36
-0
36 additions, 0 deletions
Sources/ElixxirDAppsSDK/NDFDownloader.swift
with
39 additions
and
0 deletions
Sources/ElixxirDAppsSDK/Errors.swift
0 → 100644
+
3
−
0
View file @
245bf8b6
public
struct
BindingsDownloadAndVerifySignedNdfWithUrlUnknownError
:
Error
,
Equatable
{
public
init
()
{}
}
This diff is collapsed.
Click to expand it.
Sources/ElixxirDAppsSDK/NDFDownloader.swift
0 → 100644
+
36
−
0
View file @
245bf8b6
import
Bindings
public
struct
NDFDownloader
{
public
var
run
:
(
Environment
)
throws
->
Data
public
func
callAsFunction
(
_
env
:
Environment
)
throws
->
Data
{
try
run
(
env
)
}
}
extension
NDFDownloader
{
public
static
let
live
=
NDFDownloader
{
env
in
var
error
:
NSError
?
let
data
=
BindingsDownloadAndVerifySignedNdfWithUrl
(
env
.
url
.
absoluteString
,
env
.
cert
,
&
error
)
if
let
error
=
error
{
throw
error
}
guard
let
data
=
data
else
{
throw
BindingsDownloadAndVerifySignedNdfWithUrlUnknownError
()
}
return
data
}
}
#if DEBUG
extension
NDFDownloader
{
public
static
let
failing
=
NDFDownloader
{
_
in
struct
NotImplemented
:
Error
{}
throw
NotImplemented
()
}
}
#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