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

NTRN-323 Feat: Add dex pause dao logic #106

Merged
merged 9 commits into from
Jul 31, 2024
Merged

NTRN-323 Feat: Add dex pause dao logic #106

merged 9 commits into from
Jul 31, 2024

Conversation

jcompagni10
Copy link
Contributor

@jcompagni10 jcompagni10 commented Jun 13, 2024

@jcompagni10 jcompagni10 changed the title basic update dex param scaffolding NTRN-323 Feat: Add dex pause dao logic Jun 13, 2024
@pr0n00gler
Copy link
Collaborator

Please attach a successful testrun

@jcompagni10
Copy link
Contributor Author

jcompagni10 commented Jul 17, 2024

.ok_or(ContractError::Unauthorized {})?;

let dex_params = get_dex_params(deps, ParamsRequestDex {})?;
// TODO: do this through iteration instead of ifs for future proofing new params
Copy link
Contributor

Choose a reason for hiding this comment

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

please resolve it somehow

Copy link
Contributor

Choose a reason for hiding this comment

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

As written in TODO, I don't like it since we will need to upgrade the contract with changes to params of dex. And because it's not an instant process, it's gonna be a pain.
I would suggest the following.
Convert dex_params to slice of (string, string) values as well as msg_update_params, assign it the pause param from the message, and then check that all fields exactly match.
WDYT? Not sure if it's easy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree it's a bit annoying. But as far as I know, there is no easy way to iterate through a rust struct with arbitrary keys. We could do this by marshalling with serde but it starts to get pretty ugly.
Also, if new dex params are added we would still have to update the contract to change the allow strategies and struct for retrieving dex params. So I don't think it's terrible

@jcompagni10
Copy link
Contributor Author

@pr0n00gler pr0n00gler merged commit cc590b9 into main Jul 31, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants