Skip to content

Commit

Permalink
build: remove prism naming
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
hamada147 committed Nov 28, 2023
1 parent 6c1288b commit 7e3f147
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 127 deletions.
2 changes: 1 addition & 1 deletion anoncred-kmm/anoncreds-kmp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ publishing {
android {
ndkVersion = "26.0.10792818"
compileSdk = 33
namespace = "io.iohk.atala.prism.anoncredskmp"
namespace = "anoncredskmp"
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

sourceSets["main"].jniLibs {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="io.iohk.atala.prism.anoncredskmp" />
<manifest package="anoncredskmp" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package anoncred.wrapper

import org.junit.Ignore

/**
* Ignore Unit tests on Android Platform
*/
actual typealias AndroidIgnore = Ignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.iohk.atala.prism.anoncred
package anoncred.wrapper

enum class Platform {
Linux,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package anoncred.wrapper

/**
* Ignore Unit tests on Android Platform
*/
expect annotation class AndroidIgnore()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.iohk.atala.prism.anoncred
package anoncred.wrapper

import anoncreds_wrapper.AttributeValues
import anoncreds_wrapper.CredentialDefinitionConfig
Expand All @@ -13,9 +13,9 @@ import kotlin.test.assertEquals
import kotlin.test.assertTrue

@AndroidIgnore
class PrismIssuerTests {
class IssuerTests {
@Test
fun test_PrismIssuer_createSchema() {
fun test_Issuer_createSchema() {
val expectedSchema = Schema("Moussa", "1.0", listOf("name", "age"), "sample:uri")
val scheme: Schema = Issuer().createSchema("Moussa", "1.0", "sample:uri", listOf("name", "age"))
assertEquals(expectedSchema, scheme, "scheme not equal")
Expand All @@ -29,11 +29,11 @@ class PrismIssuerTests {
}

@Test
fun test_PrismIssuer_createCredentialDefinition() {
val prismIssuer = Issuer()
fun test_Issuer_createCredentialDefinition() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema: Schema = prismIssuer.createSchema("Moussa", "1.0", "sample:uri", attributeNames)
val cred = prismIssuer.createCredentialDefinition(
val schema: Schema = issuer.createSchema("Moussa", "1.0", "sample:uri", attributeNames)
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
Expand All @@ -48,19 +48,19 @@ class PrismIssuerTests {
}

@Test
fun test_PrismIssuer_createRevocationRegistryDef() {
val prismIssuer = Issuer()
fun test_Issuer_createRevocationRegistryDef() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema = Schema("Moussa", "1.0", attributeNames, "sample:uri")
val cred = prismIssuer.createCredentialDefinition(
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
"default-tag",
SignatureType.CL,
CredentialDefinitionConfig(true)
)
val rev = prismIssuer.createRevocationRegistryDef(
val rev = issuer.createRevocationRegistryDef(
cred.credentialDefinition,
"did:web:xyz/resource/cred-def",
"did:web:xyz",
Expand All @@ -75,27 +75,27 @@ class PrismIssuerTests {
}

@Test
fun test_PrismIssuer_createRevocationStatusList() {
val prismIssuer = Issuer()
fun test_Issuer_createRevocationStatusList() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema = Schema("Moussa", "1.0", attributeNames, "sample:uri")
val cred = prismIssuer.createCredentialDefinition(
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
"default-tag",
SignatureType.CL,
CredentialDefinitionConfig(true)
)
val rev = prismIssuer.createRevocationRegistryDef(
val rev = issuer.createRevocationRegistryDef(
cred.credentialDefinition,
"did:web:xyz/resource/cred-def",
"did:web:xyz",
"default-tag",
RegistryType.CL_ACCUM,
1000u
)
val revStatusList = prismIssuer.createRevocationStatusList(
val revStatusList = issuer.createRevocationStatusList(
"did:web:xyz/resource/rev-reg-def",
rev.regDef,
"did:web:xyz",
Expand All @@ -107,110 +107,110 @@ class PrismIssuerTests {
}

@Test
fun test_PrismIssuer_updateRevocationStatusListTimestampOnly() {
val prismIssuer = Issuer()
fun test_Issuer_updateRevocationStatusListTimestampOnly() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema = Schema("Moussa", "1.0", attributeNames, "sample:uri")
val cred = prismIssuer.createCredentialDefinition(
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
"default-tag",
SignatureType.CL,
CredentialDefinitionConfig(true)
)
val rev = prismIssuer.createRevocationRegistryDef(
val rev = issuer.createRevocationRegistryDef(
cred.credentialDefinition,
"did:web:xyz/resource/cred-def",
"did:web:xyz",
"default-tag",
RegistryType.CL_ACCUM,
1000u
)
val revStatusList = prismIssuer.createRevocationStatusList(
val revStatusList = issuer.createRevocationStatusList(
"did:web:xyz/resource/rev-reg-def",
rev.regDef,
"did:web:xyz",
null,
true
)
val updatedRevStatusList = prismIssuer.updateRevocationStatusListTimestampOnly(1000u, revStatusList)
val updatedRevStatusList = issuer.updateRevocationStatusListTimestampOnly(1000u, revStatusList)
println(updatedRevStatusList.getJson())
assertTrue(true)
}

@Test
fun test_PrismIssuer_updateRevocationStatusList() {
val prismIssuer = Issuer()
fun test_Issuer_updateRevocationStatusList() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema = Schema("Moussa", "1.0", attributeNames, "sample:uri")
val cred = prismIssuer.createCredentialDefinition(
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
"default-tag",
SignatureType.CL,
CredentialDefinitionConfig(true)
)
val rev = prismIssuer.createRevocationRegistryDef(
val rev = issuer.createRevocationRegistryDef(
cred.credentialDefinition,
"did:web:xyz/resource/cred-def",
"did:web:xyz",
"default-tag",
RegistryType.CL_ACCUM,
1000u
)
val revStatusList = prismIssuer.createRevocationStatusList(
val revStatusList = issuer.createRevocationStatusList(
"did:web:xyz/resource/rev-reg-def",
rev.regDef,
"did:web:xyz",
null,
true
)
val updatedRevStatusList = prismIssuer.updateRevocationStatusList(null, listOf(1u), null, rev.regDef, revStatusList)
val updatedRevStatusList = issuer.updateRevocationStatusList(null, listOf(1u), null, rev.regDef, revStatusList)
println(updatedRevStatusList.getJson())
assertTrue(true)
Nonce().toString()
Nonce()
}

@Test
fun test_PrismIssuer_createCredentialOffer() {
val prismIssuer = Issuer()
fun test_Issuer_createCredentialOffer() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema = Schema("Moussa", "1.0", attributeNames, "sample:uri")
val cred = prismIssuer.createCredentialDefinition(
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
"default-tag",
SignatureType.CL,
CredentialDefinitionConfig(true)
)
val credentialOffer = prismIssuer.createCredentialOffer("did:web:xyz/resource/schema", "did:web:xyz/resource/cred-def", cred.credentialKeyCorrectnessProof)
val credentialOffer = issuer.createCredentialOffer("did:web:xyz/resource/schema", "did:web:xyz/resource/cred-def", cred.credentialKeyCorrectnessProof)
println(credentialOffer.getJson())
assertTrue(true)
}

@Test
fun test_PrismIssuer_createCredential() {
val prismIssuer = Issuer()
fun test_Issuer_createCredential() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema = Schema("Moussa", "1.0", attributeNames, "sample:uri")
val cred = prismIssuer.createCredentialDefinition(
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
"default-tag",
SignatureType.CL,
CredentialDefinitionConfig(true)
)
val credentialOffer = prismIssuer.createCredentialOffer("did:web:xyz/resource/schema", "did:web:xyz/resource/cred-def", cred.credentialKeyCorrectnessProof)
val prismProver = Prover()
val linkSecret = prismProver.createLinkSecret()
val credentialRequest = prismProver.createCredentialRequest("entropy", null, cred.credentialDefinition, linkSecret, "my-secret-id", credentialOffer)
val credentialOffer = issuer.createCredentialOffer("did:web:xyz/resource/schema", "did:web:xyz/resource/cred-def", cred.credentialKeyCorrectnessProof)
val Prover = Prover()
val linkSecret = Prover.createLinkSecret()
val credentialRequest = Prover.createCredentialRequest("entropy", null, cred.credentialDefinition, linkSecret, "my-secret-id", credentialOffer)
val credentialValues = listOf(AttributeValues("name", "Moussa"))
val credential = prismIssuer.createCredential(
val credential = issuer.createCredential(
cred.credentialDefinition,
cred.credentialDefinitionPrivate,
credentialOffer,
Expand All @@ -223,4 +223,4 @@ class PrismIssuerTests {
println(credential.getJson())
assertTrue(true)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.iohk.atala.prism.anoncred
package anoncred.wrapper

import anoncreds_wrapper.CredentialDefinitionConfig
import anoncreds_wrapper.Issuer
Expand All @@ -9,38 +9,38 @@ import kotlin.test.Test
import kotlin.test.assertTrue

@AndroidIgnore
class PrismProverTests {
class ProverTests {
@Test
fun test_PrismProver_createLinkSecret() {
val prismProver = Prover()
val linkSecret = prismProver.createLinkSecret()
fun test_Prover_createLinkSecret() {
val prover = Prover()
val linkSecret = prover.createLinkSecret()
println(linkSecret.getBigNumber())
println(linkSecret.getValue())
assertTrue(linkSecret.getBigNumber().length > 0)
}

@Test
fun test_PrismProver_createCredentialRequest() {
val prismIssuer = Issuer()
fun test_Prover_createCredentialRequest() {
val issuer = Issuer()
val attributeNames = listOf("name", "age")
val schema = Schema("Moussa", "1.0", attributeNames, "sample:uri")
val cred = prismIssuer.createCredentialDefinition(
val cred = issuer.createCredentialDefinition(
"did:web:xyz/resource/schema",
schema,
"did:web:xyz",
"default-tag",
SignatureType.CL,
CredentialDefinitionConfig(true)
)
val credentialOffer = prismIssuer.createCredentialOffer(
val credentialOffer = issuer.createCredentialOffer(
"did:web:xyz/resource/schema",
"did:web:xyz/resource/cred-def",
cred.credentialKeyCorrectnessProof
)

val prismProver = Prover()
val linkSecret = prismProver.createLinkSecret()
val credentialRequest = prismProver.createCredentialRequest(
val prover = Prover()
val linkSecret = prover.createLinkSecret()
val credentialRequest = prover.createCredentialRequest(
"entropy",
null,
cred.credentialDefinition,
Expand All @@ -51,4 +51,4 @@ class PrismProverTests {
println(credentialRequest)
assertTrue(true)
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package anoncred.wrapper

/**
* Ignore Unit tests on Android Platform
*/
actual annotation class AndroidIgnore

This file was deleted.

Loading

0 comments on commit 7e3f147

Please sign in to comment.