From a4e8c0bc2c2b6525455c15c5f5b75ed78232ad44 Mon Sep 17 00:00:00 2001 From: Erwin Kok Date: Sat, 28 Sep 2024 13:06:24 +0200 Subject: [PATCH] Dependency update --- build.gradle.kts | 2 +- gradle/libs.versions.toml | 18 +++++++++--------- .../multiformat/multicodec/Multicodec.kt | 10 +++++++++- .../org/erwinkok/multiformat/spec/multibase | 2 +- .../org/erwinkok/multiformat/spec/multicodec | 2 +- .../org/erwinkok/multiformat/spec/multihash | 2 +- .../multiformat/multibase/MultibaseTest.kt | 18 ++++++++---------- 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index baa0cbb..cf89a61 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ import com.adarshr.gradle.testlogger.theme.ThemeType @Suppress("DSL_SCOPE_VIOLATION") plugins { - kotlin("jvm") version "1.9.0" + kotlin("jvm") version "2.0.20" `java-library` `java-test-fixtures` diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6d3c52a..42d17e1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,21 +1,21 @@ [versions] -kotlinx-coroutines = "1.7.3" -kotlinx-atomicfu = "0.21.0" +kotlinx-coroutines = "1.9.0" +kotlinx-atomicfu = "0.25.0" kotlin-logging = "3.0.5" -kotlinx-serialization = "1.5.1" -junit-jupiter = "5.10.0" -slf4j-api = "2.0.7" +kotlinx-serialization = "1.7.3" +junit-jupiter = "5.11.1" +slf4j-api = "2.0.16" -kotlin = "1.9.0" +kotlin = "2.0.20" kover-plugin = "0.7.2" ktlint-plugin = "11.5.0" nexus-plugin = "1.3.0" versions-plugin = "0.47.0" -testlogger-plugin = "3.2.0" +testlogger-plugin = "4.0.0" protobuf-plugin = "0.9.3" -ipaddress = "5.4.0" -ktor = "2.3.2" +ipaddress = "5.5.1" +ktor = "2.3.12" result-monad = "1.4.0" diff --git a/src/main/kotlin/org/erwinkok/multiformat/multicodec/Multicodec.kt b/src/main/kotlin/org/erwinkok/multiformat/multicodec/Multicodec.kt index 2424550..53bff8f 100644 --- a/src/main/kotlin/org/erwinkok/multiformat/multicodec/Multicodec.kt +++ b/src/main/kotlin/org/erwinkok/multiformat/multicodec/Multicodec.kt @@ -59,12 +59,14 @@ enum class Multicodec(val typeName: String, val code: Int, val tag: MulticodecTa GIT_RAW("git-raw", 0x78, MulticodecTag.Ipld), TORRENT_INFO("torrent-info", 0x7b, MulticodecTag.Ipld), TORRENT_FILE("torrent-file", 0x7c, MulticodecTag.Ipld), + BLAKE3_HASHSEQ("blake3-hashseq", 0x80, MulticodecTag.Ipld), LEOFCOIN_BLOCK("leofcoin-block", 0x81, MulticodecTag.Ipld), LEOFCOIN_TX("leofcoin-tx", 0x82, MulticodecTag.Ipld), LEOFCOIN_PR("leofcoin-pr", 0x83, MulticodecTag.Ipld), SCTP("sctp", 0x84, MulticodecTag.Multiaddr), DAG_JOSE("dag-jose", 0x85, MulticodecTag.Ipld), DAG_COSE("dag-cose", 0x86, MulticodecTag.Ipld), + LBRY("lbry", 0x8c, MulticodecTag.Namespace), ETH_BLOCK("eth-block", 0x90, MulticodecTag.Ipld), ETH_BLOCK_LIST("eth-block-list", 0x91, MulticodecTag.Ipld), ETH_TX_TRIE("eth-tx-trie", 0x92, MulticodecTag.Ipld), @@ -135,6 +137,7 @@ enum class Multicodec(val typeName: String, val code: Int, val tag: MulticodecTa TLS("tls", 0x1c0, MulticodecTag.Multiaddr), SNI("sni", 0x1c1, MulticodecTag.Multiaddr), NOISE("noise", 0x1c6, MulticodecTag.Multiaddr), + SHS("shs", 0x1c8, MulticodecTag.Multiaddr), QUIC("quic", 0x1cc, MulticodecTag.Multiaddr), QUIC_V1("quic-v1", 0x1cd, MulticodecTag.Multiaddr), WEBTRANSPORT("webtransport", 0x1d1, MulticodecTag.Multiaddr), @@ -143,6 +146,7 @@ enum class Multicodec(val typeName: String, val code: Int, val tag: MulticodecTa WSS("wss", 0x1de, MulticodecTag.Multiaddr), P2P_WEBSOCKET_STAR("p2p-websocket-star", 0x1df, MulticodecTag.Multiaddr), HTTP("http", 0x1e0, MulticodecTag.Multiaddr), + HTTP_PATH("http-path", 0x1e1, MulticodecTag.Multiaddr), SWHID_1_SNP("swhid-1-snp", 0x1f0, MulticodecTag.Ipld), JSON("json", 0x200, MulticodecTag.Ipld), MESSAGEPACK("messagepack", 0x201, MulticodecTag.Serialization), @@ -182,6 +186,9 @@ enum class Multicodec(val typeName: String, val code: Int, val tag: MulticodecTa P256_PRIV("p256-priv", 0x1306, MulticodecTag.Key), P384_PRIV("p384-priv", 0x1307, MulticodecTag.Key), P521_PRIV("p521-priv", 0x1308, MulticodecTag.Key), + BLS12_381_G1_PRIV("bls12_381-g1-priv", 0x1309, MulticodecTag.Key), + BLS12_381_G2_PRIV("bls12_381-g2-priv", 0x130a, MulticodecTag.Key), + BLS12_381_G1G2_PRIV("bls12_381-g1g2-priv", 0x130b, MulticodecTag.Key), KANGAROOTWELVE("kangarootwelve", 0x1d01, MulticodecTag.Multihash), AES_GCM_256("aes-gcm-256", 0x2000, MulticodecTag.Encryption), SILVERPINE("silverpine", 0x3f42, MulticodecTag.Multiaddr), @@ -513,9 +520,10 @@ enum class Multicodec(val typeName: String, val code: Int, val tag: MulticodecTa XXH3_128("xxh3-128", 0xb3e4, MulticodecTag.Hash), POSEIDON_BLS12_381_A2_FC1("poseidon-bls12_381-a2-fc1", 0xb401, MulticodecTag.Multihash), POSEIDON_BLS12_381_A2_FC1_SC("poseidon-bls12_381-a2-fc1-sc", 0xb402, MulticodecTag.Multihash), - URDCA_2015_CANON("urdca-2015-canon", 0xb403, MulticodecTag.Ipld), + RDFC_1("rdfc-1", 0xb403, MulticodecTag.Ipld), SSZ("ssz", 0xb501, MulticodecTag.Serialization), SSZ_SHA2_256_BMT("ssz-sha2-256-bmt", 0xb502, MulticodecTag.Multihash), + SHA2_256_CHUNKED("sha2-256-chunked", 0xb510, MulticodecTag.Multihash), JSON_JCS("json-jcs", 0xb601, MulticodecTag.Ipld), ISCC("iscc", 0xcc01, MulticodecTag.Softhash), ZEROXCERT_IMPRINT_256("zeroxcert-imprint-256", 0xce11, MulticodecTag.Zeroxcert), diff --git a/src/main/kotlin/org/erwinkok/multiformat/spec/multibase b/src/main/kotlin/org/erwinkok/multiformat/spec/multibase index af2d36b..b05e86a 160000 --- a/src/main/kotlin/org/erwinkok/multiformat/spec/multibase +++ b/src/main/kotlin/org/erwinkok/multiformat/spec/multibase @@ -1 +1 @@ -Subproject commit af2d36bdfaeaca453d20b18542ca57bd56b51f6c +Subproject commit b05e86ab03f233bfb9c2e09a5d1909438b22162c diff --git a/src/main/kotlin/org/erwinkok/multiformat/spec/multicodec b/src/main/kotlin/org/erwinkok/multiformat/spec/multicodec index 08deb26..3b7b52d 160000 --- a/src/main/kotlin/org/erwinkok/multiformat/spec/multicodec +++ b/src/main/kotlin/org/erwinkok/multiformat/spec/multicodec @@ -1 +1 @@ -Subproject commit 08deb26f604cd2c8aca9f000a025cf65e5ea7627 +Subproject commit 3b7b52deb31481790bc4bae984d8675bda4e0c82 diff --git a/src/main/kotlin/org/erwinkok/multiformat/spec/multihash b/src/main/kotlin/org/erwinkok/multiformat/spec/multihash index 381cb33..931febb 160000 --- a/src/main/kotlin/org/erwinkok/multiformat/spec/multihash +++ b/src/main/kotlin/org/erwinkok/multiformat/spec/multihash @@ -1 +1 @@ -Subproject commit 381cb3310e42d2263130781ab6fd559a46d40ab8 +Subproject commit 931febb97565395b1b6cd39ac677799df265a9e7 diff --git a/src/test/kotlin/org/erwinkok/multiformat/multibase/MultibaseTest.kt b/src/test/kotlin/org/erwinkok/multiformat/multibase/MultibaseTest.kt index 2f8f5df..75a842b 100644 --- a/src/test/kotlin/org/erwinkok/multiformat/multibase/MultibaseTest.kt +++ b/src/test/kotlin/org/erwinkok/multiformat/multibase/MultibaseTest.kt @@ -26,6 +26,7 @@ private val logger = KotlinLogging.logger {} internal class MultibaseTest { private data class MultibaseSpec( val name: String, + val unicode: String, val code: String, val description: String, val status: String, @@ -34,7 +35,7 @@ internal class MultibaseTest { @Test fun `test specification`() { val multibaseSpec = readMultibaseSpec() - for (mb in Multibase.values()) { + for (mb in Multibase.entries) { assertTrue(multibaseSpec.containsKey(mb.encoding), "Specification does define ${mb.encoding}") val spec = multibaseSpec[mb.encoding]!! assertEquals(spec.code, mb.code, "Code mismatch for ${mb.encoding}: ${spec.code} != ${mb.code}") @@ -243,14 +244,11 @@ internal class MultibaseTest { return reader.lineSequence() .filter { it.isNotBlank() } .map { - val (name, code, description, status) = it.split(',', ignoreCase = false, limit = 4) - val sCode = code.trim() - val cCode = if (sCode.startsWith("0x")) { - Integer.decode(sCode).toChar().toString() - } else { - sCode - } - MultibaseSpec(name.trim(), cCode, description.trim(), status.trim()) - }.map { it.name to it }.toMap() + val (unicode, character, encoding, description, status) = it.split(',', ignoreCase = false, limit = 5) + MultibaseSpec(encoding.trim(), unicode.trim(), character.trim(), description.trim(), status.trim()) + }.map { it.name to it } + .filter { it.second.status != "reserved" } + .toMap() + .plus("identity" to MultibaseSpec("identity", "U+0000", "\u0000", "8-bit binary (encoder and decoder keeps data unmodified)", "reserved")) } }