From 44ca528b134878c6c19400a7de657837b2408bf1 Mon Sep 17 00:00:00 2001 From: metaproph3t Date: Tue, 9 Apr 2024 00:00:00 +0000 Subject: [PATCH 1/2] Fix some doc typos --- programs/amm/src/instructions/create_pool.rs | 4 ++-- programs/amm/src/states/oracle.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/amm/src/instructions/create_pool.rs b/programs/amm/src/instructions/create_pool.rs index 22ee1d48..cc8e7d7e 100644 --- a/programs/amm/src/instructions/create_pool.rs +++ b/programs/amm/src/instructions/create_pool.rs @@ -28,7 +28,7 @@ pub struct CreatePool<'info> { )] pub pool_state: AccountLoader<'info, PoolState>, - /// Token_0 mint, the key must grater then token_1 mint. + /// Token_0 mint, the key must be greater then token_1 mint. #[account( constraint = token_mint_0.key() < token_mint_1.key(), mint::token_program = token_program_0 @@ -73,7 +73,7 @@ pub struct CreatePool<'info> { )] pub token_vault_1: Box>, - /// CHECK: Initialize an account to store oracle observations, the account must be created off-chain, constract will initialzied it + /// CHECK: Initialize an account to store oracle observations, the account must be created off-chain, contract will initialize it #[account(mut)] pub observation_state: UncheckedAccount<'info>, diff --git a/programs/amm/src/states/oracle.rs b/programs/amm/src/states/oracle.rs index 3877646a..18abc827 100644 --- a/programs/amm/src/states/oracle.rs +++ b/programs/amm/src/states/oracle.rs @@ -100,7 +100,7 @@ impl ObservationState { Ok(()) } - // Writes an oracle observation to the account, returning the next observation_index. + /// Writes an oracle observation to the account, returning the next observation_index. /// Writable at most once per second. Index represents the most recently written element. /// If the index is at the end of the allowable array length (1000 - 1), the next index will turn to 0. /// From 079e230b9968fd279708d471d1069c7f537b8d2e Mon Sep 17 00:00:00 2001 From: metaproph3t Date: Wed, 10 Apr 2024 00:00:00 +0000 Subject: [PATCH 2/2] Fix the tick overflow error messages --- programs/amm/src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/amm/src/error.rs b/programs/amm/src/error.rs index 69724f41..9a7aa65e 100644 --- a/programs/amm/src/error.rs +++ b/programs/amm/src/error.rs @@ -20,9 +20,9 @@ pub enum ErrorCode { InvaildTickIndex, #[msg("The lower tick must be below the upper tick")] TickInvaildOrder, - #[msg("The tick must be greater, or equal to the minimum tick(-221818)")] + #[msg("The tick must be greater, or equal to the minimum tick(-443636)")] TickLowerOverflow, - #[msg("The tick must be lesser than, or equal to the maximum tick(221818)")] + #[msg("The tick must be lesser than, or equal to the maximum tick(443636)")] TickUpperOverflow, #[msg("tick % tick_spacing must be zero")] TickAndSpacingNotMatch,