diff --git a/.editorconfig b/.editorconfig index 3e22a6088..7aa1c456b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,3 +5,4 @@ ktlint_code_style = intellij_idea ktlint_standard_no_semi = disabled ktlint_standard_trailing-comma-on-call-site = disabled ktlint_standard_trailing-comma-on-declaration-site = disabled +ktlint_standard_no-empty-file = disabled diff --git a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/domain/models/MessageAttachment.kt b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/domain/models/MessageAttachment.kt index 89862b5c8..06fb12d59 100644 --- a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/domain/models/MessageAttachment.kt +++ b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/domain/models/MessageAttachment.kt @@ -107,7 +107,8 @@ data class AttachmentDescriptor @JvmOverloads constructor( val data: AttachmentData, val filename: Array? = null, val format: String? = null, - val lastModTime: String? = null, // TODO(Date format) + // TODO(Date format) + val lastModTime: String? = null, val byteCount: Int? = null, val description: String? = null ) : AttachmentData { diff --git a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/pollux/models/CredentialRequest.kt b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/pollux/models/CredentialRequest.kt index 8bfce8f15..a709312f7 100644 --- a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/pollux/models/CredentialRequest.kt +++ b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/pollux/models/CredentialRequest.kt @@ -15,6 +15,7 @@ import kotlinx.serialization.Serializable * @property entropy The entropy for the credential request. * @property nonce The nonce for the credential request. */ +@Suppress("ktlint:standard:property-naming") interface CredentialRequest { val cred_def_id: String val blinded_ms: CredentialRequestBlindedMS @@ -38,6 +39,7 @@ interface CredentialRequestBlindedMS { * @property v_dash_cap The value used in the proof calculation. * @property m_caps The map of attribute names to their corresponding blinded value commitments. */ +@Suppress("ktlint:standard:property-naming") interface CredentialRequestBlindedMSCorrectnessProof { val c: String val v_dash_cap: String diff --git a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionAccept.kt b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionAccept.kt index ad83d70d9..5e5109ebf 100644 --- a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionAccept.kt +++ b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionAccept.kt @@ -118,17 +118,31 @@ class ConnectionAccept { * @return true if this [Body] object is equal to the specified [other] object, false otherwise. */ override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other == null || this::class != other::class) return false + if (this === other) { + return true + } + if (other == null || this::class != other::class) { + return false + } other as Body - if (goalCode != other.goalCode) return false - if (goal != other.goal) return false + if (goalCode != other.goalCode) { + return false + } + if (goal != other.goal) { + return false + } if (accept != null) { - if (other.accept == null) return false - if (!accept.contentEquals(other.accept)) return false - } else if (other.accept != null) return false + if (other.accept == null) { + return false + } + if (!accept.contentEquals(other.accept)) { + return false + } + } else if (other.accept != null) { + return false + } return true } diff --git a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionRequest.kt b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionRequest.kt index 9b609d955..fc9d07637 100644 --- a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionRequest.kt +++ b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/connection/ConnectionRequest.kt @@ -143,17 +143,31 @@ class ConnectionRequest { * @return true if the objects are equal, false otherwise. */ override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other == null || this::class != other::class) return false + if (this === other) { + return true + } + if (other == null || this::class != other::class) { + return false + } other as Body - if (goalCode != other.goalCode) return false - if (goal != other.goal) return false + if (goalCode != other.goalCode) { + return false + } + if (goal != other.goal) { + return false + } if (accept != null) { - if (other.accept == null) return false - if (!accept.contentEquals(other.accept)) return false - } else if (other.accept != null) return false + if (other.accept == null) { + return false + } + if (!accept.contentEquals(other.accept)) { + return false + } + } else if (other.accept != null) { + return false + } return true } diff --git a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/proofOfPresentation/Presentation.kt b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/proofOfPresentation/Presentation.kt index 54835958d..ae46ba9a8 100644 --- a/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/proofOfPresentation/Presentation.kt +++ b/atala-prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/protocols/proofOfPresentation/Presentation.kt @@ -30,20 +30,38 @@ data class ProofTypes( * @return true if the objects are equal, false otherwise. */ override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other == null || this::class != other::class) return false + if (this === other) { + return true + } + if (other == null || this::class != other::class) { + return false + } other as ProofTypes - if (schema != other.schema) return false + if (schema != other.schema) { + return false + } if (requiredFields != null) { - if (other.requiredFields == null) return false - if (!requiredFields.contentEquals(other.requiredFields)) return false - } else if (other.requiredFields != null) return false + if (other.requiredFields == null) { + return false + } + if (!requiredFields.contentEquals(other.requiredFields)) { + return false + } + } else if (other.requiredFields != null) { + return false + } if (trustIssuers != null) { - if (other.trustIssuers == null) return false - if (!trustIssuers.contentEquals(other.trustIssuers)) return false - } else if (other.trustIssuers != null) return false + if (other.trustIssuers == null) { + return false + } + if (!trustIssuers.contentEquals(other.trustIssuers)) { + return false + } + } else if (other.trustIssuers != null) { + return false + } return true } diff --git a/atala-prism-sdk/src/commonTest/kotlin/io/iohk/atala/prism/walletsdk/mercury/MercuryTests.kt b/atala-prism-sdk/src/commonTest/kotlin/io/iohk/atala/prism/walletsdk/mercury/MercuryTests.kt index f8c5d88bf..5bb836eee 100644 --- a/atala-prism-sdk/src/commonTest/kotlin/io/iohk/atala/prism/walletsdk/mercury/MercuryTests.kt +++ b/atala-prism-sdk/src/commonTest/kotlin/io/iohk/atala/prism/walletsdk/mercury/MercuryTests.kt @@ -59,7 +59,8 @@ class MercuryTests { fun testSendMessage_shouldThrowError_whenServiceAbsent() = runTest { val idDid = DID("did", "prism", "123") val allAuthentication = DIDDocument.Authentication(arrayOf(), arrayOf()) - val resolveDIDReturn = DIDDocument(idDid, arrayOf(/*service,*/ allAuthentication)) + // val resolveDIDReturn = DIDDocument(idDid, arrayOf(/*service,*/ allAuthentication)) + val resolveDIDReturn = DIDDocument(idDid, arrayOf(allAuthentication)) castorMock.resolveDIDReturn = resolveDIDReturn val msg = Message(piuri = "", body = "", from = DID("test", "method", "id"), to = DID("test", "method", "id")) assertFailsWith { sut.sendMessage(msg) } diff --git a/sampleapp/build.gradle.kts b/sampleapp/build.gradle.kts index 8fa7e217d..fbccaf58b 100644 --- a/sampleapp/build.gradle.kts +++ b/sampleapp/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") - id("com.google.devtools.ksp") version("1.9.22-1.0.16") + id("com.google.devtools.ksp") version "1.9.22-1.0.16" } apply(plugin = "kotlinx-atomicfu")