From 8f716bc9e424864cbcf22a3d04f6bdc58a390af1 Mon Sep 17 00:00:00 2001 From: Foivos Date: Wed, 20 Nov 2024 15:52:50 +0200 Subject: [PATCH] check for events --- move/axelar_gateway/sources/channel.move | 7 ++++++- move/axelar_gateway/sources/gateway.move | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/move/axelar_gateway/sources/channel.move b/move/axelar_gateway/sources/channel.move index 133a576d..3ccacf09 100644 --- a/move/axelar_gateway/sources/channel.move +++ b/move/axelar_gateway/sources/channel.move @@ -126,6 +126,9 @@ public(package) fun create_approved_message( // --------- // Test Only // --------- +#[test_only] +use utils::utils; + #[test_only] public fun new_approved_message( source_chain: String, @@ -196,7 +199,9 @@ public(package) fun approved_message_payload( fun test_new_and_destroy() { let ctx = &mut sui::tx_context::dummy(); let channel: Channel = new(ctx); - channel.destroy() + utils::single_event(); + channel.destroy(); + utils::single_event(); } #[test] diff --git a/move/axelar_gateway/sources/gateway.move b/move/axelar_gateway/sources/gateway.move index 2a123aba..9f414747 100644 --- a/move/axelar_gateway/sources/gateway.move +++ b/move/axelar_gateway/sources/gateway.move @@ -285,6 +285,8 @@ fun version_control(): VersionControl { use sui::bcs; #[test_only] use axelar_gateway::auth::generate_proof; +#[test_only] +use axelar_gateway::events; #[test_only] public fun create_for_testing( @@ -600,6 +602,9 @@ fun test_take_approved_message() { destination_id, payload, ); + + utils::single_event(); + let expected_approved_message = axelar_gateway::channel::create_approved_message( source_chain, message_id, @@ -661,6 +666,8 @@ fun test_approve_messages() { self.approve_messages(bcs::to_bytes(&messages), bcs::to_bytes(&proof)); + utils::single_event(); + clock.destroy_for_testing(); sui::test_utils::destroy(self) } @@ -761,6 +768,8 @@ fun test_rotate_signers() { ctx, ); + utils::single_event(); + let data_hash = gateway_v0::rotate_signers_data_hash(next_weighted_signers); let proof = generate_proof( data_hash, @@ -777,6 +786,8 @@ fun test_rotate_signers() { ctx, ); + utils::multiple_events(2); + clock.destroy_for_testing(); sui::test_utils::destroy(self); } @@ -1041,6 +1052,9 @@ fun test_send_message() { let gateway = dummy(ctx); gateway.send_message(message_ticket); + + utils::single_event(); + sui::test_utils::destroy(gateway); channel.destroy(); }