Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
token: Add features for new program releases (#24742)
Browse files Browse the repository at this point in the history
* token: Add features for new program releases

* Add PR number
  • Loading branch information
joncinque authored Apr 28, 2022
1 parent 4e58b38 commit b4503d4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
12 changes: 6 additions & 6 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6828,20 +6828,20 @@ impl Bank {
self.rent_collector.rent.burn_percent = 50; // 50% rent burn
}

if new_feature_activations.contains(&feature_set::spl_token_v3_3_0_release::id()) {
if new_feature_activations.contains(&feature_set::spl_token_v3_4_0::id()) {
self.replace_program_account(
&inline_spl_token::id(),
&inline_spl_token::new_token_program::id(),
"bank-apply_spl_token_v3_3_0_release",
&inline_spl_token::program_v3_4_0::id(),
"bank-apply_spl_token_v3_4_0",
);
}

if new_feature_activations.contains(&feature_set::spl_associated_token_account_v1_0_4::id())
if new_feature_activations.contains(&feature_set::spl_associated_token_account_v1_1_0::id())
{
self.replace_program_account(
&inline_spl_associated_token_account::id(),
&inline_spl_associated_token_account::program_v1_0_4::id(),
"bank-apply_spl_associated_token_account_v1_4_0",
&inline_spl_associated_token_account::program_v1_1_0::id(),
"bank-apply_spl_associated_token_account_v1_1_0",
);
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/inline_spl_associated_token_account.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Partial SPL Associated Token Account declarations inlined to avoid an external dependency on the spl-associated-token-account crate
solana_sdk::declare_id!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");

pub(crate) mod program_v1_0_4 {
solana_sdk::declare_id!("nata4apBRD9S9256v3X8RxDQ7jmK7wLEsGNHhRNWFq3");
pub(crate) mod program_v1_1_0 {
solana_sdk::declare_id!("NatA1Zyo48dJ7yuwR7cGURwhskKA8ywUyxb9GvG7mTC");
}
4 changes: 2 additions & 2 deletions runtime/src/inline_spl_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use solana_sdk::pubkey::{Pubkey, PUBKEY_BYTES};

solana_sdk::declare_id!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");

pub(crate) mod new_token_program {
solana_sdk::declare_id!("nTok2oJvx1CgbYA2SznfJLmnKLEL6sYdh2ypZms2nhm");
pub(crate) mod program_v3_4_0 {
solana_sdk::declare_id!("NToK4t5AQzxPNpUA84DkxgfXaVDbDQQjpHKCqsbY46B");
}

/*
Expand Down
10 changes: 10 additions & 0 deletions sdk/src/feature_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,14 @@ pub mod update_rewards_from_cached_accounts {
solana_sdk::declare_id!("28s7i3htzhahXQKqmS2ExzbEoUypg9krwvtK2M9UWXh9");
}

pub mod spl_token_v3_4_0 {
solana_sdk::declare_id!("Ftok4njE8b7tDffYkC5bAbCaQv5sL6jispYrprzatUwN");
}

pub mod spl_associated_token_account_v1_1_0 {
solana_sdk::declare_id!("FaTa17gVKoqbh38HcfiQonPsAaQViyDCCSg71AubYZw8");
}

lazy_static! {
/// Map of feature identifiers to user-visible description
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
Expand Down Expand Up @@ -453,6 +461,8 @@ lazy_static! {
(executables_incur_cpi_data_cost::id(), "Executables incure CPI data costs"),
(fix_recent_blockhashes::id(), "stop adding hashes for skipped slots to recent blockhashes"),
(update_rewards_from_cached_accounts::id(), "update rewards from cached accounts"),
(spl_token_v3_4_0::id(), "SPL Token Program version 3.4.0 release #24740"),
(spl_associated_token_account_v1_1_0::id(), "SPL Associated Token Account Program version 1.1.0 release #24741"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down

0 comments on commit b4503d4

Please sign in to comment.