Merged
Conversation
055ad88 to
9b89be2
Compare
f1075d8 to
0fc7085
Compare
nialexsan
approved these changes
Mar 2, 2026
Contributor
nialexsan
left a comment
There was a problem hiding this comment.
this would need a redeployment with a new name or to a new address
zhangchiqing
reviewed
Mar 3, 2026
| } | ||
| } | ||
| if let cap = self._executionCallback { | ||
| if cap.check() { |
Member
There was a problem hiding this comment.
if cap.check() == false, would it be possible for it become true again? if not, does it make sense to set self_executionCallback = nil, so that next time the check can be skipped.
Member
Author
There was a problem hiding this comment.
This test transaction passes:
// 1. Store resource and issue capability
let box <- Counter.createTestBox()
acct.storage.save(<- box, to: Counter.TestBoxStoragePath)
let cap = acct.capabilities.storage.issue<&Counter.TestBox>(Counter.TestBoxStoragePath)
assert(cap.check(), message: "cap.check() should be true when resource is stored")
// 2. Move resource out
let box2 <- acct.storage.load<@Counter.TestBox>(from: Counter.TestBoxStoragePath)!
assert(!cap.check(), message: "cap.check() should be false when resource was moved out")
// 3. Move resource back
acct.storage.save(<- box2, to: Counter.TestBoxStoragePath)
assert(cap.check(), message: "cap.check() should be true when resource is moved back")so it is possible to become true again.
Member
|
LGTM, some minor suggestions |
simplify cap.borrow Co-authored-by: Leo Zhang <[email protected]>
bde6921 to
2acbb04
Compare
This file contains hidden or 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
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.
Add an optional callback for the autobalancer, necessary to recover stuck vaults in FlowYieldVaults in an optimized way.
This was intentionally left out of the constructor to maintain backward compatibility.