informalsystems / tendermint-rs

Client libraries for Tendermint/CometBFT in Rust!
Apache License 2.0
615 stars 224 forks source link

rpc: Allow empty JSON object value for `consensus_param_updates` in `/block_results` response #1441

Closed ljoss17 closed 4 months ago

ljoss17 commented 4 months ago

Closes: #1440

This PR adds a custom deserializer for the consensus_param_updates field in the /block_results response to deserialize both null and an empty JSON object to None.

E.g. both of these will successfully deserialize to None:

romac commented 4 months ago

Thanks! Can we also fix this while we are at it? https://github.com/informalsystems/tendermint-rs/blob/ed576f2f479e58fd269a2725c5b4730bc2a1776d/tendermint/src/consensus/params.rs#L19-L20

ljoss17 commented 4 months ago

Thanks! Can we also fix this while we are at it?

https://github.com/informalsystems/tendermint-rs/blob/ed576f2f479e58fd269a2725c5b4730bc2a1776d/tendermint/src/consensus/params.rs#L19-L20

Oh I missed that sorry. I'll fix it