forked from hyperledger/anoncreds-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: AnonCred Wrapper lining issue on Android and CredentialRequestMe…
…tadata->get_link_secret_name was being return with double quotation Signed-off-by: Ahmed Moussa <[email protected]>
- Loading branch information
Showing
7 changed files
with
222 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/anoncred/wrapper/Tests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package anoncred.wrapper | ||
|
||
import anoncreds_wrapper.LinkSecret | ||
import anoncreds_wrapper.PresentationRequest | ||
import kotlin.test.Test | ||
import kotlin.test.assertTrue | ||
|
||
class Tests { | ||
|
||
@Test | ||
fun test() { | ||
val presentationJSON = """ | ||
{ | ||
"requested_attributes":{ | ||
"attribute_1":{ | ||
"name":"name", | ||
"restrictions":[ | ||
] | ||
} | ||
}, | ||
"requested_predicates":{ | ||
}, | ||
"name":"presentation_request_1", | ||
"nonce":"1177620373658433495312997", | ||
"version":"0.1" | ||
} | ||
""" | ||
val presentationRequest = PresentationRequest(presentationJSON) | ||
|
||
val requestedAttributes = presentationRequest.getRequestedAttributes() | ||
val key = requestedAttributes.keys.first() | ||
val requestedAttribute = requestedAttributes.get(key)!! | ||
val requestedAttributeJSON = requestedAttribute.getJson() | ||
|
||
println(requestedAttributeJSON) | ||
|
||
val secret = LinkSecret() | ||
assertTrue(secret != null) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters