Skip to content

Commit

Permalink
Add backwards compatibility support to get_highest_snapshot_slot() (s…
Browse files Browse the repository at this point in the history
…olana-labs#19591)

Co-authored-by: Michael Vines <[email protected]>
  • Loading branch information
2 people authored and dankelleher committed Nov 24, 2021
1 parent f89efad commit 5cab791
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,15 @@ impl RpcClient {
/// # Ok::<(), ClientError>(())
/// ```
pub fn get_highest_snapshot_slot(&self) -> ClientResult<RpcSnapshotSlotInfo> {
self.send(RpcRequest::GetHighestSnapshotSlot, Value::Null)
if self.get_node_version()? < semver::Version::new(1, 8, 0) {
#[allow(deprecated)]
self.get_snapshot_slot().map(|full| RpcSnapshotSlotInfo {
full,
incremental: None,
})
} else {
self.send(RpcRequest::GetHighestSnapshotSlot, Value::Null)
}
}

#[deprecated(
Expand Down

0 comments on commit 5cab791

Please sign in to comment.