From 7b52b56db6a7fabbe9d522e7c3875b51eac95497 Mon Sep 17 00:00:00 2001 From: "adam.khayam" Date: Tue, 19 Aug 2025 16:45:38 +0200 Subject: [PATCH 1/2] start test MR transfer --- test/data/transfer/block_numbers.json | 5 +++++ test/test_common/test_common.ml | 12 +++++++++++- .../test_generate_analyses_reference.ml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 test/data/transfer/block_numbers.json diff --git a/test/data/transfer/block_numbers.json b/test/data/transfer/block_numbers.json new file mode 100644 index 00000000..76ad6bbb --- /dev/null +++ b/test/data/transfer/block_numbers.json @@ -0,0 +1,5 @@ +[ + 21980512, 21980025, 21980035, 21980146, 21980680, 21980583, 21980165, + 21980837, 21980877, 21980875, 21981227, 21980219, 21980371, 21981253, + 21981136, 21981402, 21979733, 21979754, 21979970, 21979994, 21979996, 21980541 +] diff --git a/test/test_common/test_common.ml b/test/test_common/test_common.ml index 9a83e320..293decd6 100644 --- a/test/test_common/test_common.ml +++ b/test/test_common/test_common.ml @@ -46,7 +46,7 @@ module Test_types = struct | AT_Flashloan of tx_analysis_test [@wrap "value"] | AT_Liquidate of tx_analysis_test [@wrap "value"] | AT_Sandwich of sandwich_test blk_analysis_test [@wrap "value"] - | AT_Transfer + | AT_Transfer of tx_analysis_test [@wrap "value"] [@@deriving encoding { remove_prefix = "AT_"; camel; kind = "type"; union }, eq] @@ -72,6 +72,7 @@ module Test_tools = struct | "sandwich" -> Some `sandwich | "liquidate" -> Some `liquidate | "flashloan" -> Some `flashloan + | "transfer" -> Some `transfer | _ -> Common.Log.log_error_fail ~here:[%here] "Required analysis type" let sandwich_output_to_sandwich_test @@ -125,12 +126,21 @@ module Test_tools = struct bat_block_number = sandwich.bao_block_number; bat_resume = sandwich_output_to_sandwich_test sandwich.bao_resume; } +<<<<<<< HEAD | A_Transfer _ -> Log.log_warning_fail ~here:[%here] "Transfer analysis has still no tests designed for it." | A_Arbitrage _ -> Log.log_warning_fail ~here:[%here] "Arbitrage analysis has still no tests designed for it." +======= + | A_Transfer x -> + AT_Transfer + { + txat_block_number = x.txao_block_number; + txat_transaction_hash = x.txao_transaction_hash; + } +>>>>>>> 5e0e42b (start test MR transfer) let perform_analysis database analysis_type = match database with diff --git a/test/test_references_generators/test_generate_analyses_reference.ml b/test/test_references_generators/test_generate_analyses_reference.ml index eaf1e11a..8478b927 100644 --- a/test/test_references_generators/test_generate_analyses_reference.ml +++ b/test/test_references_generators/test_generate_analyses_reference.ml @@ -43,7 +43,7 @@ let init_generator (command : command) = analysis_type; result_json_path = command.result_json_path; } - | `sandwich -> + | `sandwich | `transfer -> let data_content = destruct_json command.data_json_path (Json_encoding.list Test_common.Test_types.block_debug_traces_enc) -- GitLab From 9dbddb8e735579f09eba201657c49fd44aa31b58 Mon Sep 17 00:00:00 2001 From: "adam.khayam" Date: Thu, 11 Sep 2025 13:53:41 +0200 Subject: [PATCH 2/2] rebase --- test/test_common/test_common.ml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/test_common/test_common.ml b/test/test_common/test_common.ml index 293decd6..d0bc8312 100644 --- a/test/test_common/test_common.ml +++ b/test/test_common/test_common.ml @@ -126,21 +126,12 @@ module Test_tools = struct bat_block_number = sandwich.bao_block_number; bat_resume = sandwich_output_to_sandwich_test sandwich.bao_resume; } -<<<<<<< HEAD | A_Transfer _ -> Log.log_warning_fail ~here:[%here] "Transfer analysis has still no tests designed for it." | A_Arbitrage _ -> Log.log_warning_fail ~here:[%here] "Arbitrage analysis has still no tests designed for it." -======= - | A_Transfer x -> - AT_Transfer - { - txat_block_number = x.txao_block_number; - txat_transaction_hash = x.txao_transaction_hash; - } ->>>>>>> 5e0e42b (start test MR transfer) let perform_analysis database analysis_type = match database with -- GitLab