From 725e3b7324e0a8806e3442c061b0c7c0d986391c Mon Sep 17 00:00:00 2001 From: Ahmed Moussa Date: Tue, 28 Nov 2023 16:26:42 +0200 Subject: [PATCH] build: remove prism naming Signed-off-by: Ahmed Moussa --- .github/workflows/pull-request.yml | 14 ++-- .../anoncred-wrapper-rust/build.gradle.kts | 15 ---- anoncred-kmm/anoncreds-kmp/build.gradle.kts | 2 +- .../src/androidMain/AndroidManifest.xml | 2 +- .../wrapper}/AndroidIgnore.kt | 2 +- .../anoncred => anoncred/wrapper}/Platform.kt | 2 +- .../wrapper}/AndroidIgnore.kt | 2 +- .../wrapper/IssuerTests.kt} | 80 +++++++++---------- .../wrapper/ProverTests.kt} | 24 +++--- .../wrapper}/AndroidIgnore.kt | 2 +- .../{PrismIssuerTests.kt => IssuerTests.kt} | 78 +++++++++--------- .../{PrismProverTests.kt => ProverTests.kt} | 22 ++--- 12 files changed, 113 insertions(+), 132 deletions(-) rename anoncred-kmm/anoncreds-kmp/src/androidUnitTest/kotlin/{io/iohk/atala/prism/anoncred => anoncred/wrapper}/AndroidIgnore.kt (75%) rename anoncred-kmm/anoncreds-kmp/src/commonMain/kotlin/{io/iohk/atala/prism/anoncred => anoncred/wrapper}/Platform.kt (70%) rename anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/{io/iohk/atala/prism/anoncred => anoncred/wrapper}/AndroidIgnore.kt (70%) rename anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/{io/iohk/atala/prism/anoncred/PrismIssuerTests.kt => anoncred/wrapper/IssuerTests.kt} (69%) rename anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/{io/iohk/atala/prism/anoncred/PrismProverTests.kt => anoncred/wrapper/ProverTests.kt} (66%) rename anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/{io/iohk/atala/prism/anoncred => anoncred/wrapper}/AndroidIgnore.kt (70%) rename anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/{PrismIssuerTests.kt => IssuerTests.kt} (70%) rename anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/{PrismProverTests.kt => ProverTests.kt} (70%) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5e29832c..01fca233 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,7 +20,7 @@ jobs: build: runs-on: macos-latest steps: - - name: Checkout the repo + - name: "Checkout the repo" uses: actions/checkout@v3 with: submodules: recursive @@ -33,18 +33,14 @@ jobs: java-version: "${{ env.JAVA_VERSION }}" distribution: zulu - - name: Gradle Build Action + - name: "Gradle Build Action" uses: gradle/gradle-build-action@v2 - - name: Test Kotlin code is properly formatted + - name: "Test Kotlin code is properly formatted" working-directory: ./anoncred-kmm run: ./gradlew ktlintCheck - - name: Check bin files - working-directory: ./anoncred-kmm - run: ./gradlew :anoncred-wrapper-rust:printFiles - - - name: Install Homebrew + - name: "Install Homebrew" run: > /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" @@ -90,6 +86,6 @@ jobs: run: | cargo install cargo-ndk - - name: Build Check All tests + - name: "Build Check All tests" working-directory: ./anoncred-kmm run: ./gradlew :anoncreds-kmp:allTests diff --git a/anoncred-kmm/anoncred-wrapper-rust/build.gradle.kts b/anoncred-kmm/anoncred-wrapper-rust/build.gradle.kts index dae95664..01d5bc94 100644 --- a/anoncred-kmm/anoncred-wrapper-rust/build.gradle.kts +++ b/anoncred-kmm/anoncred-wrapper-rust/build.gradle.kts @@ -52,21 +52,6 @@ fun Project.commandLineWithOutput(vararg commands: String) { // pb.start().waitFor() // println(pb.output) -val printFiles by tasks.register("printFiles") { - group = "print" - doLast { - val directoryPath = project.file("/Users/runner/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/") - - if (directoryPath.isDirectory) { - directoryPath.listFiles()?.forEach { file -> - println(file.name) - } - } else { - println("The specified path is not a directory.") - } - } -} - /** * Delete the generated `Target` folder that is being generated by Rust Cargo */ diff --git a/anoncred-kmm/anoncreds-kmp/build.gradle.kts b/anoncred-kmm/anoncreds-kmp/build.gradle.kts index c9fbdb94..704e74c9 100644 --- a/anoncred-kmm/anoncreds-kmp/build.gradle.kts +++ b/anoncred-kmm/anoncreds-kmp/build.gradle.kts @@ -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 { diff --git a/anoncred-kmm/anoncreds-kmp/src/androidMain/AndroidManifest.xml b/anoncred-kmm/anoncreds-kmp/src/androidMain/AndroidManifest.xml index b662225a..9f3363d8 100644 --- a/anoncred-kmm/anoncreds-kmp/src/androidMain/AndroidManifest.xml +++ b/anoncred-kmm/anoncreds-kmp/src/androidMain/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/anoncred-kmm/anoncreds-kmp/src/androidUnitTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt b/anoncred-kmm/anoncreds-kmp/src/androidUnitTest/kotlin/anoncred/wrapper/AndroidIgnore.kt similarity index 75% rename from anoncred-kmm/anoncreds-kmp/src/androidUnitTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt rename to anoncred-kmm/anoncreds-kmp/src/androidUnitTest/kotlin/anoncred/wrapper/AndroidIgnore.kt index ba610ec1..aab81b4c 100644 --- a/anoncred-kmm/anoncreds-kmp/src/androidUnitTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt +++ b/anoncred-kmm/anoncreds-kmp/src/androidUnitTest/kotlin/anoncred/wrapper/AndroidIgnore.kt @@ -1,4 +1,4 @@ -package io.iohk.atala.prism.anoncred +package anoncred.wrapper import org.junit.Ignore diff --git a/anoncred-kmm/anoncreds-kmp/src/commonMain/kotlin/io/iohk/atala/prism/anoncred/Platform.kt b/anoncred-kmm/anoncreds-kmp/src/commonMain/kotlin/anoncred/wrapper/Platform.kt similarity index 70% rename from anoncred-kmm/anoncreds-kmp/src/commonMain/kotlin/io/iohk/atala/prism/anoncred/Platform.kt rename to anoncred-kmm/anoncreds-kmp/src/commonMain/kotlin/anoncred/wrapper/Platform.kt index d6c89392..faafda69 100644 --- a/anoncred-kmm/anoncreds-kmp/src/commonMain/kotlin/io/iohk/atala/prism/anoncred/Platform.kt +++ b/anoncred-kmm/anoncreds-kmp/src/commonMain/kotlin/anoncred/wrapper/Platform.kt @@ -1,4 +1,4 @@ -package io.iohk.atala.prism.anoncred +package anoncred.wrapper enum class Platform { Linux, diff --git a/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt b/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/AndroidIgnore.kt similarity index 70% rename from anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt rename to anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/AndroidIgnore.kt index a7ec7389..79632bdc 100644 --- a/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt +++ b/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/AndroidIgnore.kt @@ -1,4 +1,4 @@ -package io.iohk.atala.prism.anoncred +package anoncred.wrapper /** * Ignore Unit tests on Android Platform diff --git a/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/PrismIssuerTests.kt b/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/IssuerTests.kt similarity index 69% rename from anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/PrismIssuerTests.kt rename to anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/IssuerTests.kt index b83eb041..86a22d1e 100644 --- a/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/PrismIssuerTests.kt +++ b/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/IssuerTests.kt @@ -1,4 +1,4 @@ -package io.iohk.atala.prism.anoncred +package anoncred.wrapper import anoncreds_wrapper.AttributeValues import anoncreds_wrapper.CredentialDefinitionConfig @@ -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") @@ -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", @@ -48,11 +48,11 @@ 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", @@ -60,7 +60,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -75,11 +75,11 @@ 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", @@ -87,7 +87,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -95,7 +95,7 @@ class PrismIssuerTests { RegistryType.CL_ACCUM, 1000u ) - val revStatusList = prismIssuer.createRevocationStatusList( + val revStatusList = issuer.createRevocationStatusList( "did:web:xyz/resource/rev-reg-def", rev.regDef, "did:web:xyz", @@ -107,11 +107,11 @@ 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", @@ -119,7 +119,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -127,24 +127,24 @@ class PrismIssuerTests { 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", @@ -152,7 +152,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -160,14 +160,14 @@ class PrismIssuerTests { 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() @@ -175,11 +175,11 @@ class PrismIssuerTests { } @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", @@ -187,17 +187,17 @@ class PrismIssuerTests { 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", @@ -205,12 +205,12 @@ class PrismIssuerTests { 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, diff --git a/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/PrismProverTests.kt b/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/ProverTests.kt similarity index 66% rename from anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/PrismProverTests.kt rename to anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/ProverTests.kt index 75138109..1220d352 100644 --- a/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/io/iohk/atala/prism/anoncred/PrismProverTests.kt +++ b/anoncred-kmm/anoncreds-kmp/src/commonTest/kotlin/anoncred/wrapper/ProverTests.kt @@ -1,4 +1,4 @@ -package io.iohk.atala.prism.anoncred +package anoncred.wrapper import anoncreds_wrapper.CredentialDefinitionConfig import anoncreds_wrapper.Issuer @@ -9,22 +9,22 @@ 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", @@ -32,15 +32,15 @@ class PrismProverTests { 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, diff --git a/anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt b/anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/anoncred/wrapper/AndroidIgnore.kt similarity index 70% rename from anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt rename to anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/anoncred/wrapper/AndroidIgnore.kt index 5298c83f..1382ef18 100644 --- a/anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/io/iohk/atala/prism/anoncred/AndroidIgnore.kt +++ b/anoncred-kmm/anoncreds-kmp/src/jvmTest/kotlin/anoncred/wrapper/AndroidIgnore.kt @@ -1,4 +1,4 @@ -package io.iohk.atala.prism.anoncred +package anoncred.wrapper /** * Ignore Unit tests on Android Platform diff --git a/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/PrismIssuerTests.kt b/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/IssuerTests.kt similarity index 70% rename from anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/PrismIssuerTests.kt rename to anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/IssuerTests.kt index d50b7a41..474d1526 100644 --- a/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/PrismIssuerTests.kt +++ b/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/IssuerTests.kt @@ -14,9 +14,9 @@ import org.junit.Test import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) -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("scheme not equal", expectedSchema, scheme) @@ -30,11 +30,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", @@ -49,11 +49,11 @@ 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", @@ -61,7 +61,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -76,11 +76,11 @@ 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", @@ -88,7 +88,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -96,7 +96,7 @@ class PrismIssuerTests { RegistryType.CL_ACCUM, 1000u ) - val revStatusList = prismIssuer.createRevocationStatusList( + val revStatusList = issuer.createRevocationStatusList( "did:web:xyz/resource/rev-reg-def", rev.regDef, "did:web:xyz", @@ -108,11 +108,11 @@ 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", @@ -120,7 +120,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -128,24 +128,24 @@ class PrismIssuerTests { 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", @@ -153,7 +153,7 @@ class PrismIssuerTests { SignatureType.CL, CredentialDefinitionConfig(true) ) - val rev = prismIssuer.createRevocationRegistryDef( + val rev = issuer.createRevocationRegistryDef( cred.credentialDefinition, "did:web:xyz/resource/cred-def", "did:web:xyz", @@ -161,24 +161,24 @@ class PrismIssuerTests { 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) } @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", @@ -186,17 +186,17 @@ class PrismIssuerTests { 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", @@ -204,12 +204,12 @@ class PrismIssuerTests { 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, diff --git a/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/PrismProverTests.kt b/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/ProverTests.kt similarity index 70% rename from anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/PrismProverTests.kt rename to anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/ProverTests.kt index f6c71372..48bd8110 100644 --- a/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/PrismProverTests.kt +++ b/anoncred-kmm/testapp/src/androidTest/java/com/example/testapp/ProverTests.kt @@ -11,22 +11,22 @@ import org.junit.Test import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) -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", @@ -34,15 +34,15 @@ class PrismProverTests { 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,