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
ef518c4a
Commit
ef518c4a
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add GenerateSecret functor
parent
4838dfdd
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ElixxirDAppsSDK/GenerateSecret.swift
+8
-9
8 additions, 9 deletions
Sources/ElixxirDAppsSDK/GenerateSecret.swift
with
8 additions
and
9 deletions
Sources/ElixxirDAppsSDK/
Legacy/PasswordGenerator
.swift
→
Sources/ElixxirDAppsSDK/
GenerateSecret
.swift
+
8
−
9
View file @
ef518c4a
import
Bindings
import
XCTestDynamicOverlay
public
struct
PasswordGenerator
{
public
struct
GenerateSecret
{
public
var
run
:
(
Int
)
->
Data
public
func
callAsFunction
(
numBytes
:
Int
=
32
)
->
Data
{
...
...
@@ -8,8 +9,8 @@ public struct PasswordGenerator {
}
}
extension
PasswordGenerator
{
public
static
let
live
=
PasswordGenerator
{
numBytes
in
extension
GenerateSecret
{
public
static
let
live
=
GenerateSecret
{
numBytes
in
guard
let
secret
=
BindingsGenerateSecret
(
numBytes
)
else
{
fatalError
(
"BindingsGenerateSecret returned `nil`"
)
}
...
...
@@ -17,10 +18,8 @@ extension PasswordGenerator {
}
}
#if DEBUG
extension
PasswordGenerator
{
public
static
let
failing
=
PasswordGenerator
{
_
in
fatalError
(
"Not implemented"
)
}
extension
GenerateSecret
{
public
static
let
unimplemented
=
GenerateSecret
(
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