Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Add backwards compatibility support to get_highest_snapshot_slot() #19591

Merged
merged 3 commits into from
Sep 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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