Skip to content

Commit 88086aa

Browse files
fix: correct spelling and improve comments in account compression module (#1553)
* fix: correct spelling and improve comments in account compression module * chore: remove commented-out code in sdk (#1551) * fix: correct spelling in comments for batched merkle tree test
1 parent 243cbe5 commit 88086aa

File tree

13 files changed

+17
-18
lines changed

13 files changed

+17
-18
lines changed

forester/src/tree_data_sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use account_compression::{
2-
utils::check_discrimininator::check_discriminator, AddressMerkleTreeAccount,
2+
utils::check_discriminator::check_discriminator, AddressMerkleTreeAccount,
33
StateMerkleTreeAccount,
44
};
55
use borsh::BorshDeserialize;

program-tests/account-compression-test/tests/batched_merkle_tree_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ async fn test_rollover_batch_state_merkle_trees() {
11831183
)
11841184
.unwrap();
11851185
}
1186-
// Sent funds to nullier queue for rollover reimbursment
1186+
// Sent funds to nullifier queue for rollover reimbursement
11871187
// rollover fees are now transferred in the system program.
11881188
airdrop_lamports(
11891189
&mut context,
@@ -1485,7 +1485,7 @@ pub async fn perform_init_batch_address_merkle_tree(
14851485
Some(merkle_tree_keypair),
14861486
);
14871487

1488-
let instruction = account_compression::instruction::IntializeBatchedAddressMerkleTree {
1488+
let instruction = account_compression::instruction::InitializeBatchedAddressMerkleTree {
14891489
bytes: params.try_to_vec().unwrap(),
14901490
};
14911491
let accounts = account_compression::accounts::InitializeBatchedAddressMerkleTree {

programs/account-compression/src/instructions/intialize_batched_state_merkle_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn process_initialize_batched_state_merkle_tree<'info>(
5656
};
5757
let merkle_tree_account_info = ctx.accounts.merkle_tree.to_account_info();
5858
let queue_account_info = ctx.accounts.queue.to_account_info();
59-
let additional_bytes_rent = (Rent::get()?).minimum_balance(params.additional_bytes as usize);
59+
let additional_bytes_rent = Rent::get()?.minimum_balance(params.additional_bytes as usize);
6060
init_batched_state_merkle_tree_from_account_info(
6161
params,
6262
owner,

programs/account-compression/src/instructions/rollover_address_merkle_tree_and_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::{
2020
#[derive(Accounts)]
2121
pub struct RolloverAddressMerkleTreeAndQueue<'info> {
2222
#[account(mut)]
23-
/// Signer used to receive rollover accounts rentexemption reimbursement.
23+
/// Signer used to receive rollover accounts rent exemption reimbursement.
2424
pub fee_payer: Signer<'info>,
2525
pub authority: Signer<'info>,
2626
pub registered_program_pda: Option<Account<'info, RegisteredProgram>>,

programs/account-compression/src/instructions/rollover_batched_address_merkle_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey};
1+
use anchor_lang::prelude::*;
22
use light_batched_merkle_tree::{
33
merkle_tree::BatchedMerkleTreeAccount,
44
rollover_address_tree::rollover_batched_address_tree_from_account_info,
@@ -17,7 +17,7 @@ use crate::{
1717
#[derive(Accounts)]
1818
pub struct RolloverBatchedAddressMerkleTree<'info> {
1919
#[account(mut)]
20-
/// Signer used to receive rollover accounts rentexemption reimbursement.
20+
/// Signer used to receive rollover accounts rent exemption reimbursement.
2121
pub fee_payer: Signer<'info>,
2222
pub authority: Signer<'info>,
2323
pub registered_program_pda: Option<Account<'info, RegisteredProgram>>,

programs/account-compression/src/instructions/rollover_batched_state_merkle_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey};
1+
use anchor_lang::prelude::*;
22
use light_batched_merkle_tree::{
33
merkle_tree::BatchedMerkleTreeAccount,
44
rollover_state_tree::rollover_batched_state_tree_from_account_info,
@@ -18,7 +18,7 @@ use crate::{
1818
#[derive(Accounts)]
1919
pub struct RolloverBatchedStateMerkleTree<'info> {
2020
#[account(mut)]
21-
/// Signer used to receive rollover accounts rentexemption reimbursement.
21+
/// Signer used to receive rollover accounts rent exemption reimbursement.
2222
pub fee_payer: Signer<'info>,
2323
pub authority: Signer<'info>,
2424
pub registered_program_pda: Option<Account<'info, RegisteredProgram>>,

programs/account-compression/src/instructions/rollover_state_merkle_tree_and_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::{
2424
#[derive(Accounts)]
2525
pub struct RolloverStateMerkleTreeAndNullifierQueue<'info> {
2626
#[account(mut)]
27-
/// Signer used to receive rollover accounts rentexemption reimbursement.
27+
/// Signer used to receive rollover accounts rent exemption reimbursement.
2828
pub fee_payer: Signer<'info>,
2929
pub authority: Signer<'info>,
3030
pub registered_program_pda: Option<Account<'info, RegisteredProgram>>,

programs/account-compression/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ pub mod account_compression {
212212
/// 2. update address tree
213213
/// The address tree is updated with the instruction
214214
/// batch_update_address_tree.
215-
pub fn intialize_batched_address_merkle_tree<'info>(
215+
pub fn initialize_batched_address_merkle_tree<'info>(
216216
ctx: Context<'_, '_, '_, 'info, InitializeBatchedAddressMerkleTree<'info>>,
217217
bytes: Vec<u8>,
218218
) -> Result<()> {

programs/account-compression/src/processor/insert_nullifiers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ pub fn insert_nullifiers(
4242
for &(tree_index, queue_index) in &visited {
4343
// Lookup the queue and tree accounts
4444
let (queue_account, merkle_tree_account) =
45-
get_queue_and_tree_accounts(accounts, queue_index as usize, tree_index as usize)
46-
.unwrap();
45+
get_queue_and_tree_accounts(accounts, queue_index as usize, tree_index as usize)?;
4746

4847
// Dispatch to v1 / v2 / ... based on the account type
4948
match queue_account {

programs/account-compression/src/utils/check_account.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ pub fn check_account_balance_is_rent_exempt(
2121
return err!(AccountCompressionErrorCode::InvalidAccountSize);
2222
}
2323
let lamports = account_info.lamports();
24-
let rent_exemption = (Rent::get()?).minimum_balance(expected_size);
24+
let rent_exemption = Rent::get()?.minimum_balance(expected_size);
2525
if lamports != rent_exemption {
2626
msg!(
27-
"Account {:?} lamports is not equal to rentexemption: lamports {}, rent exemption {}",
27+
"Account {:?} lamports is not equal to rent exemption: lamports {}, rent exemption {}",
2828
account_info.key(),
2929
lamports,
3030
rent_exemption

0 commit comments

Comments
 (0)