From 74529e67d89941ac044b375ece7813fa9e6ad79d Mon Sep 17 00:00:00 2001 From: Pedro Novais <1478752+jpnovais@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:23:23 +0100 Subject: [PATCH] Jackson Serialiser and Deserialisers (#194) * adds jackson Serilaiser and Deserialisers * improve jackson Bytes SerDe --- .../ProofToFinalizeJsonResponseTest.kt | 2 +- gradle/libs.versions.toml | 3 +- .../serialization/jackson/build.gradle | 13 ++ .../build/linea/s11n/jackson/BytesHexSerDe.kt | 51 ++++++ .../linea/s11n/jackson/InstantISO8601SerDe.kt | 22 +++ .../linea/s11n/jackson/NumbersHexSerDe.kt | 47 +++++ .../build/linea/s11n/jackson/ObjectMappers.kt | 36 ++++ .../linea/s11n/jackson/BytesSerDeTest.kt | 160 ++++++++++++++++++ .../s11n/jackson/InstantISO8601SerDeTest.kt | 65 +++++++ .../linea/s11n/jackson/NumbersSerDeTest.kt | 80 +++++++++ settings.gradle | 1 + 11 files changed, 478 insertions(+), 2 deletions(-) create mode 100644 jvm-libs/generic/serialization/jackson/build.gradle create mode 100644 jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/BytesHexSerDe.kt create mode 100644 jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/InstantISO8601SerDe.kt create mode 100644 jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/NumbersHexSerDe.kt create mode 100644 jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/ObjectMappers.kt create mode 100644 jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/BytesSerDeTest.kt create mode 100644 jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/InstantISO8601SerDeTest.kt create mode 100644 jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/NumbersSerDeTest.kt diff --git a/coordinator/clients/prover-client/serialization/src/test/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/ProofToFinalizeJsonResponseTest.kt b/coordinator/clients/prover-client/serialization/src/test/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/ProofToFinalizeJsonResponseTest.kt index f986fa147..cacdc7602 100644 --- a/coordinator/clients/prover-client/serialization/src/test/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/ProofToFinalizeJsonResponseTest.kt +++ b/coordinator/clients/prover-client/serialization/src/test/kotlin/net/consensys/zkevm/coordinator/clients/prover/serialization/ProofToFinalizeJsonResponseTest.kt @@ -60,7 +60,7 @@ class ProofToFinalizeJsonResponseTest { val jsonParser = jsonNode.traverse() while (!jsonParser.isClosed) { if (jsonParser.nextToken() == JsonToken.FIELD_NAME) { - keys.add(jsonParser.currentName) + keys.add(jsonParser.currentName()) } } return keys diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9a5be47e1..725044e1a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ jreleaser = {id = "org.jreleaser", version = "1.13.1"} besu = "22.4.2" caffeine = "3.1.6" hoplite = "2.7.5" -jackson = "2.14.2" +jackson = "2.18.0" jna = "5.14.0" junit = "5.10.1" kotlinxDatetime = "0.4.0" @@ -23,5 +23,6 @@ tuweni = "2.3.1" vertx = "4.5.0" web3j = "4.12.0" wiremock = "3.0.1" +jsonUnit = "3.4.1" blobCompressor = "0.0.4" blobShnarfCalculator = "0.0.4" diff --git a/jvm-libs/generic/serialization/jackson/build.gradle b/jvm-libs/generic/serialization/jackson/build.gradle new file mode 100644 index 000000000..6c14517dc --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'net.consensys.zkevm.kotlin-library-conventions' +} + +dependencies { + implementation(project(':jvm-libs:kotlin-extensions')) + api "com.fasterxml.jackson.core:jackson-annotations:${libs.versions.jackson.get()}" + api "com.fasterxml.jackson.core:jackson-databind:${libs.versions.jackson.get()}" + api "com.fasterxml.jackson.module:jackson-module-kotlin:${libs.versions.jackson.get()}" + api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${libs.versions.jackson.get()}" + + testImplementation "net.javacrumbs.json-unit:json-unit-assertj:${libs.versions.jsonUnit.get()}" +} diff --git a/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/BytesHexSerDe.kt b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/BytesHexSerDe.kt new file mode 100644 index 000000000..e3e6874d6 --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/BytesHexSerDe.kt @@ -0,0 +1,51 @@ +package build.linea.s11n.jackson + +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.JsonParser +import com.fasterxml.jackson.databind.DeserializationContext +import com.fasterxml.jackson.databind.JsonDeserializer +import com.fasterxml.jackson.databind.JsonSerializer +import com.fasterxml.jackson.databind.SerializerProvider +import java.util.HexFormat + +private val hexFormatter = HexFormat.of() + +object ByteArrayToHexSerializer : JsonSerializer() { + override fun serialize(value: ByteArray, gen: JsonGenerator, serializers: SerializerProvider?) { + gen.writeString("0x" + hexFormatter.formatHex(value)) + } + + override fun handledType(): Class { + return ByteArray::class.java + } +} + +object ByteToHexSerializer : JsonSerializer() { + override fun serialize(value: Byte, gen: JsonGenerator, serializers: SerializerProvider?) { + gen.writeString("0x" + hexFormatter.toHexDigits(value)) + } +} + +object UByteToHexSerializer : JsonSerializer() { + override fun serialize(value: UByte, gen: JsonGenerator, serializers: SerializerProvider?) { + gen.writeString("0x" + hexFormatter.toHexDigits(value.toByte())) + } +} + +object ByteArrayToHexDeserializer : JsonDeserializer() { + override fun deserialize(parser: JsonParser, contex: DeserializationContext): ByteArray { + return hexFormatter.parseHex(parser.text.removePrefix("0x")) + } +} + +object ByteToHexDeserializer : JsonDeserializer() { + override fun deserialize(parser: JsonParser, contex: DeserializationContext): Byte { + return hexFormatter.parseHex(parser.text.removePrefix("0x"))[0] + } +} + +object UByteToHexDeserializer : JsonDeserializer() { + override fun deserialize(parser: JsonParser, contex: DeserializationContext): UByte { + return hexFormatter.parseHex(parser.text.removePrefix("0x"))[0].toUByte() + } +} diff --git a/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/InstantISO8601SerDe.kt b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/InstantISO8601SerDe.kt new file mode 100644 index 000000000..3c1d671ec --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/InstantISO8601SerDe.kt @@ -0,0 +1,22 @@ +package build.linea.s11n.jackson + +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.JsonParser +import com.fasterxml.jackson.databind.DeserializationContext +import com.fasterxml.jackson.databind.JsonDeserializer +import com.fasterxml.jackson.databind.JsonSerializer +import com.fasterxml.jackson.databind.SerializerProvider +import kotlinx.datetime.Instant + +object InstantISO8601Serializer : JsonSerializer() { + override fun serialize(value: Instant, gen: JsonGenerator, serializers: SerializerProvider) { + gen.writeString(value.toString()) + } +} + +// To uncomment and add the tests when necessary +object InstantISO8601Deserializer : JsonDeserializer() { + override fun deserialize(p: JsonParser, ctxt: DeserializationContext): Instant { + return Instant.parse(p.text) + } +} diff --git a/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/NumbersHexSerDe.kt b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/NumbersHexSerDe.kt new file mode 100644 index 000000000..50496b5cd --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/NumbersHexSerDe.kt @@ -0,0 +1,47 @@ +package build.linea.s11n.jackson + +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.databind.JsonSerializer +import com.fasterxml.jackson.databind.SerializerProvider +import java.math.BigInteger + +internal fun Number.toHex(): String = "0x" + BigInteger(toString()).toString(16) +internal fun ULong.toHex(): String = "0x" + BigInteger(toString()).toString(16) + +object IntToHexSerializer : JsonSerializer() { + override fun serialize(value: Int, gen: JsonGenerator, serializers: SerializerProvider) { + gen.writeString(value.toHex()) + } +} + +@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") +object JIntegerToHexSerializer : JsonSerializer() { + override fun serialize(value: Integer, gen: JsonGenerator, serializers: SerializerProvider) { + gen.writeString(value.toHex()) + } +} + +object LongToHexSerializer : JsonSerializer() { + override fun serialize(value: Long, gen: JsonGenerator, serializers: SerializerProvider) { + gen.writeString(value.toHex()) + } +} + +@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") +object JLongToHexSerializer : JsonSerializer() { + override fun serialize(value: java.lang.Long, gen: JsonGenerator, serializers: SerializerProvider) { + gen.writeString(value.toHex()) + } +} + +object ULongToHexSerializer : JsonSerializer() { + override fun serialize(value: ULong, gen: JsonGenerator, serializers: SerializerProvider) { + gen.writeString(value.toHex()) + } +} + +object BigIntegerToHexSerializer : JsonSerializer() { + override fun serialize(value: BigInteger, gen: JsonGenerator, serializers: SerializerProvider) { + gen.writeString(value.toHex()) + } +} diff --git a/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/ObjectMappers.kt b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/ObjectMappers.kt new file mode 100644 index 000000000..dcd093ab3 --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/src/main/kotlin/build/linea/s11n/jackson/ObjectMappers.kt @@ -0,0 +1,36 @@ +package build.linea.s11n.jackson + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.module.SimpleModule +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import kotlinx.datetime.Instant +import java.math.BigInteger + +val ethNumberAsHexSerialisersModule = SimpleModule().apply { + this.addSerializer(Instant::class.java, InstantISO8601Serializer) + this.addDeserializer(Instant::class.java, InstantISO8601Deserializer) + this.addSerializer(Int::class.java, IntToHexSerializer) + this.addSerializer(Integer::class.java, JIntegerToHexSerializer) + this.addSerializer(Long::class.java, LongToHexSerializer) + this.addSerializer(java.lang.Long::class.java, JLongToHexSerializer) + this.addSerializer(ULong::class.java, ULongToHexSerializer) + this.addSerializer(BigInteger::class.java, BigIntegerToHexSerializer) +} + +val ethByteAsHexSerialisersModule = SimpleModule().apply { + this.addSerializer(Byte::class.java, ByteToHexSerializer) + this.addSerializer(UByte::class.java, UByteToHexSerializer) + this.addSerializer(ByteArray::class.java, ByteArrayToHexSerializer) +} + +val ethByteAsHexDeserialisersModule = SimpleModule().apply { + this.addDeserializer(Byte::class.java, ByteToHexDeserializer) + this.addDeserializer(UByte::class.java, UByteToHexDeserializer) + this.addDeserializer(ByteArray::class.java, ByteArrayToHexDeserializer) +} + +val ethApiObjectMapper: ObjectMapper = jacksonObjectMapper() + .registerModules( + ethNumberAsHexSerialisersModule, + ethByteAsHexSerialisersModule + ) diff --git a/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/BytesSerDeTest.kt b/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/BytesSerDeTest.kt new file mode 100644 index 000000000..cbafa2c3b --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/BytesSerDeTest.kt @@ -0,0 +1,160 @@ +package build.linea.s11n.jackson + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import com.fasterxml.jackson.module.kotlin.readValue +import net.consensys.decodeHex +import net.consensys.encodeHex +import net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test + +class BytesSerDeTest { + private lateinit var objectMapper: ObjectMapper + + private val jsonObj = """ + { + "nullBytes": null, + "emptyBytes": "0x", + "someBytes": "0x01aaff04", + "listOfByteArray": ["0x01aaff04", "0x01aaff05"], + "nullUByte": null, + "someUByte": "0xaf", + "minUByte": "0x00", + "maxUByte": "0xff", + "nullByte": null, + "someByte": "0xaf", + "minByte": "0x80", + "maxByte": "0x7f" + } + """.trimIndent() + private val objWithBytesFields = SomeObject( + // ByteArray + nullBytes = null, + emptyBytes = byteArrayOf(), + someBytes = "0x01aaff04".decodeHex(), + listOfByteArray = listOf("0x01aaff04", "0x01aaff05").map { it.decodeHex() }, + + // UByte + nullUByte = null, + someUByte = 0xaf.toUByte(), + minUByte = UByte.MIN_VALUE, + maxUByte = UByte.MAX_VALUE, + + // Byte + nullByte = null, + someByte = 0xaf.toByte(), + minByte = Byte.MIN_VALUE, + maxByte = Byte.MAX_VALUE + ) + + @BeforeEach + fun setUp() { + objectMapper = jacksonObjectMapper() + .registerModules(ethByteAsHexSerialisersModule) + .registerModules(ethByteAsHexDeserialisersModule) + } + + @Test + fun bytesSerDe() { + assertThatJson(objectMapper.writeValueAsString(objWithBytesFields)).isEqualTo(jsonObj) + assertThat(objectMapper.readValue(jsonObj)).isEqualTo(objWithBytesFields) + } + + @Test + fun testBytes() { + val list1 = listOf("0x01aaff04", "0x01aaff05").map { it.decodeHex() } + val list2 = listOf("0x01aaff04", "0x01aaff05", "0x01aaff06").map { it.decodeHex() } + list1.zip(list2).also { println(it) } + println(list1.zip(list2).all { (arr1, arr2) -> arr1.contentEquals(arr2) }) + + println(list1 == list2) + println(list1 != list2) + } + + private data class SomeObject( + // ByteArray + val nullBytes: ByteArray?, + val emptyBytes: ByteArray, + val someBytes: ByteArray, + val listOfByteArray: List, + + // UByte + val nullUByte: UByte?, + val someUByte: UByte, + val minUByte: UByte, + val maxUByte: UByte, + // Byte + val nullByte: Byte?, + val someByte: Byte, + val minByte: Byte, + val maxByte: Byte + ) { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as SomeObject + + if (nullBytes != null) { + if (other.nullBytes == null) return false + if (!nullBytes.contentEquals(other.nullBytes)) return false + } else if (other.nullBytes != null) return false + if (!emptyBytes.contentEquals(other.emptyBytes)) return false + if (!someBytes.contentEquals(other.someBytes)) return false + if (!contentEquals(listOfByteArray, other.listOfByteArray)) return false + if (nullUByte != other.nullUByte) return false + if (someUByte != other.someUByte) return false + if (minUByte != other.minUByte) return false + if (maxUByte != other.maxUByte) return false + if (nullByte != other.nullByte) return false + if (someByte != other.someByte) return false + if (minByte != other.minByte) return false + if (maxByte != other.maxByte) return false + + return true + } + + override fun hashCode(): Int { + var result = nullBytes?.contentHashCode() ?: 0 + result = 31 * result + emptyBytes.contentHashCode() + result = 31 * result + someBytes.contentHashCode() + result = 31 * result + listOfByteArray.hashCode() + result = 31 * result + (nullUByte?.hashCode() ?: 0) + result = 31 * result + someUByte.hashCode() + result = 31 * result + minUByte.hashCode() + result = 31 * result + maxUByte.hashCode() + result = 31 * result + (nullByte ?: 0) + result = 31 * result + someByte + result = 31 * result + minByte + result = 31 * result + maxByte + return result + } + + override fun toString(): String { + return "SomeObject(" + + "nullBytes=${nullBytes?.contentToString()}, " + + "emptyBytes=${emptyBytes.contentToString()}, " + + "someByte=${someBytes.contentToString()}, " + + "listOfByteArray=${listOfByteArray.joinToString(",", "[", "]") { it.encodeHex() }}, " + + "nullUByte=$nullUByte, " + + "someUByte=$someUByte, " + + "minUByte=$minUByte, " + + "maxUByte=$maxUByte, " + + "nullByte=$nullByte, " + + "someByte=$someByte, " + + "minByte=$minByte, " + + "maxByte=$maxByte" + + ")" + } + } + + companion object { + fun contentEquals(list1: List, list2: List): Boolean { + if (list1.size != list2.size) return false + + return list1.zip(list2).all { (arr1, arr2) -> arr1.contentEquals(arr2) } + } + } +} diff --git a/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/InstantISO8601SerDeTest.kt b/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/InstantISO8601SerDeTest.kt new file mode 100644 index 000000000..21e5d732a --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/InstantISO8601SerDeTest.kt @@ -0,0 +1,65 @@ +package build.linea.s11n.jackson + +import com.fasterxml.jackson.databind.ObjectMapper +import kotlinx.datetime.Instant +import net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test + +class InstantISO8601SerDeTest { + private lateinit var objectMapper: ObjectMapper + + @BeforeEach + fun setUp() { + objectMapper = ethApiObjectMapper + } + + @Test + fun instantSerialization() { + data class SomeObject( + // Int + val instantNull: Instant? = null, + val instantUTC: Instant = Instant.parse("2021-01-02T09:00:45Z"), + val instantUTCPlus: Instant = Instant.parse("2021-01-02T09:00:45+01:30"), + val instantUTCMinus: Instant = Instant.parse("2021-01-02T09:00:45-01:30") + ) + + val json = objectMapper.writeValueAsString(SomeObject()) + assertThatJson(json).isEqualTo( + """ + { + "instantNull": null, + "instantUTC": "2021-01-02T09:00:45Z", + "instantUTCPlus": "2021-01-02T07:30:45Z", + "instantUTCMinus": "2021-01-02T10:30:45Z" + } + """.trimIndent() + ) + } + + @Test + fun instantSerDeDeSerialization() { + data class SomeObject( + // Int + val instantNull: Instant? = null, + val instantUTC: Instant = Instant.parse("2021-01-02T09:00:45Z"), + val instantUTCPlus: Instant = Instant.parse("2021-01-02T09:00:45+01:30"), + val instantUTCMinus: Instant = Instant.parse("2021-01-02T09:00:45-01:30") + ) + + val expectedJson = """ + { + "instantNull": null, + "instantUTC": "2021-01-02T09:00:45Z", + "instantUTCPlus": "2021-01-02T07:30:45Z", + "instantUTCMinus": "2021-01-02T10:30:45Z" + } + """.trimIndent() + + // assert serialization + assertThatJson(objectMapper.writeValueAsString(SomeObject())).isEqualTo(expectedJson) + + // assert deserialization + assertThatJson(objectMapper.readValue(expectedJson, SomeObject::class.java)).isEqualTo(SomeObject()) + } +} diff --git a/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/NumbersSerDeTest.kt b/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/NumbersSerDeTest.kt new file mode 100644 index 000000000..bba6e82dd --- /dev/null +++ b/jvm-libs/generic/serialization/jackson/src/test/kotlin/build/linea/s11n/jackson/NumbersSerDeTest.kt @@ -0,0 +1,80 @@ +package build.linea.s11n.jackson + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.databind.ObjectMapper +import net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test +import java.math.BigInteger + +class NumbersSerDeTest { + private lateinit var objectMapper: ObjectMapper + + @BeforeEach + fun setUp() { + objectMapper = ethApiObjectMapper + } + + @Test + fun numbersSerialization() { + data class SomeObject( + // Int + val intNull: Int? = null, + val intZero: Int = 0, + val intMaxValue: Int = Int.MAX_VALUE, + val intSomeValue: Int = 0xff00aa, + + // Long + val longNull: Long? = null, + val longZero: Long = 0, + val longMaxValue: Long = Long.MAX_VALUE, + val longSomeValue: Long = 0xff00aa, + + // ULong + // jackson has a bug and serializes any cAmelCase as camelCase, need to set it with @JsonProperty + // it's only on 1st character, so we can't use uLongNull, uLongZero, without annotation etc. + @get:JsonProperty("uLongNull") val uLongNull: ULong? = null, + @get:JsonProperty("uLongZero") val uLongZero: ULong = 0uL, + @get:JsonProperty("uLongMaxValue") val uLongMaxValue: ULong = ULong.MAX_VALUE, + @get:JsonProperty("uLongSomeValue") val uLongSomeValue: ULong = 0xff00aa.toULong(), + + // BigInteger + val bigIntegerNull: BigInteger? = null, + val bigIntegerZero: BigInteger = BigInteger.ZERO, + val bigIntegerSomeValue: BigInteger = BigInteger.valueOf(0xff00aaL), + + // nested Structures + val listOfInts: List = listOf(1, 10), + val listOfLongs: List = listOf(1, 10), + val listOfULongs: List = listOf(1UL, 10UL), + val listOfBigIntegers: List = listOf(1L, 10L).map(BigInteger::valueOf) + ) + + val json = objectMapper.writeValueAsString(SomeObject()) + assertThatJson(json).isEqualTo( + """ + { + "intNull": null, + "intZero": "0x0", + "intMaxValue": "0x7fffffff", + "intSomeValue": "0xff00aa", + "longNull": null, + "longZero": "0x0", + "longMaxValue": "0x7fffffffffffffff", + "longSomeValue": "0xff00aa", + "uLongNull": null, + "uLongZero": "0x0", + "uLongMaxValue": "0xffffffffffffffff", + "uLongSomeValue": "0xff00aa", + "bigIntegerNull": null, + "bigIntegerZero": "0x0", + "bigIntegerSomeValue": "0xff00aa", + "listOfInts": ["0x1", "0xa"], + "listOfLongs": ["0x1", "0xa"], + "listOfULongs": ["0x1", "0xa"], + "listOfBigIntegers": ["0x1", "0xa"] + } + """.trimIndent() + ) + } +} diff --git a/settings.gradle b/settings.gradle index 674fb5b9b..73082e51f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -21,6 +21,7 @@ include 'jvm-libs:metrics:micrometer' include 'jvm-libs:teku-execution-client' include 'jvm-libs:testing:l1-blob-and-proof-submission' include 'jvm-libs:testing:file-system' +include 'jvm-libs:generic:serialization:jackson' include 'coordinator:app' include 'coordinator:core' include 'coordinator:utilities'