diff --git a/programs/account-compression/src/instructions/append_leaves.rs b/programs/account-compression/src/instructions/append_leaves.rs index e282c4bf29..62622c250b 100644 --- a/programs/account-compression/src/instructions/append_leaves.rs +++ b/programs/account-compression/src/instructions/append_leaves.rs @@ -30,7 +30,7 @@ impl GroupAccess for StateMerkleTreeAccount { &self.metadata.access_metadata.owner } - fn get_delegate(&self) -> &Pubkey { + fn get_program_owner(&self) -> &Pubkey { &self.metadata.access_metadata.program_owner } } diff --git a/programs/account-compression/src/state/access.rs b/programs/account-compression/src/state/access.rs index 7683317b39..be28134a0b 100644 --- a/programs/account-compression/src/state/access.rs +++ b/programs/account-compression/src/state/access.rs @@ -5,8 +5,7 @@ use anchor_lang::prelude::*; pub struct AccessMetadata { /// Owner of the Merkle tree. pub owner: Pubkey, - // TODO: clean up all mention of delegate - /// Delegate of the Merkle tree. This will be used for program owned Merkle trees. + /// Program owner of the Merkle tree. This will be used for program owned Merkle trees. pub program_owner: Pubkey, } diff --git a/programs/account-compression/src/state/address.rs b/programs/account-compression/src/state/address.rs index a991020d47..84a0709845 100644 --- a/programs/account-compression/src/state/address.rs +++ b/programs/account-compression/src/state/address.rs @@ -23,8 +23,7 @@ impl GroupAccess for AddressMerkleTreeAccount { fn get_owner(&self) -> &Pubkey { &self.metadata.access_metadata.owner } - // TODO: rename to get_program_owner - fn get_delegate(&self) -> &Pubkey { + fn get_program_owner(&self) -> &Pubkey { &self.metadata.access_metadata.program_owner } } diff --git a/programs/account-compression/src/state/merkle_tree.rs b/programs/account-compression/src/state/merkle_tree.rs index cc50aa4bfd..34a834e444 100644 --- a/programs/account-compression/src/state/merkle_tree.rs +++ b/programs/account-compression/src/state/merkle_tree.rs @@ -13,7 +13,6 @@ pub struct MerkleTreeMetadata { pub next_merkle_tree: Pubkey, } -// TODO: unit test impl MerkleTreeMetadata { pub fn init( &mut self, diff --git a/programs/account-compression/src/state/queue.rs b/programs/account-compression/src/state/queue.rs index 358f5563db..d4a856a3ea 100644 --- a/programs/account-compression/src/state/queue.rs +++ b/programs/account-compression/src/state/queue.rs @@ -36,7 +36,6 @@ pub fn check_queue_type(queue_type: &u64, expected_queue_type: &QueueType) -> Re Ok(()) } } -// TODO: unit test impl QueueMetadata { pub fn init( &mut self, @@ -96,7 +95,7 @@ impl GroupAccess for QueueAccount { &self.metadata.access_metadata.owner } - fn get_delegate(&self) -> &Pubkey { + fn get_program_owner(&self) -> &Pubkey { &self.metadata.access_metadata.program_owner } } diff --git a/programs/account-compression/src/utils/check_signer_is_registered_or_authority.rs b/programs/account-compression/src/utils/check_signer_is_registered_or_authority.rs index 3ee81095b1..da4b32e817 100644 --- a/programs/account-compression/src/utils/check_signer_is_registered_or_authority.rs +++ b/programs/account-compression/src/utils/check_signer_is_registered_or_authority.rs @@ -5,7 +5,7 @@ use super::constants::CPI_AUTHORITY_PDA_SEED; pub trait GroupAccess { fn get_owner(&self) -> &Pubkey; - fn get_delegate(&self) -> &Pubkey; + fn get_program_owner(&self) -> &Pubkey; } pub trait GroupAccounts<'info> { diff --git a/programs/system/src/invoke_cpi/verify_signer.rs b/programs/system/src/invoke_cpi/verify_signer.rs index 1f3d23864c..0792c7749d 100644 --- a/programs/system/src/invoke_cpi/verify_signer.rs +++ b/programs/system/src/invoke_cpi/verify_signer.rs @@ -288,36 +288,4 @@ mod test { Err(SystemProgramError::WriteAccessCheckFailed.into()) ); } - - // #[test] - // fn test_check_program_owner_state_merkle_tree() { - // let authority = Pubkey::new_unique(); - // let mut state_merkle_tree_account = StateMerkleTreeAccount::default(); - // state_merkle_tree_account - // .metadata - // .access_metadata - // .program_owner = authority; - // let mut lamports = 0; - // let merkle_tree_pubkey = Pubkey::new_unique(); - // let account_info = AccountInfo::new( - // &merkle_tree_pubkey, - // false, - // false, - // &mut lamports, - // &mut state_merkle_tree_account.try_into().unwrap(), - // &authority, - // false, - // 0, - // ); - - // assert_eq!( - // check_program_owner_state_merkle_tree(&account_info, &Some(authority)), - // Ok((0, None, 1)) - // ); - - // assert_eq!( - // check_program_owner_state_merkle_tree(&account_info, &None), - // Err(SystemProgramError::InvalidMerkleTreeOwner.into()) - // ); - // } } diff --git a/programs/system/src/sdk/accounts.rs b/programs/system/src/sdk/accounts.rs index 01d2dd2211..3f19fbe938 100644 --- a/programs/system/src/sdk/accounts.rs +++ b/programs/system/src/sdk/accounts.rs @@ -15,8 +15,3 @@ pub trait SignerAccounts<'info> { fn get_fee_payer(&self) -> &Signer<'info>; fn get_authority(&self) -> &Signer<'info>; } - -// pub trait InvokeCpiAccounts<'info> { -// fn get_invoking_program(&self) -> &UncheckedAccount<'info>; -// fn get_cpi_context_account(&mut self) -> &mut Option>; -// }