-
Notifications
You must be signed in to change notification settings - Fork 55
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
Allow swapping AutoCompounding shares for ManualReward shares (and the other way around) #273
Conversation
Master coverage: 71.90% |
So a couple of things missing on this PR yet, so that we dont forget:
|
) -> DispatchResultWithPostInfo { | ||
// Converts amount to shares of the correct pool | ||
let old_shares = match (amount, source_pool) { | ||
(SharesOrStake::Shares(s), _) => s, |
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.
is this supposed to cover shares from joining or leaving pools? what would happen in this case?
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.
Ah never mind, target pool only contains automcpounding and manual rewards. So its only to cover cases in which the amount is given as shares
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'm happy with the way the PR looks, but I think we should add benchmark + integration tests before merging
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 think if we add a simple typescript test we this PR can get merged
Co-authored-by: girazoki <[email protected]>
Currently a delegator needs to undelegate and delegate again to change in which pool their stake is, which takes time as they need to wait for the joining and leaving delays. However there is no security risk in changing pool, so it should be instant instead. This PR adds a new call to go from one pool to another, with the dust from joining the target pool considered leaving stake.
TODO: Benchmark