Skip to content

Commit

Permalink
feat(pluto) Database initialisation and connection state checking (#30)
Browse files Browse the repository at this point in the history
* Fix issues with Javascript integration, use Library and not executable.

* Integrate platform to better check if platform is of one type or another.

* Integrate Pluto Database connection with native support + unit testing.
  • Loading branch information
elribonazo authored Feb 13, 2023
1 parent 537c145 commit 93884d5
Show file tree
Hide file tree
Showing 43 changed files with 297 additions and 523 deletions.
2 changes: 1 addition & 1 deletion apollo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kotlin {

js(IR) {
this.moduleName = currentModuleName
this.binaries.executable()
this.binaries.library()
this.useCommonJs()
this.compilations["main"].packageJson {
this.version = rootProject.version.toString()
Expand Down
2 changes: 1 addition & 1 deletion castor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kotlin {

js(IR) {
this.moduleName = currentModuleName
this.binaries.executable()
this.binaries.library()
this.useCommonJs()
this.compilations["main"].packageJson {
this.version = rootProject.version.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ expect class CastorImpl(apollo: Apollo) : Castor {
override fun parseDID(did: String): DID
override fun createPrismDID(
masterPublicKey: PublicKey,
services: Array<DIDDocument.Service>?
services: Array<DIDDocument.Service>?,
): DID

@Throws(CastorError.InvalidKeyError::class)
override fun createPeerDID(
keyPairs: Array<KeyPair>,
services: Array<DIDDocument.Service>
services: Array<DIDDocument.Service>,
): DID
}
152 changes: 0 additions & 152 deletions core-sdk/build.gradle.kts

This file was deleted.

2 changes: 0 additions & 2 deletions core-sdk/src/androidMain/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kotlin {

js(IR) {
this.moduleName = currentModuleName
this.binaries.executable()
this.binaries.library()
this.useCommonJs()
this.compilations["main"].packageJson {
this.version = rootProject.version.toString()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.iohk.atala.prism.walletsdk.domain.models

actual object Platform {
actual val type: PlatformType
get() = PlatformType.ANDROID
actual val OS: String
get() = "Android ${android.os.Build.VERSION.SDK_INT}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ import io.iohk.atala.prism.walletsdk.domain.models.PeerDID
import io.iohk.atala.prism.walletsdk.domain.models.PrismDIDInfo
import io.iohk.atala.prism.walletsdk.domain.models.PrivateKey
import io.iohk.atala.prism.walletsdk.domain.models.VerifiableCredential
import kotlin.js.ExperimentalJsExport
import kotlin.js.JsExport
import kotlin.js.JsName

@OptIn(ExperimentalJsExport::class)
@JsExport
interface Pluto {

fun storePrismDID(
did: DID,
keyPathIndex: Int,
alias: String?
alias: String?,
)

fun storePeerDID(did: DID, privateKeys: Array<PrivateKey>)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
package io.iohk.atala.prism.walletsdk.domain.models

import kotlinx.serialization.Serializable
import kotlin.js.ExperimentalJsExport
import kotlin.js.JsExport
import kotlin.js.JsName
import kotlin.jvm.JvmStatic

@OptIn(ExperimentalJsExport::class)
@Serializable
@JsExport
data class DID(
val schema: String,
val method: String,
val methodId: String
val methodId: String,
) {

@JsName("fromString")
constructor(
string: String
string: String,
) : this(getSchemaFromString(string), getMethodFromString(string), getMethodIdFromString(string))

override fun toString(): String {
Expand Down
Loading

0 comments on commit 93884d5

Please sign in to comment.