Skip to content

DPOSv2.1 Fix Whitelist multiplier bug#978

Merged
aupiff merged 7 commits intomasterfrom
whitelist-tests
Apr 10, 2019
Merged

DPOSv2.1 Fix Whitelist multiplier bug#978
aupiff merged 7 commits intomasterfrom
whitelist-tests

Conversation

@gakonst
Copy link
Copy Markdown
Contributor

@gakonst gakonst commented Apr 10, 2019

When whitelist amounts were calculated in calculateShare, it'd proceed to call CalculatePreciseFraction. However, CalculatePreciseFraction was designed to not operate on billionths. Arguments are passed to it as billionths from CalculateFraction in dposv3 . This PR fixed this bug introduced in b6975b1#diff-318c73cfec571e534f934a4aa0224decR41

@gakonst gakonst changed the title add a test for the whitelist DPOSv2.1 Fix Whitelist multiplier bug Apr 10, 2019
Comment thread builtin/plugins/dposv2/util.go Outdated
return CalculatePreciseFraction(frac, total, granular)
}

// frac is expressed in basis points
Copy link
Copy Markdown
Contributor

@aupiff aupiff Apr 10, 2019

Choose a reason for hiding this comment

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

This comment is now outdated due to your change.

Comment thread builtin/plugins/dposv2/util.go
@aupiff aupiff self-requested a review April 10, 2019 19:04
Copy link
Copy Markdown
Contributor

@aupiff aupiff left a comment

Choose a reason for hiding this comment

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

LGTM

@aupiff aupiff merged commit c4d48c0 into master Apr 10, 2019
@aupiff aupiff deleted the whitelist-tests branch April 10, 2019 20:20
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.

2 participants