diff --git a/move/axelar_gateway/sources/types/message.move b/move/axelar_gateway/sources/types/message.move index bdd361a0..e89416cd 100644 --- a/move/axelar_gateway/sources/types/message.move +++ b/move/axelar_gateway/sources/types/message.move @@ -18,9 +18,9 @@ public struct Message has copy, drop, store { } /// ----------------- -/// Public Functions +/// Package Functions /// ----------------- -public fun new( +public(package) fun new( source_chain: String, message_id: String, source_address: String, @@ -36,9 +36,6 @@ public fun new( } } -/// ----------------- -/// Package Functions -/// ----------------- public(package) fun peel(bcs: &mut BCS): Message { // TODO: allow UTF-8 strings? Or keep it as more generic bytes? let source_chain = bcs.peel_vec_u8().to_ascii_string(); diff --git a/move/axelar_gateway/sources/types/proof.move b/move/axelar_gateway/sources/types/proof.move index ac4625de..e88d4570 100644 --- a/move/axelar_gateway/sources/types/proof.move +++ b/move/axelar_gateway/sources/types/proof.move @@ -40,23 +40,20 @@ const ESignerNotFound: vector = #[error] const ERedundantSignaturesProvided: vector = b"redundant signatures provided"; - -// ---------------- -// Public Functions -// ---------------- + +// ----------------- +// Package Functions +// ----------------- /// The signers of the proof -public fun signers(proof: &Proof): &WeightedSigners { +public(package) fun signers(proof: &Proof): &WeightedSigners { &proof.signers } /// The proof signatures -public fun signatures(proof: &Proof): &vector { +public(package) fun signatures(proof: &Proof): &vector { &proof.signatures } -// ----------------- -// Package Functions -// ----------------- public(package) fun new_signature(bytes: vector): Signature { assert!(bytes.length() == SIGNATURE_LENGTH, EInvalidSignatureLength); diff --git a/move/axelar_gateway/sources/types/weighted_signer.move b/move/axelar_gateway/sources/types/weighted_signer.move index 90d4479e..070d8e0b 100644 --- a/move/axelar_gateway/sources/types/weighted_signer.move +++ b/move/axelar_gateway/sources/types/weighted_signer.move @@ -18,11 +18,14 @@ public struct WeightedSigner has copy, drop, store { weight: u128, } -public fun pub_key(self: &WeightedSigner): vector { +// ----------------- +// Package Functions +// ----------------- +public(package) fun pub_key(self: &WeightedSigner): vector { self.pub_key } -public fun weight(self: &WeightedSigner): u128 { +public(package) fun weight(self: &WeightedSigner): u128 { self.weight } diff --git a/move/gas_service/sources/versioned/gas_service_v0.move b/move/gas_service/sources/versioned/gas_service_v0.move index 84a676d5..728de7bb 100644 --- a/move/gas_service/sources/versioned/gas_service_v0.move +++ b/move/gas_service/sources/versioned/gas_service_v0.move @@ -130,22 +130,22 @@ fun take( // Test Only // --------- #[test_only] -public fun version_control_mut(self: &mut GasService_v0): &mut VersionControl { +public(package) fun version_control_mut(self: &mut GasService_v0): &mut VersionControl { &mut self.version_control } #[test_only] -public fun balance(self: &GasService_v0): &Balance { +public(package) fun balance(self: &GasService_v0): &Balance { &self.balance } #[test_only] -public fun balance_mut(self: &mut GasService_v0): &mut Balance { +public(package) fun balance_mut(self: &mut GasService_v0): &mut Balance { &mut self.balance } #[test_only] -public fun destroy_for_testing(self: GasService_v0) { +public(package) fun destroy_for_testing(self: GasService_v0) { let GasService_v0 { balance, version_control: _ } = self; balance.destroy_for_testing(); } diff --git a/move/its/sources/types/address_tracker.move b/move/its/sources/types/address_tracker.move index 3229fe45..a2b406d1 100644 --- a/move/its/sources/types/address_tracker.move +++ b/move/its/sources/types/address_tracker.move @@ -23,11 +23,11 @@ public struct InterchainAddressTracker has store { trusted_addresses: Table, } -// ------- -// Getters -// ------- +// ----------------- +// Package Functions +// ----------------- /// Get the trusted address for a chain. -public fun trusted_address( +public(package) fun trusted_address( self: &InterchainAddressTracker, chain_name: String, ): &String { @@ -36,7 +36,7 @@ public fun trusted_address( } /// Check if the given address is trusted for the given chain. -public fun is_trusted_address( +public(package) fun is_trusted_address( self: &InterchainAddressTracker, chain_name: String, addr: String, @@ -44,9 +44,6 @@ public fun is_trusted_address( self.trusted_addresses.contains(chain_name) && self.trusted_addresses[chain_name] == addr } -// ----------------- -// Package Functions -// ----------------- /// Create a new interchain address tracker. public(package) fun new(ctx: &mut TxContext): InterchainAddressTracker { InterchainAddressTracker { diff --git a/move/its/sources/types/coin_info.move b/move/its/sources/types/coin_info.move index 9795dd01..64c3874a 100644 --- a/move/its/sources/types/coin_info.move +++ b/move/its/sources/types/coin_info.move @@ -37,8 +37,9 @@ public fun from_metadata(metadata: CoinMetadata): CoinInfo { } } -// === Views === - +// ----- +// Views +// ----- public fun name(self: &CoinInfo): String { self.name } diff --git a/move/its/sources/types/trusted_addresses.move b/move/its/sources/types/trusted_addresses.move index c4ad5e14..0e72745b 100644 --- a/move/its/sources/types/trusted_addresses.move +++ b/move/its/sources/types/trusted_addresses.move @@ -34,7 +34,10 @@ public fun new( } } -public fun destroy(self: TrustedAddresses): (vector, vector) { +/// ----------------- +/// Package Functions +/// ----------------- +public(package) fun destroy(self: TrustedAddresses): (vector, vector) { let TrustedAddresses { trusted_chains, trusted_addresses } = self; (trusted_chains, trusted_addresses) } diff --git a/test/testdata/interface_axelar_gateway_message.json b/test/testdata/interface_axelar_gateway_message.json index b76df1aa..ecc09694 100644 --- a/test/testdata/interface_axelar_gateway_message.json +++ b/test/testdata/interface_axelar_gateway_message.json @@ -31,18 +31,5 @@ ] } }, - "publicFunctions": { - "new": { - "name": "new", - "visibility": "public", - "params": { - "source_chain#0#0": "String", - "message_id#0#0": "String", - "source_address#0#0": "String", - "destination_id#0#0": "address", - "payload_hash#0#0": "Bytes32" - }, - "returnType": "Message" - } - } + "publicFunctions": {} } diff --git a/test/testdata/interface_axelar_gateway_proof.json b/test/testdata/interface_axelar_gateway_proof.json index a496ea13..1a0ad766 100644 --- a/test/testdata/interface_axelar_gateway_proof.json +++ b/test/testdata/interface_axelar_gateway_proof.json @@ -33,22 +33,5 @@ ] } }, - "publicFunctions": { - "signers": { - "name": "signers", - "visibility": "public", - "params": { - "proof#0#0": "&Proof" - }, - "returnType": "&WeightedSigners" - }, - "signatures": { - "name": "signatures", - "visibility": "public", - "params": { - "proof#0#0": "&Proof" - }, - "returnType": "&vector" - } - } + "publicFunctions": {} } diff --git a/test/testdata/interface_axelar_gateway_weighted_signer.json b/test/testdata/interface_axelar_gateway_weighted_signer.json index 93a4b13b..efe968cf 100644 --- a/test/testdata/interface_axelar_gateway_weighted_signer.json +++ b/test/testdata/interface_axelar_gateway_weighted_signer.json @@ -19,22 +19,5 @@ ] } }, - "publicFunctions": { - "pub_key": { - "name": "pub_key", - "visibility": "public", - "params": { - "self#0#0": "&WeightedSigner" - }, - "returnType": "vector" - }, - "weight": { - "name": "weight", - "visibility": "public", - "params": { - "self#0#0": "&WeightedSigner" - }, - "returnType": "u128" - } - } + "publicFunctions": {} } diff --git a/test/testdata/interface_its_address_tracker.json b/test/testdata/interface_its_address_tracker.json index 8a599fcb..b159b8e7 100644 --- a/test/testdata/interface_its_address_tracker.json +++ b/test/testdata/interface_its_address_tracker.json @@ -13,25 +13,5 @@ ] } }, - "publicFunctions": { - "trusted_address": { - "name": "trusted_address", - "visibility": "public", - "params": { - "self#0#0": "&InterchainAddressTracker", - "chain_name#0#0": "String" - }, - "returnType": "&String" - }, - "is_trusted_address": { - "name": "is_trusted_address", - "visibility": "public", - "params": { - "self#0#0": "&InterchainAddressTracker", - "chain_name#0#0": "String", - "addr#0#0": "String" - }, - "returnType": "bool" - } - } + "publicFunctions": {} } diff --git a/test/testdata/interface_its_trusted_addresses.json b/test/testdata/interface_its_trusted_addresses.json index e6a7dded..867ac97e 100644 --- a/test/testdata/interface_its_trusted_addresses.json +++ b/test/testdata/interface_its_trusted_addresses.json @@ -27,14 +27,6 @@ "trusted_addresses#0#0": "vector" }, "returnType": "TrustedAddresses" - }, - "destroy": { - "name": "destroy", - "visibility": "public", - "params": { - "self#0#0": "TrustedAddresses" - }, - "returnType": "vector * vector" } } }