Skip to content

Commit

Permalink
rpc: use compat mode in latest_block_results() (#1326)
Browse files Browse the repository at this point in the history
Just like with the block_results method, the response needs to be
parsed varyingly with the RPC dialect.
  • Loading branch information
mzabaluev committed Jul 17, 2023
1 parent 91ff1e4 commit 1da1c99
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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))
4 changes: 4 additions & 0 deletions rpc/src/client/transport/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<endpoint::block_results::Response, Error> {
perform_with_compat!(self, endpoint::block_results::Request::default())
}

async fn header<H>(&self, height: H) -> Result<endpoint::header::Response, Error>
where
H: Into<Height> + Send,
Expand Down
4 changes: 4 additions & 0 deletions rpc/src/client/transport/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<endpoint::block_results::Response, Error> {
perform_with_compat!(self, endpoint::block_results::Request::default())
}

async fn header<H>(&self, height: H) -> Result<endpoint::header::Response, Error>
where
H: Into<Height> + Send,
Expand Down

0 comments on commit 1da1c99

Please sign in to comment.