This reverts commit 3296c13ef2
.
This commit is contained in:
@@ -36,8 +36,9 @@ pub fn get_inflation(operating_mode: OperatingMode, epoch: Epoch) -> Option<Infl
|
||||
OperatingMode::Stable => match epoch {
|
||||
// No inflation at epoch 0
|
||||
0 => Some(Inflation::new_disabled()),
|
||||
// Inflation starts The epoch of Epoch::MAX is a placeholder and is
|
||||
// expected to be reduced in a future hard fork.
|
||||
// Inflation starts
|
||||
// The epoch of Epoch::MAX is a placeholder and is expected to be reduced in
|
||||
// a future hard fork.
|
||||
Epoch::MAX => Some(Inflation::default()),
|
||||
_ => None,
|
||||
},
|
||||
@@ -48,36 +49,38 @@ pub fn get_programs(operating_mode: OperatingMode, epoch: Epoch) -> Option<Vec<(
|
||||
match operating_mode {
|
||||
OperatingMode::Development => {
|
||||
if epoch == 0 {
|
||||
// Programs used for testing
|
||||
Some(vec![
|
||||
// Enable all Stable programs
|
||||
solana_bpf_loader_program!(),
|
||||
solana_bpf_loader_deprecated_program!(),
|
||||
solana_vest_program!(),
|
||||
// Programs that are only available in Development mode
|
||||
solana_budget_program!(),
|
||||
solana_exchange_program!(),
|
||||
])
|
||||
} else if epoch == std::u64::MAX {
|
||||
// The epoch of std::u64::MAX is a placeholder and is expected
|
||||
// to be reduced in a future network update.
|
||||
Some(vec![solana_bpf_loader_program!()])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
OperatingMode::Stable => {
|
||||
if epoch == std::u64::MAX {
|
||||
// The epoch of std::u64::MAX is a placeholder and is expected
|
||||
// to be reduced in a future network update.
|
||||
Some(vec![solana_bpf_loader_program!(), solana_vest_program!()])
|
||||
if epoch == std::u64::MAX - 1 {
|
||||
// The epoch of std::u64::MAX - 1 is a placeholder and is expected to be reduced in
|
||||
// a future hard fork.
|
||||
Some(vec![solana_bpf_loader_program!()])
|
||||
} else if epoch == std::u64::MAX {
|
||||
// The epoch of std::u64::MAX is a placeholder and is expected to be reduced in a
|
||||
// future hard fork.
|
||||
Some(vec![solana_vest_program!()])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
OperatingMode::Preview => {
|
||||
if epoch == std::u64::MAX {
|
||||
// The epoch of std::u64::MAX is a placeholder and is expected
|
||||
// to be reduced in a future network update.
|
||||
Some(vec![solana_bpf_loader_program!(), solana_vest_program!()])
|
||||
if epoch == 0 {
|
||||
Some(vec![solana_bpf_loader_program!()])
|
||||
} else if epoch == std::u64::MAX {
|
||||
// The epoch of std::u64::MAX is a placeholder and is expected to be reduced in a
|
||||
// future hard fork.
|
||||
Some(vec![solana_vest_program!()])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@@ -135,7 +138,7 @@ mod tests {
|
||||
fn test_development_programs() {
|
||||
assert_eq!(
|
||||
get_programs(OperatingMode::Development, 0).unwrap().len(),
|
||||
5
|
||||
4
|
||||
);
|
||||
assert_eq!(get_programs(OperatingMode::Development, 1), None);
|
||||
}
|
||||
@@ -156,6 +159,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_softlaunch_programs() {
|
||||
assert_eq!(get_programs(OperatingMode::Stable, 1), None);
|
||||
assert!(get_programs(OperatingMode::Stable, std::u64::MAX - 1).is_some());
|
||||
assert!(get_programs(OperatingMode::Stable, std::u64::MAX).is_some());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user