Skip to content

Commit 2a72be0

Browse files
committed
refactor: rename CTOKEN_PROGRAM_ID -> COMPRESSED_TOKEN_PROGRAM_ID
1 parent c86c3ec commit 2a72be0

51 files changed

Lines changed: 131 additions & 210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

forester-utils/src/instructions/claim.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use light_ctoken_interface::COMPRESSED_TOKEN_PROGRAM_ID;
1+
use light_ctoken_interface::CTOKEN_PROGRAM_ID;
22
use solana_instruction::{AccountMeta, Instruction};
33
use solana_pubkey::Pubkey;
44

@@ -13,7 +13,7 @@ use solana_pubkey::Pubkey;
1313
pub fn derive_pool_pda(compression_authority: &Pubkey) -> (Pubkey, u8) {
1414
Pubkey::find_program_address(
1515
&[b"pool", compression_authority.as_ref()],
16-
&Pubkey::from(COMPRESSED_TOKEN_PROGRAM_ID),
16+
&Pubkey::from(CTOKEN_PROGRAM_ID),
1717
)
1818
}
1919

@@ -49,7 +49,7 @@ pub fn claim(
4949
}
5050

5151
Instruction {
52-
program_id: Pubkey::from(COMPRESSED_TOKEN_PROGRAM_ID),
52+
program_id: Pubkey::from(CTOKEN_PROGRAM_ID),
5353
accounts,
5454
data: instruction_data,
5555
}

forester-utils/src/instructions/withdraw_funding_pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use light_ctoken_interface::COMPRESSED_TOKEN_PROGRAM_ID;
1+
use light_ctoken_interface::CTOKEN_PROGRAM_ID;
22
use solana_instruction::{AccountMeta, Instruction};
33
use solana_pubkey::Pubkey;
44

@@ -37,7 +37,7 @@ pub fn withdraw_funding_pool(
3737
];
3838

3939
Instruction {
40-
program_id: Pubkey::from(COMPRESSED_TOKEN_PROGRAM_ID),
40+
program_id: Pubkey::from(CTOKEN_PROGRAM_ID),
4141
accounts,
4242
data: instruction_data,
4343
}

forester/src/compressible/bootstrap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use base64::{engine::general_purpose, Engine as _};
44
use borsh::BorshDeserialize;
55
use light_ctoken_interface::{
66
state::{extensions::ExtensionStruct, CToken},
7-
COMPRESSED_TOKEN_PROGRAM_ID, COMPRESSIBLE_TOKEN_ACCOUNT_SIZE,
7+
COMPRESSIBLE_TOKEN_ACCOUNT_SIZE, CTOKEN_PROGRAM_ID,
88
};
99
use serde_json::json;
1010
use solana_sdk::pubkey::Pubkey;
@@ -191,7 +191,7 @@ async fn bootstrap_with_v2_api(
191191
mut shutdown_rx: oneshot::Receiver<()>,
192192
) -> Result<()> {
193193
let client = reqwest::Client::new();
194-
let program_id = Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID);
194+
let program_id = Pubkey::new_from_array(CTOKEN_PROGRAM_ID);
195195

196196
let mut total_fetched = 0;
197197
let mut total_inserted = 0;
@@ -314,7 +314,7 @@ async fn bootstrap_with_standard_api(
314314
mut shutdown_rx: oneshot::Receiver<()>,
315315
) -> Result<()> {
316316
let client = reqwest::Client::new();
317-
let program_id = Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID);
317+
let program_id = Pubkey::new_from_array(CTOKEN_PROGRAM_ID);
318318

319319
let payload = json!({
320320
"jsonrpc": "2.0",

forester/src/compressible/compressor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use anchor_lang::{InstructionData, ToAccountMetas};
44
use forester_utils::rpc_pool::SolanaRpcPool;
55
use light_client::rpc::Rpc;
66
use light_compressible::config::CompressibleConfig;
7-
use light_ctoken_interface::COMPRESSED_TOKEN_PROGRAM_ID;
7+
use light_ctoken_interface::CTOKEN_PROGRAM_ID;
88
use light_ctoken_sdk::compressed_token::compress_and_close::CompressAndCloseAccounts as CTokenAccounts;
99
use light_registry::{
1010
accounts::CompressAndCloseContext, compressible::compressed_token::CompressAndCloseIndices,
@@ -60,7 +60,7 @@ impl<R: Rpc> Compressor<R> {
6060
registered_forester_pda: Pubkey,
6161
) -> Result<Signature> {
6262
let registry_program_id = Pubkey::from_str(REGISTRY_PROGRAM_ID_STR)?;
63-
let compressed_token_program_id = Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID);
63+
let compressed_token_program_id = Pubkey::new_from_array(CTOKEN_PROGRAM_ID);
6464

6565
// Derive compression_authority PDA deterministically (version = 1)
6666
let compression_authority_seeds = CompressibleConfig::get_compression_authority_seeds(1);

forester/src/compressible/subscriber.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{str::FromStr, sync::Arc};
22

33
use futures::StreamExt;
4-
use light_ctoken_interface::{COMPRESSED_TOKEN_PROGRAM_ID, COMPRESSIBLE_TOKEN_ACCOUNT_SIZE};
4+
use light_ctoken_interface::{COMPRESSIBLE_TOKEN_ACCOUNT_SIZE, CTOKEN_PROGRAM_ID};
55
use solana_account_decoder::UiAccountEncoding;
66
use solana_client::{
77
nonblocking::pubsub_client::PubsubClient,
@@ -44,7 +44,7 @@ impl AccountSubscriber {
4444
.await
4545
.map_err(|e| anyhow::anyhow!("Failed to connect to WebSocket: {}", e))?;
4646

47-
let program_id = Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID);
47+
let program_id = Pubkey::new_from_array(CTOKEN_PROGRAM_ID);
4848

4949
// Subscribe to compressed token program accounts with filter for compressible account size
5050
let (mut subscription, unsubscribe) = pubsub_client

program-libs/ctoken-interface/src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use light_macros::pubkey_array;
33
use crate::state::CompressionInfo;
44

55
pub const CPI_AUTHORITY: [u8; 32] = pubkey_array!("GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy");
6-
pub const COMPRESSED_TOKEN_PROGRAM_ID: [u8; 32] =
6+
pub const CTOKEN_PROGRAM_ID: [u8; 32] =
77
pubkey_array!("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");
88

99
/// Account size constants

program-tests/compressed-token-test/tests/mint/cpi_context.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use light_ctoken_interface::{
88
MintActionCompressedInstructionData,
99
},
1010
state::CompressedMintMetadata,
11-
CMINT_ADDRESS_TREE, COMPRESSED_TOKEN_PROGRAM_ID,
11+
CMINT_ADDRESS_TREE, CTOKEN_PROGRAM_ID,
1212
};
1313
use light_ctoken_sdk::compressed_token::{
1414
create_compressed_mint::{derive_cmint_compressed_address, find_cmint_address},
@@ -158,7 +158,7 @@ async fn test_write_to_cpi_context_create_mint() {
158158

159159
// Build compressed token instruction
160160
let ctoken_instruction = Instruction {
161-
program_id: Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
161+
program_id: Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
162162
accounts: account_metas,
163163
data: data.clone(),
164164
};
@@ -170,7 +170,7 @@ async fn test_write_to_cpi_context_create_mint() {
170170
let wrapper_instruction = Instruction {
171171
program_id: WRAPPER_PROGRAM_ID,
172172
accounts: vec![AccountMeta::new_readonly(
173-
Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
173+
Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
174174
false,
175175
)]
176176
.into_iter()
@@ -279,7 +279,7 @@ async fn test_write_to_cpi_context_invalid_address_tree() {
279279

280280
// Build compressed token instruction
281281
let ctoken_instruction = Instruction {
282-
program_id: Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
282+
program_id: Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
283283
accounts: account_metas,
284284
data: data.clone(),
285285
};
@@ -291,7 +291,7 @@ async fn test_write_to_cpi_context_invalid_address_tree() {
291291
let wrapper_instruction = Instruction {
292292
program_id: WRAPPER_PROGRAM_ID,
293293
accounts: vec![AccountMeta::new_readonly(
294-
Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
294+
Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
295295
false,
296296
)]
297297
.into_iter()
@@ -371,7 +371,7 @@ async fn test_write_to_cpi_context_invalid_compressed_address() {
371371

372372
// Build compressed token instruction
373373
let ctoken_instruction = Instruction {
374-
program_id: Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
374+
program_id: Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
375375
accounts: account_metas,
376376
data: data.clone(),
377377
};
@@ -383,7 +383,7 @@ async fn test_write_to_cpi_context_invalid_compressed_address() {
383383
let wrapper_instruction = Instruction {
384384
program_id: WRAPPER_PROGRAM_ID,
385385
accounts: vec![AccountMeta::new_readonly(
386-
Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
386+
Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
387387
false,
388388
)]
389389
.into_iter()
@@ -466,7 +466,7 @@ async fn test_execute_cpi_context_invalid_tree_index() {
466466

467467
// Build compressed token instruction
468468
let execute_instruction = Instruction {
469-
program_id: Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
469+
program_id: Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
470470
accounts: account_metas,
471471
data: data.clone(),
472472
};
@@ -478,7 +478,7 @@ async fn test_execute_cpi_context_invalid_tree_index() {
478478
let execute_wrapper_instruction = Instruction {
479479
program_id: WRAPPER_PROGRAM_ID,
480480
accounts: vec![AccountMeta::new_readonly(
481-
Pubkey::new_from_array(COMPRESSED_TOKEN_PROGRAM_ID),
481+
Pubkey::new_from_array(CTOKEN_PROGRAM_ID),
482482
false,
483483
)]
484484
.into_iter()

program-tests/compressed-token-test/tests/mint/failing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ async fn test_mint_to_ctoken_max_top_up_exceeded() {
816816
CompressedMintWithContext, MintActionCompressedInstructionData, MintToCTokenAction,
817817
},
818818
state::TokenDataVersion,
819-
COMPRESSED_TOKEN_PROGRAM_ID,
819+
CTOKEN_PROGRAM_ID,
820820
};
821821
use light_ctoken_sdk::compressed_token::{
822822
create_compressed_mint::derive_cmint_compressed_address, mint_action::MintActionMetaConfig,
@@ -942,7 +942,7 @@ async fn test_mint_to_ctoken_max_top_up_exceeded() {
942942

943943
// Build final instruction
944944
let ix = Instruction {
945-
program_id: COMPRESSED_TOKEN_PROGRAM_ID.into(),
945+
program_id: CTOKEN_PROGRAM_ID.into(),
946946
accounts: account_metas,
947947
data,
948948
};

program-tests/compressed-token-test/tests/mint/functional.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ async fn test_update_compressed_mint_authority() {
636636
// Note: We need to get fresh account info after the updates
637637
let updated_compressed_accounts = rpc
638638
.get_compressed_accounts_by_owner(
639-
&Pubkey::new_from_array(light_ctoken_interface::COMPRESSED_TOKEN_PROGRAM_ID),
639+
&Pubkey::new_from_array(light_ctoken_interface::CTOKEN_PROGRAM_ID),
640640
None,
641641
None,
642642
)

program-tests/compressed-token-test/tests/transfer2/no_system_program_cpi_failing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ fn build_compressions_only_instruction(
271271
data.extend(serialized);
272272

273273
Ok(solana_sdk::instruction::Instruction {
274-
program_id: light_ctoken_interface::COMPRESSED_TOKEN_PROGRAM_ID.into(),
274+
program_id: light_ctoken_interface::CTOKEN_PROGRAM_ID.into(),
275275
accounts: account_metas,
276276
data,
277277
})

0 commit comments

Comments
 (0)