Skip to content

Commit

Permalink
This reverts commit 2da8b19.
Browse files Browse the repository at this point in the history
fix: solana format rustdoc
  • Loading branch information
daniel-savu committed Dec 19, 2023
1 parent 40cda52 commit e7a09c2
Show file tree
Hide file tree
Showing 34 changed files with 659 additions and 659 deletions.
58 changes: 29 additions & 29 deletions rust/sealevel/client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,23 +991,23 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) {
// Burns the tokens from the sender's associated token account and
// then dispatches a message to the remote recipient.
//
// 0. `executable` The system program.
// 1. `executable` The spl_noop program.
// 2. `` The token PDA account.
// 3. `executable` The mailbox program.
// 4. `writeable` The mailbox outbox account.
// 5. `` Message dispatch authority.
// 6. `signer` The token sender and mailbox payer.
// 7. `signer` Unique message / gas payment account.
// 8. `writeable` Message storage PDA.
// 0. `[executable]` The system program.
// 1. `[executable]` The spl_noop program.
// 2. `[]` The token PDA account.
// 3. `[executable]` The mailbox program.
// 4. `[writeable]` The mailbox outbox account.
// 5. `[]` Message dispatch authority.
// 6. `[signer]` The token sender and mailbox payer.
// 7. `[signer]` Unique message / gas payment account.
// 8. `[writeable]` Message storage PDA.
// ---- If using an IGP ----
// 9. `executable` The IGP program.
// 10. `writeable` The IGP program data.
// 11. `writeable` Gas payment PDA.
// 12. `` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP.
// 13. `writeable` The IGP account.
// 9. `[executable]` The IGP program.
// 10. `[writeable]` The IGP program data.
// 11. `[writeable]` Gas payment PDA.
// 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP.
// 13. `[writeable]` The IGP account.
// ---- End if ----
// 14..N `??..??` Plugin-specific accounts.
// 14..N [??..??] Plugin-specific accounts.
let mut accounts = vec![
AccountMeta::new_readonly(system_program::id(), false),
AccountMeta::new_readonly(spl_noop::id(), false),
Expand Down Expand Up @@ -1059,8 +1059,8 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) {

match xfer.token_type {
TokenType::Native => {
// 5. `executable` The system program.
// 6. `writeable` The native token collateral PDA account.
// 5. `[executable]` The system program.
// 6. `[writeable]` The native token collateral PDA account.
let (native_collateral_account, _native_collateral_bump) =
Pubkey::find_program_address(
hyperlane_token_native_collateral_pda_seeds!(),
Expand All @@ -1072,9 +1072,9 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) {
]);
}
TokenType::Synthetic => {
// 5. `executable` The spl_token_2022 program.
// 6. `writeable` The mint / mint authority PDA account.
// 7. `writeable` The token sender's associated token account, from which tokens will be burned.
// 5. `[executable]` The spl_token_2022 program.
// 6. `[writeable]` The mint / mint authority PDA account.
// 7. `[writeable]` The token sender's associated token account, from which tokens will be burned.
let (mint_account, _mint_bump) = Pubkey::find_program_address(
hyperlane_token_mint_pda_seeds!(),
&xfer.program_id,
Expand All @@ -1092,10 +1092,10 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) {
]);
}
TokenType::Collateral => {
// 5. `executable` The SPL token program for the mint.
// 6. `writeable` The mint.
// 7. `writeable` The token sender's associated token account, from which tokens will be sent.
// 8. `writeable` The escrow PDA account.
// 5. `[executable]` The SPL token program for the mint.
// 6. `[writeable]` The mint.
// 7. `[writeable]` The token sender's associated token account, from which tokens will be sent.
// 8. `[writeable]` The escrow PDA account.
let token = HyperlaneTokenAccount::<CollateralPlugin>::fetch(
&mut &fetched_token_account.data[..],
)
Expand Down Expand Up @@ -1266,11 +1266,11 @@ fn process_validator_announce_cmd(ctx: Context, cmd: ValidatorAnnounceCmd) {
let ixn = ValidatorAnnounceInstruction::Announce(announce_instruction);

// Accounts:
// 0. `signer` The payer.
// 1. `executable` The system program.
// 2. `` The ValidatorAnnounce PDA account.
// 3. `writeable` The validator-specific ValidatorStorageLocationsAccount PDA account.
// 4. `writeable` The ReplayProtection PDA account specific to the announcement being made.
// 0. `[signer]` The payer.
// 1. `[executable]` The system program.
// 2. `[]` The ValidatorAnnounce PDA account.
// 3. `[writeable]` The validator-specific ValidatorStorageLocationsAccount PDA account.
// 4. `[writeable]` The ReplayProtection PDA account specific to the announcement being made.
let accounts = vec![
AccountMeta::new_readonly(ctx.payer_pubkey, true),
AccountMeta::new_readonly(system_program::id(), false),
Expand Down
34 changes: 17 additions & 17 deletions rust/sealevel/libraries/hyperlane-sealevel-token/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ pub fn init_instruction(
let ixn = Instruction::Init(init);

// Accounts:
// 0. `executable` The system program.
// 1. `writable` The token PDA account.
// 2. `writable` The dispatch authority PDA account.
// 3. `signer` The payer and access control owner.
// 4..N `??..??` Plugin-specific accounts.
// 0. `[executable]` The system program.
// 1. `[writable]` The token PDA account.
// 2. `[writable]` The dispatch authority PDA account.
// 3. `[signer]` The payer and access control owner.
// 4..N [??..??] Plugin-specific accounts.
let accounts = vec![
AccountMeta::new_readonly(solana_program::system_program::id(), false),
AccountMeta::new(token_key, false),
Expand Down Expand Up @@ -123,9 +123,9 @@ pub fn enroll_remote_routers_instruction(
let ixn = Instruction::EnrollRemoteRouters(configs);

// Accounts:
// 0. `executable` The system program.
// 1. `writeable` The token PDA account.
// 2. `signer` The owner.
// 0. `[executable]` The system program.
// 1. `[writeable]` The token PDA account.
// 2. `[signer]` The owner.
let accounts = vec![
AccountMeta::new_readonly(solana_program::system_program::id(), false),
AccountMeta::new(token_key, false),
Expand Down Expand Up @@ -154,9 +154,9 @@ pub fn set_destination_gas_configs(
let ixn = Instruction::SetDestinationGasConfigs(configs);

// Accounts:
// 0. `executable` The system program.
// 1. `writeable` The token PDA account.
// 2. `signer` The owner.
// 0. `[executable]` The system program.
// 1. `[writeable]` The token PDA account.
// 2. `[signer]` The owner.
let accounts = vec![
AccountMeta::new_readonly(solana_program::system_program::id(), false),
AccountMeta::new(token_key, false),
Expand Down Expand Up @@ -185,8 +185,8 @@ pub fn transfer_ownership_instruction(
let ixn = Instruction::TransferOwnership(new_owner);

// Accounts:
// 0. `writeable` The token PDA account.
// 1. `signer` The current owner.
// 0. `[writeable]` The token PDA account.
// 1. `[signer]` The current owner.
let accounts = vec![
AccountMeta::new(token_key, false),
AccountMeta::new_readonly(owner_payer, true),
Expand Down Expand Up @@ -214,8 +214,8 @@ pub fn set_interchain_security_module_instruction(
let ixn = Instruction::SetInterchainSecurityModule(new_interchain_security_module);

// Accounts:
// 0. `writeable` The token PDA account.
// 1. `signer` The current owner.
// 0. `[writeable]` The token PDA account.
// 1. `[signer]` The current owner.
let accounts = vec![
AccountMeta::new(token_key, false),
AccountMeta::new_readonly(owner_payer, true),
Expand Down Expand Up @@ -243,8 +243,8 @@ pub fn set_igp_instruction(
let ixn = Instruction::SetInterchainGasPaymaster(igp_program_and_account);

// Accounts:
// 0. `writeable` The token PDA account.
// 1. `signer` The current owner.
// 0. `[writeable]` The token PDA account.
// 1. `[signer]` The current owner.
let accounts = vec![
AccountMeta::new(token_key, false),
AccountMeta::new_readonly(owner_payer, true),
Expand Down
98 changes: 49 additions & 49 deletions rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ where
/// Initializes the program.
///
/// Accounts:
/// 0. `executable` The system program.
/// 1. `writable` The token PDA account.
/// 2. `writable` The dispatch authority PDA account.
/// 3. `signer` The payer and access control owner.
/// 4..N `??..??` Plugin-specific accounts.
/// 0. `[executable]` The system program.
/// 1. `[writable]` The token PDA account.
/// 2. `[writable]` The dispatch authority PDA account.
/// 3. `[signer]` The payer and access control owner.
/// 4..N [??..??] Plugin-specific accounts.
pub fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramResult {
let accounts_iter = &mut accounts.iter();

Expand Down Expand Up @@ -255,23 +255,23 @@ where
/// then dispatches a message to the remote recipient.
///
/// Accounts:
/// 0. `executable` The system program.
/// 1. `executable` The spl_noop program.
/// 2. `` The token PDA account.
/// 3. `executable` The mailbox program.
/// 4. `writeable` The mailbox outbox account.
/// 5. `` Message dispatch authority.
/// 6. `signer` The token sender and mailbox payer.
/// 7. `signer` Unique message / gas payment account.
/// 8. `writeable` Message storage PDA.
/// 0. `[executable]` The system program.
/// 1. `[executable]` The spl_noop program.
/// 2. `[]` The token PDA account.
/// 3. `[executable]` The mailbox program.
/// 4. `[writeable]` The mailbox outbox account.
/// 5. `[]` Message dispatch authority.
/// 6. `[signer]` The token sender and mailbox payer.
/// 7. `[signer]` Unique message / gas payment account.
/// 8. `[writeable]` Message storage PDA.
/// ---- If using an IGP ----
/// 9. `executable` The IGP program.
/// 10. `writeable` The IGP program data.
/// 11. `writeable` Gas payment PDA.
/// 12. `` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP.
/// 13. `writeable` The IGP account.
/// 9. `[executable]` The IGP program.
/// 10. `[writeable]` The IGP program data.
/// 11. `[writeable]` Gas payment PDA.
/// 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP.
/// 13. `[writeable]` The IGP account.
/// ---- End if ----
/// 14..N `??..??` Plugin-specific accounts.
/// 14..N [??..??] Plugin-specific accounts.
pub fn transfer_remote(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -362,13 +362,13 @@ where

// Accounts expected by the IGP's `PayForGas` instruction:
//
// 0. `executable` The system program.
// 1. `signer` The payer.
// 2. `writeable` The IGP program data.
// 3. `signer` Unique gas payment account.
// 4. `writeable` Gas payment PDA.
// 5. `writeable` The IGP account.
// 6. `` Overhead IGP account (optional).
// 0. `[executable]` The system program.
// 1. `[signer]` The payer.
// 2. `[writeable]` The IGP program data.
// 3. `[signer]` Unique gas payment account.
// 4. `[writeable]` Gas payment PDA.
// 5. `[writeable]` The IGP account.
// 6. `[]` Overhead IGP account (optional).

let mut igp_payment_account_metas = vec![
AccountMeta::new_readonly(solana_program::system_program::id(), false),
Expand Down Expand Up @@ -491,11 +491,11 @@ where
}

/// Accounts:
/// 0. `signer` Mailbox processor authority specific to this program.
/// 1. `executable` system_program
/// 2. `` hyperlane_token storage
/// 3. `depends on plugin` recipient wallet address
/// 4..N `??..??` Plugin-specific accounts.
/// 0. `[signer]` Mailbox processor authority specific to this program.
/// 1. `[executable]` system_program
/// 2. `[]` hyperlane_token storage
/// 3. [depends on plugin] recipient wallet address
/// 4..N [??..??] Plugin-specific accounts.
pub fn transfer_from_remote(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -575,7 +575,7 @@ where
/// serializes them, and sets them as return data.
///
/// Accounts:
/// 0. `` The token PDA, which is the PDA with the seeds `HANDLE_ACCOUNT_METAS_PDA_SEEDS`.
/// 0. `[]` The token PDA, which is the PDA with the seeds `HANDLE_ACCOUNT_METAS_PDA_SEEDS`.
pub fn transfer_from_remote_account_metas(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -621,9 +621,9 @@ where
/// Enrolls a remote router.
///
/// Accounts:
/// 0. `executable` The system program.
/// 1. `writeable` The token PDA account.
/// 2. `signer` The owner.
/// 0. `[executable]` The system program.
/// 1. `[writeable]` The token PDA account.
/// 2. `[signer]` The owner.
pub fn enroll_remote_router(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -670,9 +670,9 @@ where
/// Enrolls remote routers.
///
/// Accounts:
/// 0. `executable` The system program.
/// 1. `writeable` The token PDA account.
/// 2. `signer` The owner.
/// 0. `[executable]` The system program.
/// 1. `[writeable]` The token PDA account.
/// 2. `[signer]` The owner.
pub fn enroll_remote_routers(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -719,8 +719,8 @@ where
/// Transfers ownership.
///
/// Accounts:
/// 0. `writeable` The token PDA account.
/// 1. `signer` The current owner.
/// 0. `[writeable]` The token PDA account.
/// 1. `[signer]` The current owner.
pub fn transfer_ownership(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand All @@ -747,7 +747,7 @@ where
/// Gets the interchain security module.
///
/// Accounts:
/// 0. `` The token PDA account.
/// 0. `[]` The token PDA account.
pub fn interchain_security_module(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -792,8 +792,8 @@ where
/// Lets the owner set the interchain security module.
///
/// Accounts:
/// 0. `writeable` The token PDA account.
/// 1. `signer` The access control owner.
/// 0. `[writeable]` The token PDA account.
/// 1. `[signer]` The access control owner.
pub fn set_interchain_security_module(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand All @@ -820,9 +820,9 @@ where
/// Lets the owner set destination gas configs.
///
/// Accounts:
/// 0. `executable` The system program.
/// 1. `writeable` The token PDA account.
/// 2. `signer` The access control owner.
/// 0. `[executable]` The system program.
/// 1. `[writeable]` The token PDA account.
/// 2. `[signer]` The access control owner.
pub fn set_destination_gas_configs(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -860,8 +860,8 @@ where
/// Lets the owner set the interchain gas paymaster.
///
/// Accounts:
/// 0. `writeable` The token PDA account.
/// 1. `signer` The access control owner.
/// 0. `[writeable]` The token PDA account.
/// 1. `[signer]` The access control owner.
pub fn set_interchain_gas_paymaster(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down
18 changes: 9 additions & 9 deletions rust/sealevel/libraries/test-utils/src/igp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ pub async fn initialize_igp_program(
Pubkey::find_program_address(igp_program_data_pda_seeds!(), &program_id);

// Accounts:
// 0. `executable` The system program.
// 1. `signer` The payer account.
// 2. `writeable` The program data account.
// 0. `[executable]` The system program.
// 1. `[signer]` The payer account.
// 2. `[writeable]` The program data account.
let init_instruction = Instruction::new_with_borsh(
program_id,
&IgpInstruction::Init,
Expand Down Expand Up @@ -104,9 +104,9 @@ pub async fn initialize_igp(
let (igp_key, igp_bump_seed) = Pubkey::find_program_address(igp_pda_seeds!(salt), &program_id);

// Accounts:
// 0. `executable` The system program.
// 1. `signer` The payer account.
// 2. `writeable` The IGP account to initialize.
// 0. `[executable]` The system program.
// 1. `[signer]` The payer account.
// 2. `[writeable]` The IGP account to initialize.
let init_instruction = Instruction::new_with_borsh(
program_id,
&IgpInstruction::InitIgp(InitIgp {
Expand Down Expand Up @@ -139,9 +139,9 @@ pub async fn initialize_overhead_igp(
Pubkey::find_program_address(overhead_igp_pda_seeds!(salt), &program_id);

// Accounts:
// 0. `executable` The system program.
// 1. `signer` The payer account.
// 2. `writeable` The Overhead IGP account to initialize.
// 0. `[executable]` The system program.
// 1. `[signer]` The payer account.
// 2. `[writeable]` The Overhead IGP account to initialize.
let init_instruction = Instruction::new_with_borsh(
program_id,
&IgpInstruction::InitOverheadIgp(InitOverheadIgp { salt, owner, inner }),
Expand Down
Loading

0 comments on commit e7a09c2

Please sign in to comment.