-
Notifications
You must be signed in to change notification settings - Fork 579
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
chore: remove OnChanUpgradeRestore
callbacks and discard state changes on app upgrade callbacks
#5696
Merged
damiannolan
merged 13 commits into
main
from
damian/5692-remove-restore-cb-discard-app-state
Jan 24, 2024
Merged
chore: remove OnChanUpgradeRestore
callbacks and discard state changes on app upgrade callbacks
#5696
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ee9ebf3
docs: remove refs to OnChanUpgradeRestore in docs
damiannolan 70284f1
testing: rm OnChanUpgradeRestore callback from mock app test helpers
damiannolan f83d3ca
chore: rm OnChanUpgradeRestore application callback from ibc core and…
damiannolan 1cb7661
chore: discard app state changes by using a cacheCtx and discarding w…
damiannolan 471cf8f
docs: add godoc notes to app callbacks discarding state changes
damiannolan 622bb96
test: adding unit tests for discarding app state changes
damiannolan 0d59063
chore: clean imports
damiannolan 0626a8f
Merge branch 'main' into damian/5692-remove-restore-cb-discard-app-state
damiannolan 28f55b4
chore: review suggestions for in-line docstring comments
damiannolan 55ee06e
chore: fix linting tests, add mock types for testing kv and events
damiannolan 2857ac3
doc: add more context to in-line docstrings
damiannolan fa83091
Merge branch 'main' into damian/5692-remove-restore-cb-discard-app-state
damiannolan e280929
Merge branch 'main' into damian/5692-remove-restore-cb-discard-app-state
damiannolan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would be nice to have the docstring above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a note that events will also not be emitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] I wonder is it worth adding a helper function to like
disposeContext()
to make it super clear we're not using a cacheCtx to maybe call it later, we're ensuring it is thrown away from the get go.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also might be nice to include the
why
for this docstring, I can see myself coming back to this later thinking "why did we do this again?" 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added additional context in the in-line docstrings!
I like the idea, but I feel like most cosmos devs are generally comfortable with the concept of the "cached context" and that terminology. It might be just introducing more cognitive load with a function which essentially just drops the
writeFn
. I think its clear what this is doing and I appreciate one less "go to definition" if I'm trying to verify code! Happy to discuss on an issue if there's appetite for changing it