From 7ce4ea791c1ce3c5f5074ec85d6a95c152369eab Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 18:27:26 +0000 Subject: [PATCH] fix(cordn): use common Event JSON in CordnMigration so commonMain compiles JacksonMapper lives in quartz's jvmAndroid source set, so referencing it from commons/commonMain broke compileCommonMainKotlinMetadata. Event.toJson() and Event.fromJson() are the commonMain equivalents. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019882DpmyxzsSD7QUYzPoEf --- .../vitorpamplona/amethyst/commons/cordn/CordnMigration.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/cordn/CordnMigration.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/cordn/CordnMigration.kt index ce25ee73f8..c2e5b73ef0 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/cordn/CordnMigration.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/cordn/CordnMigration.kt @@ -34,7 +34,6 @@ import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip01Core.crypto.KeyPair import com.vitorpamplona.quartz.nip01Core.crypto.verify -import com.vitorpamplona.quartz.nip01Core.jackson.JacksonMapper import com.vitorpamplona.quartz.nip01Core.relay.client.INostrClient import com.vitorpamplona.quartz.nip01Core.relay.client.accessories.fetchFirst import com.vitorpamplona.quartz.nip01Core.relay.client.accessories.publishAndConfirm @@ -150,7 +149,7 @@ class CordnMigration( val dTag = RandomInstance.randomChars(D_TAG_LENGTH) val inner = signer.signInner(inventory) - val sealedInner = signer.nip44Encrypt(JacksonMapper.toJson(inner), signer.pubKey) + val sealedInner = signer.nip44Encrypt(inner.toJson(), signer.pubKey) val outer = NostrSignerInternal(ephemeral).sign( @@ -215,7 +214,7 @@ class CordnMigration( val inner = try { - JacksonMapper.fromJson(innerJson) + Event.fromJson(innerJson) } catch (e: Exception) { throw CordnMigrationException("the tip's inner event is not readable: ${e.message}") }