Skip to content
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: assign pool fee id during propose #1706

Merged
merged 2 commits into from
Jan 30, 2024
Merged

Conversation

wischli
Copy link
Contributor

@wischli wischli commented Jan 30, 2024

Description

Adding a pool fee to an existing pool is a two step process of proposing and applying (after success of the ChangeGuard). Right now, the pool fee id is assigned as part of the second step such that it is unknown in between proposing and applying. This PR fixes this by assigning an id already during the proposing step. The id is exposed via the Proposed event dispatch.

Another benefit from this refactor is that two same PoolFeeInfos are now encoded as a unique Change. Beforehand, they would have been the same which is an uncaught error.

Checklist:

  • I have added Rust doc comments to structs, enums, traits and functions
  • I have made corresponding changes to the documentation
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works

@wischli wischli added I3-annoyance The code behaves as expected, but "expected" is an issue. D2-notify Pull request can be merged and notification about changes should be documented. labels Jan 30, 2024
@wischli wischli added this to the Centrifuge 1025 milestone Jan 30, 2024
@wischli wischli self-assigned this Jan 30, 2024
@wischli wischli requested a review from mustermeiszer January 30, 2024 14:57
Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@lemunozm lemunozm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wischli wischli merged commit f7e1232 into main Jan 30, 2024
9 checks passed
@wischli wischli deleted the refactor/pool-fee-id branch January 30, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D2-notify Pull request can be merged and notification about changes should be documented. I3-annoyance The code behaves as expected, but "expected" is an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants