2021-05-19 07:31:47 -07:00
|
|
|
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
2021-02-16 13:48:20 -08:00
|
|
|
#![allow(clippy::integer_arithmetic)]
|
2021-06-15 09:04:00 -07:00
|
|
|
#[deprecated(
|
|
|
|
since = "1.8.0",
|
|
|
|
note = "Please use `solana_sdk::stake::program::id` or `solana_program::stake::program::id` instead"
|
|
|
|
)]
|
|
|
|
pub use solana_sdk::stake::program::{check_id, id};
|
2022-04-01 22:11:10 -07:00
|
|
|
use solana_sdk::{feature_set::FeatureSet, genesis_config::GenesisConfig};
|
2021-06-15 09:04:00 -07:00
|
|
|
|
2019-08-15 14:35:48 -07:00
|
|
|
pub mod config;
|
2019-04-01 16:45:53 -07:00
|
|
|
pub mod stake_instruction;
|
|
|
|
pub mod stake_state;
|
|
|
|
|
2019-11-25 15:11:55 -08:00
|
|
|
pub fn add_genesis_accounts(genesis_config: &mut GenesisConfig) -> u64 {
|
|
|
|
config::add_genesis_account(genesis_config)
|
2019-08-15 14:35:48 -07:00
|
|
|
}
|
2022-04-01 22:11:10 -07:00
|
|
|
|
|
|
|
/// The minimum stake amount that can be delegated, in lamports.
|
|
|
|
/// NOTE: This is also used to calculate the minimum balance of a stake account, which is the
|
|
|
|
/// rent exempt reserve _plus_ the minimum stake delegation.
|
|
|
|
#[inline(always)]
|
2022-04-25 15:35:05 -07:00
|
|
|
pub fn get_minimum_delegation(_feature_set: &FeatureSet) -> u64 {
|
2022-04-01 22:11:10 -07:00
|
|
|
// 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.
|
2022-04-14 09:59:18 -07:00
|
|
|
#[allow(deprecated)]
|
2022-04-01 22:11:10 -07:00
|
|
|
solana_sdk::stake::MINIMUM_STAKE_DELEGATION
|
|
|
|
}
|