-
Notifications
You must be signed in to change notification settings - Fork 43
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 Host::has_frame #1244
Merged
Merged
Add Host::has_frame #1244
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
leighmcculloch
added a commit
to stellar/rs-soroban-sdk
that referenced
this pull request
Nov 22, 2023
dmkozh
approved these changes
Nov 22, 2023
github-merge-queue bot
pushed a commit
to stellar/rs-soroban-sdk
that referenced
this pull request
Nov 22, 2023
### What Restore previous auth state in client after client finishes invoke. ### Why The client is presented in such a way that it looks like invocations with a client that has been configured with certain auth will apply the auth only during invocations with it. It's unintuitive that the auths from the client apply forever after the invocation. Close #1084 Dependent on: - stellar/rs-soroban-env#1244
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Add a method to the host for determining if the host currently has a frame on the stack.
Why
In several places in the SDK it would be ideal if we could error if a function is used inside or outside of a contract function, because doing so would be invalid.
In some code being added or auth tracking in the SDK I need to reliable know if we are inside a contract function or not.
I tried to do this using top invocation hooks, but the way native contract functions get called in the SDK doesn't pass through anything from the Env that is available outside of the contract. We can sort of know if we're in a contract, but it isn't guaranteed to be correct in edge cases. We might change that some day, but at the moment that limitation exists.
Exposing whether the host currently has a frame is a simple way the host can indicate to SDK test utilities if it is currently in a contract function or not.
Close stellar/rs-soroban-sdk#1084