Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
irmago
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
IRMA
Github mirrors
irmago
Commits
18747054
Commit
18747054
authored
Nov 15, 2019
by
Sietse Ringers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: rename helper function
parent
b6b19997
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
irmaclient/irmaclient_test.go
irmaclient/irmaclient_test.go
+4
-4
No files found.
irmaclient/irmaclient_test.go
View file @
18747054
...
...
@@ -40,7 +40,7 @@ func parseStorage(t *testing.T) *Client {
return
client
}
func
testhelper
(
t
*
testing
.
T
)
(
*
Client
,
*
irma
.
DisclosureRequest
,
*
irma
.
Disclosure
)
{
func
parseDisclosure
(
t
*
testing
.
T
)
(
*
Client
,
*
irma
.
DisclosureRequest
,
*
irma
.
Disclosure
)
{
client
:=
parseStorage
(
t
)
requestJson
:=
`{"@context":"https://irma.app/ld/request/disclosure/v2","context":"AQ==","nonce":"M3LYmTr3CZDYZkMNK2uCCg==","protocolVersion":"2.5","disclose":[[["irma-demo.RU.studentCard.studentID"]]],"labels":{"0":null}}`
...
...
@@ -55,7 +55,7 @@ func testhelper(t *testing.T) (*Client, *irma.DisclosureRequest, *irma.Disclosur
func
TestVerify
(
t
*
testing
.
T
)
{
t
.
Run
(
"valid"
,
func
(
t
*
testing
.
T
)
{
client
,
request
,
disclosure
:=
testhelper
(
t
)
client
,
request
,
disclosure
:=
parseDisclosure
(
t
)
attr
,
status
,
err
:=
disclosure
.
Verify
(
client
.
Configuration
,
request
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
irma
.
ProofStatusValid
,
status
)
...
...
@@ -63,7 +63,7 @@ func TestVerify(t *testing.T) {
})
t
.
Run
(
"invalid"
,
func
(
t
*
testing
.
T
)
{
client
,
request
,
disclosure
:=
testhelper
(
t
)
client
,
request
,
disclosure
:=
parseDisclosure
(
t
)
disclosure
.
Proofs
[
0
]
.
(
*
gabi
.
ProofD
)
.
AResponses
[
0
]
=
big
.
NewInt
(
100
)
_
,
status
,
err
:=
disclosure
.
Verify
(
client
.
Configuration
,
request
)
require
.
NoError
(
t
,
err
)
...
...
@@ -71,7 +71,7 @@ func TestVerify(t *testing.T) {
})
t
.
Run
(
"wrong attribute"
,
func
(
t
*
testing
.
T
)
{
client
,
request
,
disclosure
:=
testhelper
(
t
)
client
,
request
,
disclosure
:=
parseDisclosure
(
t
)
request
.
Disclose
[
0
][
0
][
0
]
.
Type
=
irma
.
NewAttributeTypeIdentifier
(
"irma-demo.MijnOverheid.root.BSN"
)
_
,
status
,
err
:=
disclosure
.
Verify
(
client
.
Configuration
,
request
)
require
.
NoError
(
t
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment