From 627c04711cf3495881850ced022c067910a362ac Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 9 Nov 2023 12:17:19 +0200 Subject: [PATCH] tendermint: allow null in EventAttribute kv JSON When deserializing EventAttribute values, allow null values in the key and value fields. This follows the behaviour in 0.34 RPC (where the key-value data were also base64-encoded), but technically breaks the serde schema of everything that includes ABCI event data. --- tendermint/src/abci/event.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tendermint/src/abci/event.rs b/tendermint/src/abci/event.rs index 988145ad8..06e886421 100644 --- a/tendermint/src/abci/event.rs +++ b/tendermint/src/abci/event.rs @@ -1,6 +1,7 @@ use serde::{Deserialize, Serialize}; use crate::prelude::*; +use crate::serializers; /// An event that occurred while processing a request. /// @@ -119,8 +120,10 @@ where #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize, Hash)] pub struct EventAttribute { /// The event key. + #[serde(with = "serializers::allow_null")] pub key: String, /// The event value. + #[serde(with = "serializers::allow_null")] pub value: String, /// Whether Tendermint's indexer should index this event. ///