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
Add hooks for enter and exit of top-level call host fn
Why
In rs-soroban-sdk#1158 we're adding auth to test snapshots so that after a test is run there's a snapshot of all the auths that have happened during the test on the environment. However, the host only stores auths for the last top-level call. The SDK will use the exit hook to take a snapshot of the auths and store them in the Env for later use when the test snapshot is generated.
Also, the SDK has some functions that only work inside a contract. It'd be helpful in the SDK if we could detect when we're not in a contract when those functions are called so we can display error messages that are more meaningful to SDK users rather than simply surface Host error messages. Enter and exit hooks of top-level calls would allow the SDK to track if we're inside a contract or not.
What
Add hooks for enter and exit of top-level
call
host fnWhy
In rs-soroban-sdk#1158 we're adding auth to test snapshots so that after a test is run there's a snapshot of all the auths that have happened during the test on the environment. However, the host only stores auths for the last top-level call. The SDK will use the exit hook to take a snapshot of the auths and store them in the Env for later use when the test snapshot is generated.
Also, the SDK has some functions that only work inside a contract. It'd be helpful in the SDK if we could detect when we're not in a contract when those functions are called so we can display error messages that are more meaningful to SDK users rather than simply surface Host error messages. Enter and exit hooks of top-level calls would allow the SDK to track if we're inside a contract or not.
Blocking:
The text was updated successfully, but these errors were encountered: