Skip to content

Commit

Permalink
add allow and disallow functions back and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Dec 12, 2024
1 parent cfc6b27 commit fde9d16
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions move/axelar_gateway/sources/gateway.move
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ fun test_allow_function() {
let ctx = &mut sui::tx_context::dummy();
let mut self = dummy(ctx);
let owner_cap = owner_cap::create(ctx);
let version = 0;
let version = VERSION;
let function_name = b"function_name".to_ascii_string();

self.allow_function(&owner_cap, version, function_name);
Expand All @@ -1105,7 +1105,7 @@ fun test_disallow_function() {
let ctx = &mut sui::tx_context::dummy();
let mut self = dummy(ctx);
let owner_cap = owner_cap::create(ctx);
let version = 0;
let version = VERSION;
let function_name = b"approve_messages".to_ascii_string();

self.disallow_function(&owner_cap, version, function_name);
Expand Down
16 changes: 16 additions & 0 deletions move/axelar_gateway/sources/versioned/gateway_v1.move
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,22 @@ public(package) fun send_message(
);
}

public(package) fun allow_function(
self: &mut Gateway_v1,
version: u64,
function_name: String,
) {
self.version_control.allow_function(version, function_name);
}

public(package) fun disallow_function(
self: &mut Gateway_v1,
version: u64,
function_name: String,
) {
self.version_control.disallow_function(version, function_name);
}

// -----------------
// Private Functions
// -----------------
Expand Down

0 comments on commit fde9d16

Please sign in to comment.