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

[Bug]: panic when totalPreviousPower is zero #336

Open
jasonsong0 opened this issue Nov 25, 2024 · 0 comments
Open

[Bug]: panic when totalPreviousPower is zero #336

jasonsong0 opened this issue Nov 25, 2024 · 0 comments
Assignees

Comments

@jasonsong0
Copy link

Summary of Bug

It is unclear when totalPreviousPower becomes 0, but if it does, a panic could occur.

powerMultiplier := math.LegacyNewDec(nativeTotalPower).QuoTruncate(math.LegacyNewDec(totalPreviousPower))

Since there is a routine that handles cases where it is 0, it would be better to either let the handling occur after the code or move the zero check to an earlier point in the code.

if totalPreviousPower == 0 {

Version

v0.50.8/multi-asset-staking-poc

Steps to Reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants