You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PDA Handling Might Be Off with Different Token Programs in Escrow Tests
Issue
In the escrow tests (./tests/escrow/tests/escrow.ts), I noticed something odd when using different token programs (TOKEN_PROGRAM_ID and TOKEN_2022_PROGRAM_ID). The tests seem to use the same Program Derived Address (PDA) for both, even though they have distinct IDs. This feels like it could cause issues if each program is supposed to have its own PDA.
How to Reproduce
Run the escrow tests using both token programs.
You'll see that the PDA is the same in both cases, which might be wrong when initializing escrow and handling token accounts.
Why This Might Be a Problem
If the PDA should be different for each token program, we could end up with conflicts around ownership or authority during token transfers or other actions, especially when both token programs are in play.
What Could Fix It
We might need to derive separate PDAs for each token program to keep things clean and avoid any potential authority mix-ups.
Context
The key parts in the tests that seem affected:
Deriving the PDA during Initialize escrow and Exchange escrow.
The way token programs are passed in during the RPC calls might need to reflect the difference between the two programs better.
Let me know if you think this is a valid concern or if I’m missing something about how PDAs work here!
The text was updated successfully, but these errors were encountered:
PDA Handling Might Be Off with Different Token Programs in Escrow Tests
Issue
In the escrow tests (
./tests/escrow/tests/escrow.ts
), I noticed something odd when using different token programs (TOKEN_PROGRAM_ID
andTOKEN_2022_PROGRAM_ID
). The tests seem to use the same Program Derived Address (PDA) for both, even though they have distinct IDs. This feels like it could cause issues if each program is supposed to have its own PDA.How to Reproduce
Why This Might Be a Problem
If the PDA should be different for each token program, we could end up with conflicts around ownership or authority during token transfers or other actions, especially when both token programs are in play.
What Could Fix It
We might need to derive separate PDAs for each token program to keep things clean and avoid any potential authority mix-ups.
Context
The key parts in the tests that seem affected:
Initialize escrow
andExchange escrow
.Let me know if you think this is a valid concern or if I’m missing something about how PDAs work here!
The text was updated successfully, but these errors were encountered: