Skip to content

Commit

Permalink
feat: update did peer library to follow new specs
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianIOHK committed Feb 23, 2024
1 parent fea322f commit 236f375
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DIDCreateTest {
}

@Test
fun testNewPeerDID() = runTest {
fun testPeerDIDCreation_whenServicesProvided_thenCreatedCorrectly() = runTest {
val apollo = ApolloImpl()

val properties: MutableMap<String, Any> = mutableMapOf()
Expand Down Expand Up @@ -80,16 +80,15 @@ class DIDCreateTest {
type = arrayOf(DIDCOMM_MESSAGING),
serviceEndpoint = DIDDocument.ServiceEndpoint(
uri = "https://example.com/endpoint",
accept = arrayOf(DIDCOMM_MESSAGING),
accept = emptyArray(),
routingKeys = arrayOf("did:example:somemediator#somekey")
)
)

val castor = CastorImpl(apollo)
val did = castor.createPeerDID(keyPairs, arrayOf(service))
val validPeerDID = "did:peer:2.Ez6LSoHkfN1Y4nK9RCjx7vopWsLrMGNFNgTNZgoCNQrTzmb1n.Vz6MknRZmapV7uYZQuZez9n9N3tQotjRN18UGS68Vcfo6gR4h.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vZW5kcG9pbnQiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5Il0sImEiOltdfX0"
assertEquals(validPeerDID, did.toString())

val expectedPeerDID = "did:peer:2.Ez6LSoHkfN1Y4nK9RCjx7vopWsLrMGNFNgTNZgoCNQrTzmb1n.Vz6MknRZmapV7uYZQuZez9n9N3tQotjRN18UGS68Vcfo6gR4h.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vZW5kcG9pbnQiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5Il0sImEiOltdfX0"
assertEquals(expectedPeerDID, did.toString())
}

@OptIn(ExperimentalCoroutinesApi::class)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android.useAndroidX = true
kotlin.mpp.enableCInteropCommonization = true
kotlin.native.cacheKind.iosSimulatorArm64 = none
apollo_version = 1.0.15
didpeer_version = 1.1.0
didpeer_version = 1.1.1
kotlin.mpp.androidSourceSetLayoutVersion = 2
kotlinx.atomicfu.enableJvmIrTransformation = true
kotlinx.atomicfu.enableJsIrTransformation = true

0 comments on commit 236f375

Please sign in to comment.