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

auction: dex-enabled check during LP allocation #4621

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

erwanor
Copy link
Member

@erwanor erwanor commented Jun 14, 2024

Describe your changes

Close #4599

Checklist before requesting a review

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    Consensus breaking, does not require a migration.

@erwanor erwanor added consensus-breaking breaking change to execution of on-chain data A-dex Area: Relates to the dex A-auction Area: Relates to the auction component labels Jun 14, 2024
@erwanor erwanor added this to the Sprint 8 milestone Jun 14, 2024
@erwanor erwanor requested review from zbuc and cratelyn June 14, 2024 22:32
@erwanor erwanor self-assigned this Jun 14, 2024
@erwanor erwanor changed the title auction: move dex component check out of action handlers auction: dex-enabled check during LP allocation Jun 15, 2024
@erwanor erwanor requested a review from conorsch June 17, 2024 18:18
.get_raw(&state_key::position_by_id(id))
.await?
.is_some())
async fn check_position_by_id(&self, id: &position::Id) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the change to a raw bool return type? With this change, we must use expect which will panic rather than return an error which can be handled more gracefully by callers.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is infallible unless the application state is corrupted, in that case there are no way to recover, so we do want to stop everything. So in effect, the Result here is superfluous, on the other hand it has a real cost of making the API unwieldy.

@erwanor erwanor merged commit e927d6c into main Jun 20, 2024
13 checks passed
@erwanor erwanor deleted the erwan/4599_auction_dexnabled branch June 20, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-auction Area: Relates to the auction component A-dex Area: Relates to the dex consensus-breaking breaking change to execution of on-chain data
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

auction: dex-enabled check ahead of allocating an LP
3 participants