|
1 | 1 | #![cfg(feature = "test-sbf")]
|
2 | 2 |
|
3 |
| -use anchor_compressible_user_derived::{CompressedAccountVariant, GameSession, UserRecord}; |
| 3 | +use anchor_compressible_derived::{CompressedAccountVariant, GameSession, UserRecord}; |
4 | 4 | use anchor_lang::{
|
5 | 5 | AccountDeserialize, AnchorDeserialize, Discriminator, InstructionData, ToAccountMetas,
|
6 | 6 | };
|
@@ -30,10 +30,10 @@ pub const RENT_RECIPIENT: Pubkey = pubkey!("CLEuMG7pzJX9xAuKCFzBP154uiG1GaNo4Fq7
|
30 | 30 |
|
31 | 31 | #[tokio::test]
|
32 | 32 | 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; |
34 | 34 | let config = ProgramTestConfig::new_v2(
|
35 | 35 | true,
|
36 |
| - Some(vec![("anchor_compressible_user_derived", program_id)]), |
| 36 | + Some(vec![("anchor_compressible_derived", program_id)]), |
37 | 37 | );
|
38 | 38 | let mut rpc = LightProgramTest::new(config).await.unwrap();
|
39 | 39 | let payer = rpc.get_payer().insecure_clone();
|
@@ -106,10 +106,10 @@ async fn test_create_and_decompress_two_accounts() {
|
106 | 106 |
|
107 | 107 | #[tokio::test]
|
108 | 108 | 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; |
110 | 110 | let config = ProgramTestConfig::new_v2(
|
111 | 111 | true,
|
112 |
| - Some(vec![("anchor_compressible_user_derived", program_id)]), |
| 112 | + Some(vec![("anchor_compressible_derived", program_id)]), |
113 | 113 | );
|
114 | 114 | let mut rpc = LightProgramTest::new(config).await.unwrap();
|
115 | 115 | let payer = rpc.get_payer().insecure_clone();
|
@@ -183,7 +183,7 @@ async fn test_create_record(
|
183 | 183 | let address_tree_pubkey = rpc.get_address_merkle_tree_v2();
|
184 | 184 |
|
185 | 185 | // Create the instruction
|
186 |
| - let accounts = anchor_compressible_user_derived::accounts::CreateRecord { |
| 186 | + let accounts = anchor_compressible_derived::accounts::CreateRecord { |
187 | 187 | user: payer.pubkey(),
|
188 | 188 | user_record: *user_record_pda,
|
189 | 189 | system_program: solana_sdk::system_program::ID,
|
@@ -227,7 +227,7 @@ async fn test_create_record(
|
227 | 227 | let (system_accounts, _, _) = remaining_accounts.to_account_metas();
|
228 | 228 |
|
229 | 229 | // Create instruction data
|
230 |
| - let instruction_data = anchor_compressible_user_derived::instruction::CreateRecord { |
| 230 | + let instruction_data = anchor_compressible_derived::instruction::CreateRecord { |
231 | 231 | name: "Test User".to_string(),
|
232 | 232 | proof: rpc_result.proof,
|
233 | 233 | compressed_address,
|
@@ -425,12 +425,12 @@ async fn test_decompress_multiple_pdas(
|
425 | 425 | let game_pda_data = game_pda_account.unwrap().data;
|
426 | 426 | assert_eq!(
|
427 | 427 | &game_pda_data[0..8],
|
428 |
| - anchor_compressible_user_derived::GameSession::DISCRIMINATOR, |
| 428 | + anchor_compressible_derived::GameSession::DISCRIMINATOR, |
429 | 429 | "Game account anchor discriminator mismatch"
|
430 | 430 | );
|
431 | 431 |
|
432 | 432 | 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[..]) |
434 | 434 | .unwrap();
|
435 | 435 | assert_eq!(decompressed_game_session.session_id, session_id);
|
436 | 436 | assert_eq!(decompressed_game_session.game_type, expected_game_type);
|
@@ -482,7 +482,7 @@ async fn test_create_user_record_and_game_session(
|
482 | 482 | let address_tree_pubkey = rpc.get_address_merkle_tree_v2();
|
483 | 483 |
|
484 | 484 | // Create the instruction
|
485 |
| - let accounts = anchor_compressible_user_derived::accounts::CreateRecordAndSession { |
| 485 | + let accounts = anchor_compressible_derived::accounts::CreateRecordAndSession { |
486 | 486 | user: user.pubkey(),
|
487 | 487 | user_record: *user_record_pda,
|
488 | 488 | game_session: *game_session_pda,
|
@@ -540,13 +540,13 @@ async fn test_create_user_record_and_game_session(
|
540 | 540 | let (system_accounts, _, _) = remaining_accounts.to_account_metas();
|
541 | 541 |
|
542 | 542 | // 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 { |
545 | 545 | user_name: "Combined User".to_string(),
|
546 | 546 | session_id,
|
547 | 547 | game_type: "Combined Game".to_string(),
|
548 | 548 | },
|
549 |
| - compression_params: anchor_compressible_user_derived::CompressionParams { |
| 549 | + compression_params: anchor_compressible_derived::CompressionParams { |
550 | 550 | proof: rpc_result.proof,
|
551 | 551 | user_compressed_address,
|
552 | 552 | user_address_tree_info,
|
@@ -702,7 +702,7 @@ async fn test_compress_record(
|
702 | 702 |
|
703 | 703 | let instruction = CompressibleInstruction::compress_account(
|
704 | 704 | program_id,
|
705 |
| - anchor_compressible_user_derived::instruction::CompressUserRecord::DISCRIMINATOR, |
| 705 | + anchor_compressible_derived::instruction::CompressUserRecord::DISCRIMINATOR, |
706 | 706 | &payer.pubkey(),
|
707 | 707 | user_record_pda,
|
708 | 708 | &RENT_RECIPIENT, // rent_recipient
|
@@ -877,10 +877,10 @@ async fn test_decompress_single_user_record(
|
877 | 877 |
|
878 | 878 | #[tokio::test]
|
879 | 879 | async fn test_double_decompression_attack() {
|
880 |
| - let program_id = anchor_compressible_user_derived::ID; |
| 880 | + let program_id = anchor_compressible_derived::ID; |
881 | 881 | let config = ProgramTestConfig::new_v2(
|
882 | 882 | true,
|
883 |
| - Some(vec![("anchor_compressible_user_derived", program_id)]), |
| 883 | + Some(vec![("anchor_compressible_derived", program_id)]), |
884 | 884 | );
|
885 | 885 | let mut rpc = LightProgramTest::new(config).await.unwrap();
|
886 | 886 | let payer = rpc.get_payer().insecure_clone();
|
@@ -1005,10 +1005,10 @@ async fn test_double_decompression_attack() {
|
1005 | 1005 |
|
1006 | 1006 | #[tokio::test]
|
1007 | 1007 | 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; |
1009 | 1009 | let config = ProgramTestConfig::new_v2(
|
1010 | 1010 | true,
|
1011 |
| - Some(vec![("anchor_compressible_user_derived", program_id)]), |
| 1011 | + Some(vec![("anchor_compressible_derived", program_id)]), |
1012 | 1012 | );
|
1013 | 1013 | let mut rpc = LightProgramTest::new(config).await.unwrap();
|
1014 | 1014 | let payer = rpc.get_payer().insecure_clone();
|
@@ -1073,10 +1073,10 @@ async fn test_create_and_decompress_accounts_with_different_state_trees() {
|
1073 | 1073 |
|
1074 | 1074 | #[tokio::test]
|
1075 | 1075 | async fn test_update_record_compression_info() {
|
1076 |
| - let program_id = anchor_compressible_user_derived::ID; |
| 1076 | + let program_id = anchor_compressible_derived::ID; |
1077 | 1077 | let config = ProgramTestConfig::new_v2(
|
1078 | 1078 | true,
|
1079 |
| - Some(vec![("anchor_compressible_user_derived", program_id)]), |
| 1079 | + Some(vec![("anchor_compressible_derived", program_id)]), |
1080 | 1080 | );
|
1081 | 1081 | let mut rpc = LightProgramTest::new(config).await.unwrap();
|
1082 | 1082 | let payer = rpc.get_payer().insecure_clone();
|
@@ -1119,12 +1119,12 @@ async fn test_update_record_compression_info() {
|
1119 | 1119 | rpc.warp_to_slot(150).unwrap();
|
1120 | 1120 |
|
1121 | 1121 | // Create update instruction
|
1122 |
| - let accounts = anchor_compressible_user_derived::accounts::UpdateRecord { |
| 1122 | + let accounts = anchor_compressible_derived::accounts::UpdateRecord { |
1123 | 1123 | user: payer.pubkey(),
|
1124 | 1124 | user_record: user_record_pda,
|
1125 | 1125 | };
|
1126 | 1126 |
|
1127 |
| - let instruction_data = anchor_compressible_user_derived::instruction::UpdateRecord { |
| 1127 | + let instruction_data = anchor_compressible_derived::instruction::UpdateRecord { |
1128 | 1128 | name: "Updated User".to_string(),
|
1129 | 1129 | score: 42,
|
1130 | 1130 | };
|
|
0 commit comments