Skip to content

Conversation

@Ad96el
Copy link
Contributor

@Ad96el Ad96el commented Nov 22, 2024

Fixes #3685

Some clean-ups:

Fixed-point numbers are rounded. When minting, the requested amount and the calculated collateral are rounded up, while during burning, they are rounded down. This ensures that there is always sufficient collateral during burning.

Some errors have been mapped.

@Ad96el Ad96el changed the title Pallet bonded coins cleanups fix: fix unit tests Nov 26, 2024
@Ad96el Ad96el changed the title fix: fix unit tests fix: unit tests Nov 26, 2024
@Ad96el Ad96el marked this pull request as ready for review November 26, 2024 13:25
@Ad96el Ad96el requested review from ntn-x2 and rflechtner November 26, 2024 13:26
Copy link
Contributor

@rflechtner rflechtner left a comment

Choose a reason for hiding this comment

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

The two rounding functions have very similar tasks, can we give them similar names?

Copy link
Contributor

@rflechtner rflechtner left a comment

Choose a reason for hiding this comment

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

u 🪨 !

@rflechtner rflechtner merged commit 2059e00 into pallet_bonded_coins Nov 26, 2024
7 of 12 checks passed
@rflechtner rflechtner deleted the pallet_bonded_coins_cleanups branch November 26, 2024 16:06
@ntn-x2
Copy link
Contributor

ntn-x2 commented Nov 27, 2024

Is it me or this PR also contains changes from a different PR? I see a new line added for the CollateralIsZero error, which should not be part of this test PR, right?

@Ad96el
Copy link
Contributor Author

Ad96el commented Nov 27, 2024

Yes, I combined two smaller PRs here. The changes are intendant.

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