From 37a600954ed78116fd7d1a4dce54c378210e0404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daria=20Dziuba=C5=82towska?= <44535712+daria305@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:41:04 +0100 Subject: [PATCH] Fix (e2e-test): Fix full_node_tests (#3798) * Fix (test): Remove depreciated InputObject and ChangedObject filters * fix(iota-e2e-tests): make test_full_node_event_read_api_ok assert stronger --------- Co-authored-by: miker83z Co-authored-by: Mirko Zichichi --- .../iota-e2e-tests/tests/full_node_tests.rs | 45 ++++--------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/crates/iota-e2e-tests/tests/full_node_tests.rs b/crates/iota-e2e-tests/tests/full_node_tests.rs index 899f314b5ad..a705d3b346b 100644 --- a/crates/iota-e2e-tests/tests/full_node_tests.rs +++ b/crates/iota-e2e-tests/tests/full_node_tests.rs @@ -271,32 +271,7 @@ async fn test_full_node_indexes() -> Result<(), anyhow::Error> { let node = &test_cluster.fullnode_handle.iota_node; let context = &mut test_cluster.wallet; - let (transferred_object, sender, receiver, digest, _) = transfer_coin(context).await?; - - let txes = node - .state() - .get_transactions_for_tests( - Some(TransactionFilter::InputObject(transferred_object)), - None, - None, - false, - ) - .await?; - - assert_eq!(txes.len(), 1); - assert_eq!(txes[0], digest); - - let txes = node - .state() - .get_transactions_for_tests( - Some(TransactionFilter::ChangedObject(transferred_object)), - None, - None, - false, - ) - .await?; - assert_eq!(txes.len(), 2); - assert_eq!(txes[1], digest); + let (_, sender, receiver, digest, _) = transfer_coin(context).await?; let txes = node .state() @@ -641,14 +616,14 @@ async fn test_full_node_event_read_api_ok() { let node = &test_cluster.fullnode_handle.iota_node; let jsonrpc_client = &test_cluster.fullnode_handle.rpc_client; - let (package_id, gas_id_1, _) = publish_nfts_package(context).await; + let (package_id, _, publish_digest) = publish_nfts_package(context).await; - let (transferred_object, _, _, digest, _) = transfer_coin(context).await.unwrap(); + let (_, sender, _, transfer_digest, _) = transfer_coin(context).await.unwrap(); let txes = node .state() .get_transactions_for_tests( - Some(TransactionFilter::InputObject(transferred_object)), + Some(TransactionFilter::FromAddress(sender)), None, None, false, @@ -656,13 +631,11 @@ async fn test_full_node_event_read_api_ok() { .await .unwrap(); - if gas_id_1 == transferred_object { - assert_eq!(txes.len(), 2); - assert!(txes[0] == digest || txes[1] == digest); - } else { - assert_eq!(txes.len(), 1); - assert_eq!(txes[0], digest); - } + assert_eq!(txes.len(), 2); + assert!( + (txes[0] == publish_digest && txes[1] == transfer_digest) + || (txes[0] == transfer_digest && txes[1] == publish_digest) + ); // This is a poor substitute for the post processing taking some time sleep(Duration::from_millis(1000)).await;