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.
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
Refactor
lock
method #1936Refactor
lock
method #1936Changes from all commits
639178c
c9bfaeb
d0cfc31
6413243
15b4bcb
73643bd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This looks wrong? addTokenToLock did more, e.g. handling of the main accumulation store? Why was this deleted?
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.
Oh the claim is that all functionality is there between the synth lock line, and lock.
Why not keep
addTokenToLock
and just have that function as a subcomponent calllock
? (But retain the synth lock functionality)That would be maintaining the standard in this package of having the exported method be doing validation logic & hook / return type logic, and the private method doing the state change
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 still don't fully follow the logic here. There are two calls that
addTokenToLock
makes that are not related to the synth lock related accumulation store update, which are:setLock
to update state with the new lock instance:osmosis/x/lockup/keeper/lock.go
Line 100 in 8f018a6
accumulationStore
:osmosis/x/lockup/keeper/lock.go
Line 106 in 8f018a6
How/where are these being accounted for in the new implementation?
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.
Oops, I see the
lock
call above now. The change that adds an addition parameter tolock
also makes sense now. Clever refactor :)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.
@ValarDragon wdym by ? Are you referring to synth lock accumulation store part?
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.
Does it make sense to do either or both:
CreateLock
that would cover the removed logicexport_test.go
trick that will allow us tolock
for tests only andlock
methodThere 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.
Ah missed the tests! thanks for catching this! Just added this in the most recent commit!