Add backwards compatibility support to get_highest_snapshot_slot() (#19591)
Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
parent
3936c10aa0
commit
38e1f7c4ba
|
@ -1041,8 +1041,16 @@ impl RpcClient {
|
||||||
/// # Ok::<(), ClientError>(())
|
/// # Ok::<(), ClientError>(())
|
||||||
/// ```
|
/// ```
|
||||||
pub fn get_highest_snapshot_slot(&self) -> ClientResult<RpcSnapshotSlotInfo> {
|
pub fn get_highest_snapshot_slot(&self) -> ClientResult<RpcSnapshotSlotInfo> {
|
||||||
|
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)
|
self.send(RpcRequest::GetHighestSnapshotSlot, Value::Null)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[deprecated(
|
#[deprecated(
|
||||||
since = "1.8.0",
|
since = "1.8.0",
|
||||||
|
|
Loading…
Reference in New Issue