Skip to content

Commit 34eeee3

Browse files
rename sdk-tests program names
1 parent 31eb154 commit 34eeee3

File tree

12 files changed

+112
-112
lines changed

12 files changed

+112
-112
lines changed

.github/workflows/sdk-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
cargo-test-sbf -p sdk-test
8484
8585
echo "Building and testing anchor-compressible..."
86-
cargo-test-sbf -p anchor-compressible-user
86+
cargo-test-sbf -p anchor-compressible
8787
8888
echo "Building and testing anchor-compressible-derived..."
89-
cargo-test-sbf -p anchor-compressible-user-derived
89+
cargo-test-sbf -p anchor-compressible-derived

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk-libs/macros/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- Uses `HasCompressionInfo` trait instead of deprecated `CompressionTiming`
1414
- `compress_*` instructions validate against config rent recipient
1515
- `decompress_multiple_pdas` now accepts seeds in `CompressedAccountData`
16-
- All generated instructions follow the pattern used in `anchor-compressible-user`
16+
- All generated instructions follow the pattern used in `anchor-compressible`
1717
- Automatically uses Anchor's `INIT_SPACE` for account size calculation (no manual SIZE needed)
1818

1919
### Added

sdk-tests/anchor-compressible-derived/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "anchor-compressible-user-derived"
2+
name = "anchor-compressible-derived"
33
version = "0.1.0"
44
description = "Anchor program template with user records and derived accounts"
55
edition = "2021"
66

77
[lib]
88
crate-type = ["cdylib", "lib"]
9-
name = "anchor_compressible_user_derived"
9+
name = "anchor_compressible_derived"
1010

1111
[features]
1212
no-entrypoint = []

sdk-tests/anchor-compressible-derived/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub const LIGHT_CPI_SIGNER: CpiSigner =
1818

1919
#[add_compressible_instructions(UserRecord, GameSession)]
2020
#[program]
21-
pub mod anchor_compressible_user_derived {
21+
pub mod anchor_compressible_derived {
2222

2323
use super::*;
2424
/// Creates a new compressed user record using global config.
@@ -195,7 +195,7 @@ pub mod anchor_compressible_user_derived {
195195
// Re-export the generated types for client access Explicitly re-export only the
196196
// macro-generated types you need to expose. This avoids any name clash with the
197197
// module itself.
198-
pub use crate::anchor_compressible_user_derived::{
198+
pub use crate::anchor_compressible_derived::{
199199
CompressedAccountData, CompressedAccountVariant,
200200
};
201201

sdk-tests/anchor-compressible-derived/tests/test_decompress_multiple.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![cfg(feature = "test-sbf")]
22

3-
use anchor_compressible_user_derived::{CompressedAccountVariant, GameSession, UserRecord};
3+
use anchor_compressible_derived::{CompressedAccountVariant, GameSession, UserRecord};
44
use anchor_lang::{
55
AccountDeserialize, AnchorDeserialize, Discriminator, InstructionData, ToAccountMetas,
66
};
@@ -30,10 +30,10 @@ pub const RENT_RECIPIENT: Pubkey = pubkey!("CLEuMG7pzJX9xAuKCFzBP154uiG1GaNo4Fq7
3030

3131
#[tokio::test]
3232
async fn test_create_and_decompress_two_accounts() {
33-
let program_id = anchor_compressible_user_derived::ID;
33+
let program_id = anchor_compressible_derived::ID;
3434
let config = ProgramTestConfig::new_v2(
3535
true,
36-
Some(vec![("anchor_compressible_user_derived", program_id)]),
36+
Some(vec![("anchor_compressible_derived", program_id)]),
3737
);
3838
let mut rpc = LightProgramTest::new(config).await.unwrap();
3939
let payer = rpc.get_payer().insecure_clone();
@@ -107,10 +107,10 @@ async fn test_create_and_decompress_two_accounts() {
107107

108108
#[tokio::test]
109109
async fn test_create_decompress_compress_single_account() {
110-
let program_id = anchor_compressible_user_derived::ID;
110+
let program_id = anchor_compressible_derived::ID;
111111
let config = ProgramTestConfig::new_v2(
112112
true,
113-
Some(vec![("anchor_compressible_user_derived", program_id)]),
113+
Some(vec![("anchor_compressible_derived", program_id)]),
114114
);
115115
let mut rpc = LightProgramTest::new(config).await.unwrap();
116116
let payer = rpc.get_payer().insecure_clone();
@@ -185,7 +185,7 @@ async fn test_create_record(
185185
let address_tree_pubkey = rpc.get_address_merkle_tree_v2();
186186

187187
// Create the instruction
188-
let accounts = anchor_compressible_user_derived::accounts::CreateRecord {
188+
let accounts = anchor_compressible_derived::accounts::CreateRecord {
189189
user: payer.pubkey(),
190190
user_record: *user_record_pda,
191191
system_program: solana_sdk::system_program::ID,
@@ -229,7 +229,7 @@ async fn test_create_record(
229229
let (system_accounts, _, _) = remaining_accounts.to_account_metas();
230230

231231
// Create instruction data
232-
let instruction_data = anchor_compressible_user_derived::instruction::CreateRecord {
232+
let instruction_data = anchor_compressible_derived::instruction::CreateRecord {
233233
name: "Test User".to_string(),
234234
proof: rpc_result.proof,
235235
compressed_address,
@@ -424,12 +424,12 @@ async fn test_decompress_multiple_pdas(
424424
let game_pda_data = game_pda_account.unwrap().data;
425425
assert_eq!(
426426
&game_pda_data[0..8],
427-
anchor_compressible_user_derived::GameSession::DISCRIMINATOR,
427+
anchor_compressible_derived::GameSession::DISCRIMINATOR,
428428
"Game account anchor discriminator mismatch"
429429
);
430430

431431
let decompressed_game_session =
432-
anchor_compressible_user_derived::GameSession::try_deserialize(&mut &game_pda_data[..])
432+
anchor_compressible_derived::GameSession::try_deserialize(&mut &game_pda_data[..])
433433
.unwrap();
434434
assert_eq!(decompressed_game_session.session_id, session_id);
435435
assert_eq!(decompressed_game_session.game_type, expected_game_type);
@@ -478,7 +478,7 @@ async fn test_create_user_record_and_game_session(
478478
let address_tree_pubkey = rpc.get_address_merkle_tree_v2();
479479

480480
// Create the instruction
481-
let accounts = anchor_compressible_user_derived::accounts::CreateRecordAndSession {
481+
let accounts = anchor_compressible_derived::accounts::CreateRecordAndSession {
482482
user: user.pubkey(),
483483
user_record: *user_record_pda,
484484
game_session: *game_session_pda,
@@ -536,13 +536,13 @@ async fn test_create_user_record_and_game_session(
536536
let (system_accounts, _, _) = remaining_accounts.to_account_metas();
537537

538538
// Create instruction data
539-
let instruction_data = anchor_compressible_user_derived::instruction::CreateRecordAndSession {
540-
account_data: anchor_compressible_user_derived::AccountCreationData {
539+
let instruction_data = anchor_compressible_derived::instruction::CreateRecordAndSession {
540+
account_data: anchor_compressible_derived::AccountCreationData {
541541
user_name: "Combined User".to_string(),
542542
session_id,
543543
game_type: "Combined Game".to_string(),
544544
},
545-
compression_params: anchor_compressible_user_derived::CompressionParams {
545+
compression_params: anchor_compressible_derived::CompressionParams {
546546
proof: rpc_result.proof,
547547
user_compressed_address,
548548
user_address_tree_info,
@@ -698,7 +698,7 @@ async fn test_compress_record(
698698

699699
let instruction = CompressibleInstruction::compress_account(
700700
program_id,
701-
anchor_compressible_user_derived::instruction::CompressUserRecord::DISCRIMINATOR,
701+
anchor_compressible_derived::instruction::CompressUserRecord::DISCRIMINATOR,
702702
&payer.pubkey(),
703703
user_record_pda,
704704
&RENT_RECIPIENT, // rent_recipient
@@ -866,10 +866,10 @@ async fn test_decompress_single_user_record(
866866

867867
#[tokio::test]
868868
async fn test_double_decompression_attack() {
869-
let program_id = anchor_compressible_user_derived::ID;
869+
let program_id = anchor_compressible_derived::ID;
870870
let config = ProgramTestConfig::new_v2(
871871
true,
872-
Some(vec![("anchor_compressible_user_derived", program_id)]),
872+
Some(vec![("anchor_compressible_derived", program_id)]),
873873
);
874874
let mut rpc = LightProgramTest::new(config).await.unwrap();
875875
let payer = rpc.get_payer().insecure_clone();
@@ -992,10 +992,10 @@ async fn test_double_decompression_attack() {
992992

993993
#[tokio::test]
994994
async fn test_create_and_decompress_accounts_with_different_state_trees() {
995-
let program_id = anchor_compressible_user_derived::ID;
995+
let program_id = anchor_compressible_derived::ID;
996996
let config = ProgramTestConfig::new_v2(
997997
true,
998-
Some(vec![("anchor_compressible_user_derived", program_id)]),
998+
Some(vec![("anchor_compressible_derived", program_id)]),
999999
);
10001000
let mut rpc = LightProgramTest::new(config).await.unwrap();
10011001
let payer = rpc.get_payer().insecure_clone();
@@ -1061,10 +1061,10 @@ async fn test_create_and_decompress_accounts_with_different_state_trees() {
10611061

10621062
#[tokio::test]
10631063
async fn test_update_record_compression_info() {
1064-
let program_id = anchor_compressible_user_derived::ID;
1064+
let program_id = anchor_compressible_derived::ID;
10651065
let config = ProgramTestConfig::new_v2(
10661066
true,
1067-
Some(vec![("anchor_compressible_user_derived", program_id)]),
1067+
Some(vec![("anchor_compressible_derived", program_id)]),
10681068
);
10691069
let mut rpc = LightProgramTest::new(config).await.unwrap();
10701070
let payer = rpc.get_payer().insecure_clone();
@@ -1108,12 +1108,12 @@ async fn test_update_record_compression_info() {
11081108
rpc.warp_to_slot(150).unwrap();
11091109

11101110
// Create update instruction
1111-
let accounts = anchor_compressible_user_derived::accounts::UpdateRecord {
1111+
let accounts = anchor_compressible_derived::accounts::UpdateRecord {
11121112
user: payer.pubkey(),
11131113
user_record: user_record_pda,
11141114
};
11151115

1116-
let instruction_data = anchor_compressible_user_derived::instruction::UpdateRecord {
1116+
let instruction_data = anchor_compressible_derived::instruction::UpdateRecord {
11171117
name: "Updated User".to_string(),
11181118
score: 42,
11191119
};

sdk-tests/anchor-compressible-derived/tests/test_decompress_multiple.rs.bak

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![cfg(feature = "test-sbf")]
22

3-
use anchor_compressible_user_derived::{CompressedAccountVariant, GameSession, UserRecord};
3+
use anchor_compressible_derived::{CompressedAccountVariant, GameSession, UserRecord};
44
use anchor_lang::{
55
AccountDeserialize, AnchorDeserialize, Discriminator, InstructionData, ToAccountMetas,
66
};
@@ -30,10 +30,10 @@ pub const RENT_RECIPIENT: Pubkey = pubkey!("CLEuMG7pzJX9xAuKCFzBP154uiG1GaNo4Fq7
3030

3131
#[tokio::test]
3232
async fn test_create_and_decompress_two_accounts() {
33-
let program_id = anchor_compressible_user_derived::ID;
33+
let program_id = anchor_compressible_derived::ID;
3434
let config = ProgramTestConfig::new_v2(
3535
true,
36-
Some(vec![("anchor_compressible_user_derived", program_id)]),
36+
Some(vec![("anchor_compressible_derived", program_id)]),
3737
);
3838
let mut rpc = LightProgramTest::new(config).await.unwrap();
3939
let payer = rpc.get_payer().insecure_clone();
@@ -106,10 +106,10 @@ async fn test_create_and_decompress_two_accounts() {
106106

107107
#[tokio::test]
108108
async fn test_create_decompress_compress_single_account() {
109-
let program_id = anchor_compressible_user_derived::ID;
109+
let program_id = anchor_compressible_derived::ID;
110110
let config = ProgramTestConfig::new_v2(
111111
true,
112-
Some(vec![("anchor_compressible_user_derived", program_id)]),
112+
Some(vec![("anchor_compressible_derived", program_id)]),
113113
);
114114
let mut rpc = LightProgramTest::new(config).await.unwrap();
115115
let payer = rpc.get_payer().insecure_clone();
@@ -183,7 +183,7 @@ async fn test_create_record(
183183
let address_tree_pubkey = rpc.get_address_merkle_tree_v2();
184184

185185
// Create the instruction
186-
let accounts = anchor_compressible_user_derived::accounts::CreateRecord {
186+
let accounts = anchor_compressible_derived::accounts::CreateRecord {
187187
user: payer.pubkey(),
188188
user_record: *user_record_pda,
189189
system_program: solana_sdk::system_program::ID,
@@ -227,7 +227,7 @@ async fn test_create_record(
227227
let (system_accounts, _, _) = remaining_accounts.to_account_metas();
228228

229229
// Create instruction data
230-
let instruction_data = anchor_compressible_user_derived::instruction::CreateRecord {
230+
let instruction_data = anchor_compressible_derived::instruction::CreateRecord {
231231
name: "Test User".to_string(),
232232
proof: rpc_result.proof,
233233
compressed_address,
@@ -425,12 +425,12 @@ async fn test_decompress_multiple_pdas(
425425
let game_pda_data = game_pda_account.unwrap().data;
426426
assert_eq!(
427427
&game_pda_data[0..8],
428-
anchor_compressible_user_derived::GameSession::DISCRIMINATOR,
428+
anchor_compressible_derived::GameSession::DISCRIMINATOR,
429429
"Game account anchor discriminator mismatch"
430430
);
431431

432432
let decompressed_game_session =
433-
anchor_compressible_user_derived::GameSession::try_deserialize(&mut &game_pda_data[..])
433+
anchor_compressible_derived::GameSession::try_deserialize(&mut &game_pda_data[..])
434434
.unwrap();
435435
assert_eq!(decompressed_game_session.session_id, session_id);
436436
assert_eq!(decompressed_game_session.game_type, expected_game_type);
@@ -482,7 +482,7 @@ async fn test_create_user_record_and_game_session(
482482
let address_tree_pubkey = rpc.get_address_merkle_tree_v2();
483483

484484
// Create the instruction
485-
let accounts = anchor_compressible_user_derived::accounts::CreateRecordAndSession {
485+
let accounts = anchor_compressible_derived::accounts::CreateRecordAndSession {
486486
user: user.pubkey(),
487487
user_record: *user_record_pda,
488488
game_session: *game_session_pda,
@@ -540,13 +540,13 @@ async fn test_create_user_record_and_game_session(
540540
let (system_accounts, _, _) = remaining_accounts.to_account_metas();
541541

542542
// Create instruction data
543-
let instruction_data = anchor_compressible_user_derived::instruction::CreateRecordAndSession {
544-
account_data: anchor_compressible_user_derived::AccountCreationData {
543+
let instruction_data = anchor_compressible_derived::instruction::CreateRecordAndSession {
544+
account_data: anchor_compressible_derived::AccountCreationData {
545545
user_name: "Combined User".to_string(),
546546
session_id,
547547
game_type: "Combined Game".to_string(),
548548
},
549-
compression_params: anchor_compressible_user_derived::CompressionParams {
549+
compression_params: anchor_compressible_derived::CompressionParams {
550550
proof: rpc_result.proof,
551551
user_compressed_address,
552552
user_address_tree_info,
@@ -702,7 +702,7 @@ async fn test_compress_record(
702702

703703
let instruction = CompressibleInstruction::compress_account(
704704
program_id,
705-
anchor_compressible_user_derived::instruction::CompressUserRecord::DISCRIMINATOR,
705+
anchor_compressible_derived::instruction::CompressUserRecord::DISCRIMINATOR,
706706
&payer.pubkey(),
707707
user_record_pda,
708708
&RENT_RECIPIENT, // rent_recipient
@@ -877,10 +877,10 @@ async fn test_decompress_single_user_record(
877877

878878
#[tokio::test]
879879
async fn test_double_decompression_attack() {
880-
let program_id = anchor_compressible_user_derived::ID;
880+
let program_id = anchor_compressible_derived::ID;
881881
let config = ProgramTestConfig::new_v2(
882882
true,
883-
Some(vec![("anchor_compressible_user_derived", program_id)]),
883+
Some(vec![("anchor_compressible_derived", program_id)]),
884884
);
885885
let mut rpc = LightProgramTest::new(config).await.unwrap();
886886
let payer = rpc.get_payer().insecure_clone();
@@ -1005,10 +1005,10 @@ async fn test_double_decompression_attack() {
10051005

10061006
#[tokio::test]
10071007
async fn test_create_and_decompress_accounts_with_different_state_trees() {
1008-
let program_id = anchor_compressible_user_derived::ID;
1008+
let program_id = anchor_compressible_derived::ID;
10091009
let config = ProgramTestConfig::new_v2(
10101010
true,
1011-
Some(vec![("anchor_compressible_user_derived", program_id)]),
1011+
Some(vec![("anchor_compressible_derived", program_id)]),
10121012
);
10131013
let mut rpc = LightProgramTest::new(config).await.unwrap();
10141014
let payer = rpc.get_payer().insecure_clone();
@@ -1073,10 +1073,10 @@ async fn test_create_and_decompress_accounts_with_different_state_trees() {
10731073

10741074
#[tokio::test]
10751075
async fn test_update_record_compression_info() {
1076-
let program_id = anchor_compressible_user_derived::ID;
1076+
let program_id = anchor_compressible_derived::ID;
10771077
let config = ProgramTestConfig::new_v2(
10781078
true,
1079-
Some(vec![("anchor_compressible_user_derived", program_id)]),
1079+
Some(vec![("anchor_compressible_derived", program_id)]),
10801080
);
10811081
let mut rpc = LightProgramTest::new(config).await.unwrap();
10821082
let payer = rpc.get_payer().insecure_clone();
@@ -1119,12 +1119,12 @@ async fn test_update_record_compression_info() {
11191119
rpc.warp_to_slot(150).unwrap();
11201120

11211121
// Create update instruction
1122-
let accounts = anchor_compressible_user_derived::accounts::UpdateRecord {
1122+
let accounts = anchor_compressible_derived::accounts::UpdateRecord {
11231123
user: payer.pubkey(),
11241124
user_record: user_record_pda,
11251125
};
11261126

1127-
let instruction_data = anchor_compressible_user_derived::instruction::UpdateRecord {
1127+
let instruction_data = anchor_compressible_derived::instruction::UpdateRecord {
11281128
name: "Updated User".to_string(),
11291129
score: 42,
11301130
};

sdk-tests/anchor-compressible/CONFIG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Compressible Config in anchor-compressible-user
1+
# Compressible Config in anchor-compressible
22

33
This program demonstrates how to use the Light SDK's compressible config system to manage compression parameters globally.
44

0 commit comments

Comments
 (0)