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

460 take token decimals into account for price conversions in treasury buyout #461

Conversation

bogdanS98
Copy link
Contributor

@bogdanS98 bogdanS98 commented May 8, 2024

Closes #460.

Spacewalk dependencies were updated because these changes were needed.

@bogdanS98 bogdanS98 marked this pull request as ready for review May 9, 2024 12:29
@bogdanS98 bogdanS98 requested a review from a team May 9, 2024 12:31
@bogdanS98
Copy link
Contributor Author

Tested buyouts with chopsticks (Pendulum) by exchanging DOT (10 decimals) for PEN (12 decimals):

Using buyout amount of 0.1 PEN as input:
image
Using exchange amount of 0.001 DOT as input:
image

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Let's also replace the DecimalsLookup that we define for the oracle to point to the new custom implementation, e.g. here.

node/Cargo.toml Outdated Show resolved Hide resolved
pallets/treasury-buyout-extension/src/mock.rs Outdated Show resolved Hide resolved
pallets/treasury-buyout-extension/src/tests.rs Outdated Show resolved Hide resolved
pallets/treasury-buyout-extension/src/tests.rs Outdated Show resolved Hide resolved
pallets/treasury-buyout-extension/src/tests.rs Outdated Show resolved Hide resolved
runtime/amplitude/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me 👍

@bogdanS98 bogdanS98 merged commit 0ac14ea into main May 13, 2024
2 checks passed
@bogdanS98 bogdanS98 deleted the 460-take-token-decimals-into-account-for-price-conversions-in-treasury-buyout branch May 13, 2024 17:51
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.

Take token decimals into account for price conversions in treasury buyout
2 participants