From 8cb6bcc1ca7b1c43544b065e8509f4b6202ce655 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 13 Jul 2023 14:00:48 +0300 Subject: [PATCH 1/2] rpc: use compat mode in latest_block_results() Just like with the block_results method, the response needs to be parsed varyingly with the RPC dialect. --- rpc/src/client/transport/http.rs | 4 ++++ rpc/src/client/transport/websocket.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/rpc/src/client/transport/http.rs b/rpc/src/client/transport/http.rs index 2c89d4163..ceaa427cd 100644 --- a/rpc/src/client/transport/http.rs +++ b/rpc/src/client/transport/http.rs @@ -181,6 +181,10 @@ impl Client for HttpClient { perform_with_compat!(self, endpoint::block_results::Request::new(height.into())) } + async fn latest_block_results(&self) -> Result { + perform_with_compat!(self, endpoint::block_results::Request::default()) + } + async fn header(&self, height: H) -> Result where H: Into + Send, diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index ebc270f06..01ec8950d 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -244,6 +244,10 @@ impl Client for WebSocketClient { perform_with_compat!(self, endpoint::block_results::Request::new(height.into())) } + async fn latest_block_results(&self) -> Result { + perform_with_compat!(self, endpoint::block_results::Request::default()) + } + async fn header(&self, height: H) -> Result where H: Into + Send, From ac8496173770332838efe36b62a4a9d4d5780024 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 13 Jul 2023 14:08:30 +0300 Subject: [PATCH 2/2] Changelog entry for #1326 --- .../bug-fixes/1326-compat-for-latest_block_results.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/unreleased/bug-fixes/1326-compat-for-latest_block_results.md diff --git a/.changelog/unreleased/bug-fixes/1326-compat-for-latest_block_results.md b/.changelog/unreleased/bug-fixes/1326-compat-for-latest_block_results.md new file mode 100644 index 000000000..804ba45b8 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/1326-compat-for-latest_block_results.md @@ -0,0 +1,3 @@ +- [tendermint-rpc]` Use compatibility mode in implementations + of the `Client::latest_block_results` method + ([\#1326](https://github.com/informalsystems/tendermint-rs/pull/1326))