feat: id attribute to account#3982
feat: id attribute to account#3982Otter-0x4ka5h wants to merge 2 commits intosolana-foundation:masterfrom
Conversation
|
Someone is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
| /// **Usage:** `id = <EXPR>` | ||
| /// | ||
| /// **SECURITY WARNING:** | ||
| /// This parameter is ONLY intended for doctests and test code. |
There was a problem hiding this comment.
I'm not necessarily sure if introducing a new dangerous feature is the solution to a doctest issue. I think at minimum it should be gated and only enabled when building for tests.
Ideally though we'd find a way to make this just work without them needing to know about this special feature
There was a problem hiding this comment.
Yeah, i thought the same atm but we can't gate it to test-only((proc macros can't detect context) or doctests cfgs found.
We can just let them use namespace in doctests, but that skips owner trait + cant show declare_id! pattern.
There was a problem hiding this comment.
Should I revert all the id parameter changes and just document the namespace workaround instead?
There was a problem hiding this comment.
I'm going to investigate ways of making it work as-is first I think
|
Done in #3988 |
The implementation also demonstrating
declare_id!in doctests!Closes #3942