From 27ecadab7a728b9134343b540d07ff9a3d933089 Mon Sep 17 00:00:00 2001 From: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:20:36 +0200 Subject: [PATCH] fix(svm): format docstrings (#853) --- .../src/instructions/token_bridge.rs | 10 ++-- programs/svm-spoke/src/lib.rs | 50 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/programs/svm-spoke/src/instructions/token_bridge.rs b/programs/svm-spoke/src/instructions/token_bridge.rs index 061b0c585..ee3075474 100644 --- a/programs/svm-spoke/src/instructions/token_bridge.rs +++ b/programs/svm-spoke/src/instructions/token_bridge.rs @@ -40,28 +40,28 @@ pub struct BridgeTokensToHubPool<'info> { pub token_messenger_minter_sender_authority: UncheckedAccount<'info>, /// CHECK: MessageTransmitter is checked in CCTP. Seeds must be \["message_transmitter"\] (CCTP Message Transmitter - /// program). + // program). #[account(mut)] pub message_transmitter: UncheckedAccount<'info>, /// CHECK: TokenMessenger is checked in CCTP. Seeds must be \["token_messenger"\] (CCTP Token Messenger Minter - /// program). + // program). pub token_messenger: UncheckedAccount<'info>, /// CHECK: RemoteTokenMessenger is checked in CCTP. Seeds must be \["remote_token_messenger"\, - /// remote_domain.to_string()] (CCTP Token Messenger Minter program). + // remote_domain.to_string()] (CCTP Token Messenger Minter program). pub remote_token_messenger: UncheckedAccount<'info>, /// CHECK: TokenMinter is checked in CCTP. Seeds must be \["token_minter"\] (CCTP Token Messenger Minter program). pub token_minter: UncheckedAccount<'info>, /// CHECK: LocalToken is checked in CCTP. Seeds must be \["local_token", mint\] (CCTP Token Messenger Minter - /// program). + // program). #[account(mut)] pub local_token: UncheckedAccount<'info>, /// CHECK: EventAuthority is checked in CCTP. Seeds must be \["__event_authority"\] (CCTP Token Messenger Minter - /// program). + // program). pub cctp_event_authority: UncheckedAccount<'info>, #[account(mut)] diff --git a/programs/svm-spoke/src/lib.rs b/programs/svm-spoke/src/lib.rs index 003511419..69260b310 100644 --- a/programs/svm-spoke/src/lib.rs +++ b/programs/svm-spoke/src/lib.rs @@ -46,9 +46,9 @@ use utils::*; pub mod svm_spoke { use super::*; - /// ************************************** - /// ADMIN FUNCTIONS * - /// ************************************* + // ************************************** + // ADMIN FUNCTIONS * + // ************************************* /// Initializes the state for the SVM Spoke Pool. Only callable once. /// @@ -208,16 +208,16 @@ pub mod svm_spoke { instructions::emergency_delete_root_bundle(ctx, root_bundle_id) } - /// ************************************** - /// DEPOSIT FUNCTIONS * - /// ************************************* + // ************************************** + // DEPOSIT FUNCTIONS * + // ************************************* /// Request to bridge input_token to a target chain and receive output_token. /// /// The fee paid to relayers and the system is captured in the spread between the input and output amounts, /// denominated in the input token. A relayer on the destination chain will send `output_amount` of `output_token` /// to the recipient and receive `input_token` on a repayment chain of their choice. The fee accounts for: - /// Destination transaction costs, relayer's opportunity cost of capital while waiting for a refund during the + /// destination transaction costs, relayer's opportunity cost of capital while waiting for a refund during the /// optimistic challenge window in the HubPool, and the system fee charged to the relayer. /// /// On the destination chain, a unique hash of the deposit data is used to identify this deposit. Modifying any @@ -239,7 +239,7 @@ pub mod svm_spoke { /// ### Parameters /// - depositor: The account credited with the deposit. Can be different from the signer. /// - recipient: The account receiving funds on the destination chain. Depending on the output chain can be an ETH - /// address or a contract address or any other address type encoded as a bytes32 field. + /// address or a contract address or any other address type encoded as a bytes32 field. /// - input_token: The token pulled from the caller's account and locked into this program's vault on deposit. /// - output_token: The token that the relayer will send to the recipient on the destination chain. /// - input_amount: The amount of input tokens to pull from the caller's account and lock into the vault. This @@ -293,8 +293,8 @@ pub mod svm_spoke { ) } - // Equivalent to deposit_v3 except quote_timestamp is set to the current time. - // The deposit `fill_deadline` is calculated as the current time plus `fill_deadline_offset`. + /// Equivalent to deposit_v3 except quote_timestamp is set to the current time. + /// The deposit `fill_deadline` is calculated as the current time plus `fill_deadline_offset`. pub fn deposit_v3_now( ctx: Context<DepositV3>, depositor: Pubkey, @@ -381,9 +381,9 @@ pub mod svm_spoke { Ok(utils::get_unsafe_deposit_id(signer, depositor, deposit_nonce)) } - /// ************************************** - /// RELAYER FUNCTIONS * - /// ************************************* + // ************************************** + // RELAYER FUNCTIONS * + // ************************************* /// Fulfill request to bridge cross chain by sending specified output tokens to recipient. /// @@ -434,7 +434,7 @@ pub mod svm_spoke { /// - message: The message to send to the recipient if the recipient is a contract that implements a /// handle_v3_across_message() public function. /// - repayment_chain_id: Chain of SpokePool where relayer wants to be refunded after the challenge window has - /// passed. Will receive input_amount of the equivalent token to input_token on the repayment chain. + /// passed. Will receive input_amount of the equivalent token to input_token on the repayment chain. /// - repayment_address: The address of the recipient on the repayment chain that they want to be refunded to. /// Note: relay_data, repayment_chain_id, and repayment_address are optional parameters. If None for any of these /// is passed, the caller must load them via the instruction_params account. @@ -497,9 +497,9 @@ pub mod svm_spoke { instructions::create_token_accounts(ctx) } - /// ************************************** - /// BUNDLE FUNCTIONS * - /// ************************************* + // ************************************** + // BUNDLE FUNCTIONS * + // ************************************* /// Executes relayer refund leaf. /// @@ -536,8 +536,7 @@ pub mod svm_spoke { /// - token_program: The token program. /// - system_program: The system program required for account creation. /// - /// execute_relayer_refund_leaf executes in mode (a) where refunds are sent to ATA directly. - /// execute_relayer_refund_leaf_deferred executes in mode (b) where refunds are allocated to the claim_account PDA. + /// execute_relayer_refund_leaf executes in mode where refunds are sent to ATA directly. pub fn execute_relayer_refund_leaf<'c, 'info>( ctx: Context<'_, '_, 'c, 'info, ExecuteRelayerRefundLeaf<'info>>, ) -> Result<()> @@ -547,6 +546,7 @@ pub mod svm_spoke { instructions::execute_relayer_refund_leaf(ctx, false) } + /// Similar to execute_relayer_refund_leaf, but executes in mode where refunds are allocated to claim_account PDAs. pub fn execute_relayer_refund_leaf_deferred<'c, 'info>( ctx: Context<'_, '_, 'c, 'info, ExecuteRelayerRefundLeaf<'info>>, ) -> Result<()> @@ -672,9 +672,9 @@ pub mod svm_spoke { instructions::close_claim_account(ctx) } - /// ************************************** - /// SLOW FILL FUNCTIONS * - /// ************************************* + // ************************************** + // SLOW FILL FUNCTIONS * + // ************************************* /// Requests Across to send LP funds to this program to fulfill a slow fill. /// @@ -757,9 +757,9 @@ pub mod svm_spoke { instructions::execute_v3_slow_relay_leaf(ctx, slow_fill_leaf, proof) } - /// ************************************** - /// CCTP FUNCTIONS FUNCTIONS * - /// ************************************* + // ************************************** + // CCTP FUNCTIONS FUNCTIONS * + // ************************************* /// Handles cross-chain messages received from L1 Ethereum over CCTP. ///