Document constructor auth for register/register_at#2666
Conversation
|
Preview is available here: |
Clarify the behavior of authorization in constructors and note the version consistency of the soroban-sdk.
|
Preview is available here: |
1 similar comment
|
Preview is available here: |
|
Heads up: rs-soroban-sdk#1943 merged today, fixing the remaining gap this section's caveat/version note doesn't yet account for — native (non-Wasm, directly-registered So as of the two merged fixes, the behavior is now uniform across register/register_at × Wasm/native — no native-specific caveat needed, and the "deploy in test using standard deployment functions after being built to Wasm" note in this PR's diff may no longer be accurate as a caveat for auth-in-constructors specifically. Opened #2677 independently with wording that accounts for both fixes (and avoids guessing a specific unreleased version number, since v27.0.1 is still the latest published release). Feel free to take whichever of the two is preferred — happy to close #2677 if you'd rather fold this into #2666, or vice versa. Generated by Claude Code |
There was a problem hiding this comment.
Pull request overview
Documents constructor authorization behavior in SDK test environments.
Changes:
- Explains recording-auth behavior for
registerandregister_at. - Recommends Wasm deployment for production-faithful testing.
- Notes consistency beginning with v27.0.2.
Recommendation: MERGE-READY — one non-blocking grammar correction is noted.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Preview is available here: |
ElliotFriend
left a comment
There was a problem hiding this comment.
this is a great addition!
i added a suggestion that might make the first part of this a little easier to read and understand. feel free to take it or adapt it.
thanks!!
Co-authored-by: Elliot Voris <elliot@stellar.org>
|
Preview is available here: |
What
Add a new "Authorization in constructors" section to the Test Authorization guide explaining that both
env.register(...)andenv.register_at(...)switch the test environment to recording-auth mode for the duration of a Wasm contract's constructor invocation, so a constructor callingrequire_auth()succeeds withoutmock_all_auths(), and note the current caveat that this does not apply to native/mock contracts registered for testing.Why
As a result of the following issue and related changes its good to discuss this here:
register_atdoes not switch to recording auth for WASM constructors rs-soroban-sdk#1738