Skip to content

fix: use correct PDA in "Initializes another counter" test#162

Open
beck042 wants to merge 1 commit intomagicblock-labs:mainfrom
beck042:beck042-patch-1
Open

fix: use correct PDA in "Initializes another counter" test#162
beck042 wants to merge 1 commit intomagicblock-labs:mainfrom
beck042:beck042-patch-1

Conversation

@beck042
Copy link

@beck042 beck042 commented Mar 24, 2026

Summary

Fixes incorrect PDA usage in the "Initializes another counter" test.

Problem

The test calls initializeOther(), which initializes a counter using a different seed (TEST_PDA_SEED_OTHER). However, the test was reading and validating the original PDA derived from TEST_PDA_SEED.

As a result, the test could pass even if initializeOther() was broken, since it did not actually verify the correct account.

Solution

  • Added a second PDA (pdaOther) derived from TEST_PDA_SEED_OTHER
  • Updated the test to use pdaOther for account checks and state validation

Summary by CodeRabbit

  • Tests
    • Extended the delegation test suite to validate multiple account scenarios and comprehensive operational workflows
    • Strengthened account initialization and state consistency verification across delegation test cases
    • Improved test diagnostics with enhanced logging output and console visibility for better debugging
    • Added comprehensive validation checks for account existence and complete lifecycle management verification

## Summary

Fixes incorrect PDA usage in the "Initializes another counter" test.

## Problem

The test calls `initializeOther()`, which initializes a counter using a different seed (`TEST_PDA_SEED_OTHER`). However, the test was reading and validating the original PDA derived from `TEST_PDA_SEED`.

As a result, the test could pass even if `initializeOther()` was broken, since it did not actually verify the correct account.

## Solution

- Added a second PDA (`pdaOther`) derived from `TEST_PDA_SEED_OTHER`
- Updated the test to use `pdaOther` for account checks and state validation

## Result

- The test now correctly validates the behavior of `initializeOther()`
- Prevents false positives
- Improves overall test reliability
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1e1fc74b-94a9-4482-8672-431a6842a13b

📥 Commits

Reviewing files that changed from the base of the PR and between d2fe487 and 17713b3.

📒 Files selected for processing (1)
  • tests/integration/tests/test-delegation.ts

📝 Walkthrough

Walkthrough

The change introduces a second PDA seed constant (SEED_TEST_PDA_OTHER) and derives a corresponding pdaOther within the delegation test file. The "Initializes another counter" test is updated to use this new PDA for account existence checks, counter fetching, and logging operations, replacing all references to the original pda with pdaOther.

Suggested reviewers

  • GabrielePicco
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant