Skip to content

Commit

Permalink
tendermint: allow null in EventAttribute kv JSON
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mzabaluev committed Nov 9, 2023
1 parent 707d283 commit 627c047
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tendermint/src/abci/event.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};

use crate::prelude::*;
use crate::serializers;

/// An event that occurred while processing a request.
///
Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit 627c047

Please sign in to comment.