From bf25c92b308b5eb074947b44e72310e153804aec Mon Sep 17 00:00:00 2001 From: Oleksandr Pravdyvyi Date: Tue, 28 Oct 2025 10:41:40 +0200 Subject: [PATCH] fix: suggestions fix --- Cargo.toml | 2 +- integration_tests/Cargo.toml | 2 +- .../proc_macro_test_attribute}/Cargo.toml | 0 .../proc_macro_test_attribute}/src/lib.rs | 2 +- integration_tests/src/test_suite_map.rs | 44 +++++++++---------- 5 files changed, 25 insertions(+), 25 deletions(-) rename {proc_macro_test_attribute => integration_tests/proc_macro_test_attribute}/Cargo.toml (100%) rename {proc_macro_test_attribute => integration_tests/proc_macro_test_attribute}/src/lib.rs (93%) diff --git a/Cargo.toml b/Cargo.toml index 6866046..e340ffb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ members = [ "sequencer_core", "common", "nssa", - "proc_macro_test_attribute", + "integration_tests/proc_macro_test_attribute", ] [workspace.dependencies] diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 979c523..c10869a 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -17,7 +17,7 @@ borsh.workspace = true nssa-core = { path = "../nssa/core", features = ["host"] } -proc_macro_test_attribute = { path = "../proc_macro_test_attribute" } +proc_macro_test_attribute = { path = "./proc_macro_test_attribute" } [dependencies.clap] features = ["derive", "env"] diff --git a/proc_macro_test_attribute/Cargo.toml b/integration_tests/proc_macro_test_attribute/Cargo.toml similarity index 100% rename from proc_macro_test_attribute/Cargo.toml rename to integration_tests/proc_macro_test_attribute/Cargo.toml diff --git a/proc_macro_test_attribute/src/lib.rs b/integration_tests/proc_macro_test_attribute/src/lib.rs similarity index 93% rename from proc_macro_test_attribute/src/lib.rs rename to integration_tests/proc_macro_test_attribute/src/lib.rs index 59d2d0c..29852a0 100644 --- a/proc_macro_test_attribute/src/lib.rs +++ b/integration_tests/proc_macro_test_attribute/src/lib.rs @@ -3,7 +3,7 @@ extern crate proc_macro; use proc_macro::*; #[proc_macro_attribute] -pub fn test_suite_fn(_attr: TokenStream, item: TokenStream) -> TokenStream { +pub fn nssa_integration_test(_attr: TokenStream, item: TokenStream) -> TokenStream { let input = item.to_string(); let fn_keyword = "fn "; diff --git a/integration_tests/src/test_suite_map.rs b/integration_tests/src/test_suite_map.rs index 99a1371..65b2095 100644 --- a/integration_tests/src/test_suite_map.rs +++ b/integration_tests/src/test_suite_map.rs @@ -37,7 +37,7 @@ type TestFunction = fn(PathBuf) -> Pin>>; pub fn prepare_function_map() -> HashMap { let mut function_map: HashMap = HashMap::new(); - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success() { info!("test_success"); let command = Command::Transfer(NativeTokenTransferProgramSubcommand::Public { @@ -74,7 +74,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_move_to_another_account() { info!("test_success_move_to_another_account"); let command = Command::Account(AccountSubcommand::Register(RegisterSubcommand::Public {})); @@ -131,7 +131,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_failure() { info!("test_failure"); let command = Command::Transfer(NativeTokenTransferProgramSubcommand::Public { @@ -170,7 +170,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_two_transactions() { info!("test_success_two_transactions"); let command = Command::Transfer(NativeTokenTransferProgramSubcommand::Public { @@ -236,7 +236,7 @@ pub fn prepare_function_map() -> HashMap { info!("Second TX Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_get_account() { info!("test_get_account"); let wallet_config = fetch_config().await.unwrap(); @@ -259,7 +259,7 @@ pub fn prepare_function_map() -> HashMap { /// This test creates a new token using the token program. After creating the token, the test executes a /// token transfer to a new account. - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_token_program() { let wallet_config = fetch_config().await.unwrap(); @@ -409,7 +409,7 @@ pub fn prepare_function_map() -> HashMap { /// This test creates a new private token using the token program. After creating the token, the test executes a /// private token transfer to a new account. All accounts are owned except definition. - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_token_program_private_owned() { let wallet_config = fetch_config().await.unwrap(); @@ -557,7 +557,7 @@ pub fn prepare_function_map() -> HashMap { /// This test creates a new private token using the token program. After creating the token, the test executes a /// private token transfer to a new account. - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_token_program_private_claiming_path() { let wallet_config = fetch_config().await.unwrap(); @@ -693,7 +693,7 @@ pub fn prepare_function_map() -> HashMap { /// This test creates a new public token using the token program. After creating the token, the test executes a /// shielded token transfer to a new account. All accounts are owned except definition. - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_token_program_shielded_owned() { let wallet_config = fetch_config().await.unwrap(); @@ -820,7 +820,7 @@ pub fn prepare_function_map() -> HashMap { /// This test creates a new private token using the token program. After creating the token, the test executes a /// deshielded token transfer to a new account. All accounts are owned except definition. - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_token_program_deshielded_owned() { let wallet_config = fetch_config().await.unwrap(); @@ -956,7 +956,7 @@ pub fn prepare_function_map() -> HashMap { assert!(verify_commitment_is_in_state(new_commitment1, &seq_client).await); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_private_transfer_to_another_owned_account() { info!("test_success_private_transfer_to_another_owned_account"); let from: Address = ACC_SENDER_PRIVATE.parse().unwrap(); @@ -992,7 +992,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_private_transfer_to_another_foreign_account() { info!("test_success_private_transfer_to_another_foreign_account"); let from: Address = ACC_SENDER_PRIVATE.parse().unwrap(); @@ -1039,7 +1039,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_private_transfer_to_another_owned_account_claiming_path() { info!("test_success_private_transfer_to_another_owned_account_claiming_path"); let from: Address = ACC_SENDER_PRIVATE.parse().unwrap(); @@ -1108,7 +1108,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_private_transfer_to_another_owned_account_cont_run_path() { info!("test_success_private_transfer_to_another_owned_account_cont_run_path"); let continious_run_handle = tokio::spawn(wallet::execute_continious_run()); @@ -1179,7 +1179,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_deshielded_transfer_to_another_account() { info!("test_success_deshielded_transfer_to_another_account"); let from: Address = ACC_SENDER_PRIVATE.parse().unwrap(); @@ -1225,7 +1225,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_shielded_transfer_to_another_owned_account() { info!("test_success_shielded_transfer_to_another_owned_account"); let from: Address = ACC_SENDER.parse().unwrap(); @@ -1266,7 +1266,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_success_shielded_transfer_to_another_foreign_account() { info!("test_success_shielded_transfer_to_another_foreign_account"); let to_npk = NullifierPublicKey([42; 32]); @@ -1312,7 +1312,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_pinata() { info!("test_pinata"); let pinata_addr = "cafe".repeat(16); @@ -1360,7 +1360,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_program_deployment() { info!("test program deployment"); let bytecode = NSSA_PROGRAM_FOR_TEST_DATA_CHANGER.to_vec(); @@ -1407,7 +1407,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_authenticated_transfer_initialize_function() { info!("test initialize account for authenticated transfer"); let command = Command::AuthenticatedTransferInitializePublicAccount {}; @@ -1439,7 +1439,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_pinata_private_receiver() { info!("test_pinata_private_receiver"); let pinata_addr = "cafe".repeat(16); @@ -1503,7 +1503,7 @@ pub fn prepare_function_map() -> HashMap { info!("Success!"); } - #[test_suite_fn] + #[nssa_integration_test] pub async fn test_pinata_private_receiver_new_account() { info!("test_pinata_private_receiver"); let pinata_addr = "cafe".repeat(16);