From 38e1f7c4bae17776468f1e7c1b821d384f9d1340 Mon Sep 17 00:00:00 2001 From: Brooks Prumo Date: Thu, 2 Sep 2021 20:47:35 -0500 Subject: [PATCH] Add backwards compatibility support to get_highest_snapshot_slot() (#19591) Co-authored-by: Michael Vines --- client/src/rpc_client.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index 112c49ab2c..98349fec88 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -1041,7 +1041,15 @@ impl RpcClient { /// # Ok::<(), ClientError>(()) /// ``` pub fn get_highest_snapshot_slot(&self) -> ClientResult { - 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(