Skip to content

Commit

Permalink
feat(its)!: added events file and move all logic to versioned (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos authored Oct 10, 2024
1 parent b13218e commit 62ea830
Show file tree
Hide file tree
Showing 7 changed files with 1,260 additions and 1,113 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-bugs-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axelar-network/axelar-cgp-sui': minor
---

Added events file and move all logic to versioned.
6 changes: 4 additions & 2 deletions move/its/sources/discovery.move
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ fun test_discovery_initial() {
register_transaction(&mut its, &mut discovery);

let value = its.package_value();
assert!(discovery.get_transaction(value.channel_id()) == initial_tx(&its));
assert!(
discovery.get_transaction(object::id_from_address(value.channel_address())) == initial_tx(&its),
);
assert!(value.relayer_discovery_id() == object::id(&discovery));

sui::test_utils::destroy(its);
Expand Down Expand Up @@ -283,7 +285,7 @@ fun test_discovery_interchain_transfer_with_data() {
register_transaction(&mut its, &mut discovery);

assert!(
discovery.get_transaction(its.package_value().channel_id()) == initial_tx(&its),
discovery.get_transaction(object::id_from_address(its.package_value().channel_address())) == initial_tx(&its),
);

let token_id = @0x1234;
Expand Down
20 changes: 20 additions & 0 deletions move/its/sources/events.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module its::events;

use its::token_id::TokenId;
use sui::event;

// -----
// Types
// -----
public struct CoinRegistered<phantom T> has copy, drop {
token_id: TokenId,
}

// -----------------
// Package Functions
// -----------------
public(package) fun coin_registered<T>(token_id: TokenId) {
event::emit(CoinRegistered<T> {
token_id,
});
}
Loading

0 comments on commit 62ea830

Please sign in to comment.