Skip to content

Commit

Permalink
More docs (#106)
Browse files Browse the repository at this point in the history
* Clean up redundant imports

* more intradoc links
  • Loading branch information
macalinao committed Dec 31, 2021
1 parent beb467d commit 510a764
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions stable-swap-anchor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
#![allow(rustdoc::missing_doc_code_examples)]
#![allow(clippy::nonstandard_macro_braces)]

use std::ops::Deref;

use anchor_lang::prelude::*;
use anchor_lang::solana_program;
use anchor_lang::solana_program::account_info::AccountInfo;
use anchor_lang::solana_program::entrypoint::ProgramResult;
use anchor_lang::solana_program::program_pack::Pack;
use anchor_lang::{Accounts, CpiContext};
use anchor_lang::{prelude::*, solana_program};
use std::ops::Deref;

declare_id!("SSwpkEEcbUqx4vtoEByFjSkhKdCT862DNVb52nZg1UZ");

Expand Down Expand Up @@ -385,7 +380,7 @@ pub struct Deposit<'info> {
pub output_lp: AccountInfo<'info>,
}

/// Accounts for a 'swap' instruction.
/// Accounts for a [swap] instruction.
#[derive(Accounts)]
pub struct Swap<'info> {
/// The context of the user.
Expand All @@ -396,7 +391,7 @@ pub struct Swap<'info> {
pub output: SwapOutput<'info>,
}

/// Accounts for a 'withdraw_one' instruction.
/// Accounts for a [withdraw_one] instruction.
#[derive(Accounts)]
pub struct WithdrawOne<'info> {
/// The context of the user.
Expand All @@ -421,7 +416,7 @@ pub struct WithdrawOne<'info> {
pub output: SwapOutput<'info>,
}

/// Accounts for a 'withdraw' instruction.
/// Accounts for a [withdraw] instruction.
#[derive(Accounts)]
pub struct Withdraw<'info> {
/// The context of the user.
Expand All @@ -436,7 +431,7 @@ pub struct Withdraw<'info> {
pub output_b: SwapOutput<'info>,
}

/// Accounts for a 'set_fee_account' instruction.
/// Accounts for a [set_fee_account] instruction.
#[derive(Accounts)]
pub struct SetFeeAccount<'info> {
/// The context of the admin user
Expand All @@ -445,7 +440,7 @@ pub struct SetFeeAccount<'info> {
pub fee_account: AccountInfo<'info>,
}

/// Accounts for a 'apply_new_admin'.
/// Accounts for a [apply_new_admin].
#[derive(Accounts)]
pub struct CommitNewAdmin<'info> {
/// The context of the admin user
Expand All @@ -458,7 +453,7 @@ pub struct CommitNewAdmin<'info> {
// Various accounts
// --------------------------------

/// Token accounts for the output of a StableSwap instruction.
/// Token accounts for initializing a [SwapInfo].
#[derive(Accounts)]
pub struct InitToken<'info> {
/// The token account for the pool's reserves of this token.
Expand All @@ -469,7 +464,7 @@ pub struct InitToken<'info> {
pub mint: AccountInfo<'info>,
}

/// Token accounts for a 'swap' instruction.
/// Token accounts for a [swap] instruction.
#[derive(Accounts)]
pub struct SwapToken<'info> {
/// The token account associated with the user.
Expand Down Expand Up @@ -503,7 +498,7 @@ pub struct SwapUserContext<'info> {
}

/// Accounts for an instruction that requires admin permission.
#[derive(Accounts, Clone)]
#[derive(Accounts)]
pub struct AdminUserContext<'info> {
/// The public key of the admin account.
pub admin: Signer<'info>,
Expand All @@ -512,7 +507,7 @@ pub struct AdminUserContext<'info> {
}

/// Accounts for an instruction that requires admin permission with the clock.
#[derive(Accounts, Clone)]
#[derive(Accounts)]
pub struct AdminUserContextWithClock<'info> {
/// The admin user context.
pub admin_ctx: AdminUserContext<'info>,
Expand Down

0 comments on commit 510a764

Please sign in to comment.