diff --git a/rpc-client/src/rpc_client.rs b/rpc-client/src/rpc_client.rs index 3e60381a413725..afccd7af003290 100644 --- a/rpc-client/src/rpc_client.rs +++ b/rpc-client/src/rpc_client.rs @@ -4029,15 +4029,22 @@ impl RpcClient { } pub fn get_feature_activation_slot(&self, feature_id: &Pubkey) -> ClientResult> { - self.get_account(feature_id) - .and_then(|feature_account| { - bincode::deserialize(feature_account.data()).map_err(|_| { - ClientError::from(ErrorKind::Custom( - "Failed to deserialize feature account".to_string(), - )) - }) + self.get_account_with_commitment(feature_id, self.commitment()) + .and_then(|maybe_feature_account| { + maybe_feature_account + .value + .map(|feature_account| { + bincode::deserialize(feature_account.data()).map_err(|_| { + ClientError::from(ErrorKind::Custom( + "Failed to deserialize feature account".to_string(), + )) + }) + }) + .transpose() + }) + .map(|maybe_feature: Option| { + maybe_feature.and_then(|feature| feature.activated_at) }) - .map(|feature: Feature| feature.activated_at) } fn invoke>>(&self, f: F) -> ClientResult {