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

Add hooks for enter and exit of top-level call host fn #1218

Closed
leighmcculloch opened this issue Nov 16, 2023 · 0 comments · Fixed by #1219
Closed

Add hooks for enter and exit of top-level call host fn #1218

leighmcculloch opened this issue Nov 16, 2023 · 0 comments · Fixed by #1219
Assignees

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Nov 16, 2023

What

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.

Blocking:

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

Successfully merging a pull request may close this issue.

3 participants
@leighmcculloch @dmkozh and others