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

GrantFund events to use BigDecimal for decimal amounts #47

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

EdNoepel
Copy link
Contributor

@EdNoepel EdNoepel commented Aug 9, 2023

Improves consistency with pool events, which use BigDecimals rather than the raw WAD values.
Also added distributionId field to DistributionPeriod, for comparison to onchain values.

@EdNoepel EdNoepel requested a review from MikeHathaway August 9, 2023 15:28
Copy link
Contributor

@MikeHathaway MikeHathaway left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -43,6 +43,7 @@ export function loadOrCreateDistributionPeriod(distributionId: Bytes): Distribut
if (distributionPeriod == null) {
// create new distributionPeriod if one hasn't already been stored
distributionPeriod = new DistributionPeriod(distributionId) as DistributionPeriod
distributionPeriod.distributionId = bytesToBigInt(distributionId)
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to just pass the raw distributionId to this method instead of converting back - wondering how accurate the bytes conversion is

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 thought about that, but there's a local distributionId bytes in all the callers which is used for other purposes. I'll create another local distributionIdRaw on the stack and see how that looks.

Copy link
Contributor Author

@EdNoepel EdNoepel Aug 9, 2023

Choose a reason for hiding this comment

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

Did this as PR #48.

@EdNoepel EdNoepel merged commit e268a11 into develop Aug 9, 2023
@EdNoepel EdNoepel deleted the vote-weight-bd branch August 9, 2023 16:57
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