chore: remove sdk deps from programs, add detection to lint#2188
chore: remove sdk deps from programs, add detection to lint#2188SwenSchaeferjohann merged 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughIntroduces a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
sdk-libs/sdk-types/src/instruction/tree_info.rs (1)
28-46: Remove the unusedClonebound to avoid unnecessary constraints (Lines 31-40).
The method never clonesT, so the extra bound just restricts implementors.♻️ Suggested refinement
- fn get_tree_pubkey<T: AccountInfoTrait + Clone>( + fn get_tree_pubkey<T: AccountInfoTrait>( &self, cpi_accounts: &impl TreeAccounts<T>, ) -> Result<T::Pubkey, crate::error::LightSdkTypesError>;- fn get_tree_pubkey<T: AccountInfoTrait + Clone>( + fn get_tree_pubkey<T: AccountInfoTrait>( &self, cpi_accounts: &impl TreeAccounts<T>, ) -> Result<T::Pubkey, crate::error::LightSdkTypesError> {
🤖 Fix all issues with AI agents
In `@program-libs/compressed-account/src/address.rs`:
- Around line 5-7: The AddressSeed struct currently derives PartialEq but not
Eq; since it is Copy and contains only [u8; 32] (which implements Eq), update
the derive attribute for AddressSeed to include Eq (i.e., change #[derive(Debug,
PartialEq, Clone, Copy)] to #[derive(Debug, PartialEq, Eq, Clone, Copy)]) so the
type fully implements equality semantics and can be used more idiomatically in
places requiring Eq.
In `@program-libs/compressed-account/src/constants.rs`:
- Around line 13-16: Add a unit test in programs/system/src/constants.rs that
derives the CPI authority PDA and asserts it equals the hardcoded
ACCOUNT_COMPRESSION_AUTHORITY_PDA: call
find_program_address(&[CPI_AUTHORITY_PDA_SEED],
&ACCOUNT_COMPRESSION_PROGRAM_ID).0, convert/compare the derived Pubkey to
ACCOUNT_COMPRESSION_AUTHORITY_PDA and assert equality, ensuring the test name
clearly states it verifies the hardcoded address matches on-chain derivation
(e.g., test_account_compression_authority_address_match).
4e2927e to
4d77a9d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@programs/compressed-token/program/tests/mint.rs`:
- Line 174: Move the inline import of PackedMerkleContext out of the test
function into the file's top-level imports to match the existing
light_compressed_account imports; locate the inline use statement referencing
light_compressed_account::compressed_account::PackedMerkleContext in the mint.rs
test and add it to the module-level use block alongside the other
light_compressed_account imports (keeping the same path and name
PackedMerkleContext) and remove the redundant inline import from the test
function.
♻️ Duplicate comments (1)
program-libs/compressed-account/src/constants.rs (1)
3-16: Add a derivation test for the hardcoded CPI authority PDA.
The hardcodedACCOUNT_COMPRESSION_AUTHORITY_PDAis used for runtime validation; a test that derives the PDA from the seed and program ID would prevent silent drift.
Summary by CodeRabbit
New Features
Deprecations
SYSTEM_PROGRAM_IDdeprecated — useLIGHT_SYSTEM_PROGRAM_ID.Chores
✏️ Tip: You can customize this high-level summary in your review settings.