Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to execute an instruction with PDA signed using framework LocalEnvironment? #36

Open
bhcsayx opened this issue Dec 20, 2022 · 1 comment

Comments

@bhcsayx
Copy link
Contributor

bhcsayx commented Dec 20, 2022

I am currently doing some tests on Anchor programs and found that sometimes they may need a PDA signed to invoke certain instructions, for Solana official APIs we have invoke_signed() which allows passing PDA seeds into it such as workshop level0 examples:
image
However the execute_as_transaction() API for LocalEnvironment only allows keypairs, I am wondering if there is anything for it to allow similar functions? Thank you very much!

@tlambertz
Copy link

That would be a great feature to have!

Unfortunately, I think it requires quite a bit of rework to support. The way the transactions are currently passed into the solana runtime requires private keys to attach signatures. That makes using faking PDA signatures impossible right now. You'd have to enter the runtime where you can just say "this account has signed" without having signatures.

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

No branches or pull requests

2 participants