From b77670a99a9075d46218b08b36af35eb753c348d Mon Sep 17 00:00:00 2001 From: Foivos Date: Wed, 20 Nov 2024 16:39:29 +0200 Subject: [PATCH] some renaming --- move/its/sources/events.move | 4 ++-- move/its/sources/its.move | 14 +++++++------- move/utils/sources/utils/utils.move | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/move/its/sources/events.move b/move/its/sources/events.move index 10f56cdf..c66a22b8 100644 --- a/move/its/sources/events.move +++ b/move/its/sources/events.move @@ -202,7 +202,7 @@ fun test_interchain_transfer_empty_data() { amount, &data, ); - let event = utils::single_event>(); + let event = utils::assert_single_event>(); assert!(event.data_hash == data_hash); assert!(event.source_address == source_address); @@ -230,7 +230,7 @@ fun test_interchain_transfer_nonempty_data() { amount, &data, ); - let event = utils::single_event>(); + let event = utils::assert_single_event>(); assert!(event.data_hash == data_hash); assert!(event.source_address == source_address); diff --git a/move/its/sources/its.move b/move/its/sources/its.move index ce92d55f..96fd7cb9 100644 --- a/move/its/sources/its.move +++ b/move/its/sources/its.move @@ -435,7 +435,7 @@ fun test_register_coin() { let coin_management = its::coin_management::new_locked(); register_coin(&mut its, coin_info, coin_management); - utils::single_event>(); + utils::assert_single_event>(); sui::test_utils::destroy(its); } @@ -463,7 +463,7 @@ fun test_deploy_remote_interchain_token() { destination_chain, ); - utils::single_event>(); + utils::assert_single_event>(); let mut writer = abi::new_writer(6); @@ -503,7 +503,7 @@ fun test_deploy_interchain_token() { let token_id = register_coin(&mut its, coin_info, coin_management); - utils::single_event>(); + utils::assert_single_event>(); let amount = 1234; let coin = sui::coin::mint_for_testing(amount, ctx); @@ -527,7 +527,7 @@ fun test_deploy_interchain_token() { &clock, ); - utils::single_event>(); + utils::assert_single_event>(); let mut writer = abi::new_writer(6); @@ -599,7 +599,7 @@ fun test_receive_interchain_transfer() { receive_interchain_transfer(&mut its, approved_message, &clock, ctx); - utils::single_event>(); + utils::assert_single_event>(); clock.destroy_for_testing(); sui::test_utils::destroy(its); @@ -661,7 +661,7 @@ fun test_receive_interchain_transfer_with_data() { ctx, ); - utils::single_event>(); + utils::assert_single_event>(); assert!(received_source_chain == source_chain); assert!(received_source_address == its_source_address); @@ -710,7 +710,7 @@ fun test_receive_deploy_interchain_token() { receive_deploy_interchain_token(&mut its, approved_message); - utils::single_event>(); + utils::assert_single_event>(); clock.destroy_for_testing(); sui::test_utils::destroy(its); diff --git a/move/utils/sources/utils/utils.move b/move/utils/sources/utils/utils.move index 979468f1..206fe24f 100644 --- a/move/utils/sources/utils/utils.move +++ b/move/utils/sources/utils/utils.move @@ -33,15 +33,15 @@ public macro fun peel<$T>($data: vector, $peel_fn: |&mut BCS| -> $T): $T { use sui::event; #[test_only] -public fun multiple_events(n: u64): vector { +public fun assert_events(n: u64): vector { let events = event::events_by_type(); assert!(events.length() == n); events } #[test_only] -public fun single_event(): T { - let events = multiple_events(1); +public fun assert_single_event(): T { + let events = assert_events(1); events[0] }