diff --git a/.changelog/unreleased/breaking-changes/1375-allow-null-in-event-attributes.md b/.changelog/unreleased/breaking-changes/1375-allow-null-in-event-attributes.md new file mode 100644 index 000000000..089e4c6c7 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/1375-allow-null-in-event-attributes.md @@ -0,0 +1,4 @@ +- `[tendermint]` Allow null values in `key` and `value` fields of + `EventAttribute` when deserializing. The serialization schema for the fields + is changed to `Option` + ([\#1375](https://github.com/informalsystems/tendermint-rs/issues/1375)). 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. ///