-
Notifications
You must be signed in to change notification settings - Fork 257
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
#1905: Implement LP Actions Skeleton #2115
Merged
Merged
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
Tracking the position nonces was a red herring, because what we really care about is that the position ID is used only once -- the nonce is just used as a way to ensure that it's possible to create more than one position with the same trading function.
The LpNft is only ever tracked by the client in their private state, it's never used by the public part of the state machine, except as part of the value balance checks for the transaction, so the state machine never has to work with an LpNft.
We want to do all of the stateless checks in one place, and we also want to do as little work as possible in `execute`, which runs serially.
This commit fills in the position withdrawal implementation, and also reorganizes the code in the PositionManager trait, so that it's largely moved into the body of the ActionHandlers. The PositionManager now has a single method, `put_position`, which handles invalidating existing indexes and writing new ones.
We want to check that this is the case, so that we can unconditionally delete indexes in the PositionManager.
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.
This adds skeleton code and disabled partial implementations for LP actions to both
pcli
andpd
.