From b3552eeae88a474948d66de1b959b69e88980144 Mon Sep 17 00:00:00 2001 From: bishalbikram Date: Thu, 19 Sep 2024 14:31:38 +0545 Subject: [PATCH] chore: remove unnecessary comments --- .../centralized-connection/src/contract.rs | 75 ------------------- 1 file changed, 75 deletions(-) diff --git a/contracts/soroban/contracts/centralized-connection/src/contract.rs b/contracts/soroban/contracts/centralized-connection/src/contract.rs index b884406f..5dcd9913 100644 --- a/contracts/soroban/contracts/centralized-connection/src/contract.rs +++ b/contracts/soroban/contracts/centralized-connection/src/contract.rs @@ -7,18 +7,6 @@ pub struct CentralizedConnection; #[contractimpl] impl CentralizedConnection { - /// It checks if contract is not already initialized and initialize the contract otherwise - /// returns the ContractError - /// - /// Arguments: - /// - /// * `env`: The `Env` type provides access to the environment the contract is executing within - /// * `msg`: `msg` is a struct which includes admin, xcall and native token address to initialize - /// the contract - /// - /// Returns: - /// - /// a `Result<(), ContractError>` pub fn initialize(env: Env, msg: InitializeMsg) -> Result<(), ContractError> { storage::is_initialized(&env)?; @@ -30,31 +18,11 @@ impl CentralizedConnection { Ok(()) } - /// It quries the admin from the contract and returns ContractError if the contract is - /// not initialized - /// - /// Arguments: - /// - /// * `env`: The `Env` type provides access to the environment the contract is executing within - /// - /// Returns: - /// - /// a `Result` pub fn get_admin(env: Env) -> Result { let address = storage::admin(&env)?; Ok(address) } - /// It ensures if the caller is an admin and sets the new admin for the contract - /// - /// Arguments: - /// - /// * `env`: The `Env` type provides access to the environment the contract is executing within - /// * `address`: The new admin address - /// - /// Returns: - /// - /// a `Result<(), ContractError>` pub fn set_admin(env: Env, address: Address) -> Result<(), ContractError> { helpers::ensure_admin(&env)?; storage::store_admin(&env, address); @@ -102,17 +70,6 @@ impl CentralizedConnection { Ok(()) } - /// The function receives message sequence `sn` of failed message from the destination chain - /// and call xcall to handle the response of failure message - /// - /// Arguments: - /// - /// * `env`: The `Env` type provides access to the environment the contract is executing within - /// * `sn`: `sn` is the unique ID of the message send from source chain to the destination chain - /// - /// Returns: - /// - /// a `Result<(), ContractError)` pub fn revert_message(env: &Env, sn: u128) -> Result<(), ContractError> { helpers::ensure_admin(&env)?; helpers::call_xcall_handle_error(&env, sn)?; @@ -120,19 +77,6 @@ impl CentralizedConnection { Ok(()) } - /// It sets fee required to send and recieve message from source chain to destination chain - /// - /// Arguments: - /// * `env`: The `Env` type provides access to the environment the contract is executing within - /// * `network_id`: `network_id` is the unique identifier of a blockchain network - /// * `message_fee`: `message_fee` is the amount of XLM Asset required to send message from - /// source chain to the destination chain - /// * `response_fee`: `response_fee` is the amount of XLM Asset required to receive response of - /// send message from the destination chain - /// - /// Returns: - /// - /// a `Result<(), ContractError>` pub fn set_fee( env: Env, network_id: String, @@ -145,13 +89,6 @@ impl CentralizedConnection { Ok(()) } - /// This function allows admin to claim all the native (XLM) token stored in the contract. First - /// it checks if the caller is an admin, then it sends `transfer` message to Stellar Asset - /// Contract (SAC) of native XLM asset and transfers all the contract fund to admin address - /// - /// Returns: - /// - /// a `Result<(), ContractError>` pub fn claim_fees(env: Env) -> Result<(), ContractError> { let admin = helpers::ensure_admin(&env)?; @@ -163,18 +100,6 @@ impl CentralizedConnection { Ok(()) } - /// It returns the fee required to send the message for specific blockchain network - /// - /// Arguments: - /// - /// * `env`: The `Env` type provides access to the environment the contract is executing within. - /// * `network_id`: `network_id` is the unique blockchain network id stored in the contract storage - /// * `response`: `response` is a boolean value which indicates if the response fee should be - /// included or not. - /// - /// Returns: - /// - /// a `u128` fee required to send message pub fn get_fee(env: Env, network_id: String, response: bool) -> Result { helpers::get_network_fee(&env, network_id, response) }