Skip to content

Commit 1fc9f93

Browse files
committed
sysvar: Deprecate stake-history and functions
#### Problem The stake-history module in solana-sysvar will be removed with #264, but there hasn't been a deprecation warning. #### Summary of changes Put in a deprecation warning.
1 parent b59af07 commit 1fc9f93

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sysvar/src/stake_history.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
4949
#[cfg(feature = "bincode")]
5050
use crate::Sysvar;
51+
#[deprecated(
52+
since = "2.3.0",
53+
note = "Use solana_sdk_ids::sysvar::stake_history instead"
54+
)]
5155
pub use solana_sdk_ids::sysvar::stake_history::{check_id, id, ID};
5256
#[deprecated(
5357
since = "2.2.0",
@@ -68,12 +72,17 @@ impl Sysvar for StakeHistory {
6872
}
6973

7074
// we do not provide Default because this requires the real current epoch
75+
#[deprecated(
76+
since = "2.3.0",
77+
note = "Use solana_stake_interface::sysvar::stake_history::StakeHistorySysvar in v2 instead"
78+
)]
7179
#[derive(Debug, PartialEq, Eq, Clone)]
7280
pub struct StakeHistorySysvar(pub Epoch);
7381

7482
// precompute so we can statically allocate buffer
7583
const EPOCH_AND_ENTRY_SERIALIZED_SIZE: u64 = 32;
7684

85+
#[allow(deprecated)]
7786
impl StakeHistoryGetEntry for StakeHistorySysvar {
7887
fn get_entry(&self, target_epoch: Epoch) -> Option<StakeHistoryEntry> {
7988
let current_epoch = self.0;
@@ -127,6 +136,7 @@ impl StakeHistoryGetEntry for StakeHistorySysvar {
127136
}
128137

129138
#[cfg(test)]
139+
#[allow(deprecated)]
130140
mod tests {
131141
use {super::*, crate::tests::mock_get_sysvar_syscall, serial_test::serial};
132142

0 commit comments

Comments
 (0)