Skip to content

Commit

Permalink
fix(svm): format docstrings (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinis-FRP authored Jan 23, 2025
1 parent 820157d commit 27ecada
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
10 changes: 5 additions & 5 deletions programs/svm-spoke/src/instructions/token_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
50 changes: 25 additions & 25 deletions programs/svm-spoke/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
///
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -497,9 +497,9 @@ pub mod svm_spoke {
instructions::create_token_accounts(ctx)
}

/// **************************************
/// BUNDLE FUNCTIONS *
/// *************************************
// **************************************
// BUNDLE FUNCTIONS *
// *************************************

/// Executes relayer refund leaf.
///
Expand Down Expand Up @@ -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<()>
Expand All @@ -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<()>
Expand Down Expand Up @@ -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.
///
Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit 27ecada

Please sign in to comment.