Deprecate `MINIMUM_STAKE_DELEGATION` (#24329)

This commit is contained in:
Brooks Prumo 2022-04-14 11:59:18 -05:00 committed by GitHub
parent d20b4c9958
commit 2456a7be35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -23,5 +23,6 @@ pub(crate) fn get_minimum_delegation(_feature_set: &FeatureSet) -> u64 {
// If/when the minimum delegation amount is changed, the `feature_set` parameter will be used
// to chose the correct value. And since the MINIMUM_STAKE_DELEGATION constant cannot be
// removed, use it here as to not duplicate magic constants.
#[allow(deprecated)]
solana_sdk::stake::MINIMUM_STAKE_DELEGATION
}

View File

@ -0,0 +1,5 @@
#[deprecated(
since = "1.11.0",
note = "please use `solana_program::stake::tools::get_minimum_delegation()` instead"
)]
pub const MINIMUM_STAKE_DELEGATION: u64 = 1;

View File

@ -3,14 +3,13 @@ pub mod instruction;
pub mod state;
pub mod tools;
mod deprecated;
pub use deprecated::*;
pub mod program {
crate::declare_id!("Stake11111111111111111111111111111111111111");
}
// NOTE: This constant will be deprecated soon; if possible, use
// `solana_stake_program::get_minimum_delegation()` instead.
pub const MINIMUM_STAKE_DELEGATION: u64 = 1;
/// The minimum number of epochs before stake account that is delegated to a delinquent vote
/// account may be unstaked with `StakeInstruction::DeactivateDelinquent`
pub const MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION: usize = 5;