-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP: reduce proof's file size #15
base: main
Are you sure you want to change the base?
WIP: reduce proof's file size #15
Conversation
// Remove metadata object to reduce output file size | ||
Object.values(recipientsWithProofs).forEach( | ||
(recipientData) => (recipientData.metadata = {}) | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this removal be done in the scraper instead of here?
.object({ | ||
amountBreakdown: yup | ||
.object({ | ||
welcomeTravelerRewards: yup | ||
.string() | ||
.test(testIsPositiveBigNumberish) | ||
.default("0"), | ||
earlyUserRewards: yup | ||
.string() | ||
.test(testIsPositiveBigNumberish) | ||
.default("0"), | ||
welcomeTravelerRewards: yup.string().test(testIsPositiveBigNumberish), | ||
earlyUserRewards: yup.string().test(testIsPositiveBigNumberish), | ||
liquidityProviderRewards: yup | ||
.string() | ||
.test(testIsPositiveBigNumberish) | ||
.default("0"), | ||
communityRewards: yup | ||
.string() | ||
.test(testIsPositiveBigNumberish) | ||
.default("0"), | ||
referralRewards: yup | ||
.string() | ||
.test(testIsPositiveBigNumberish) | ||
.default("0"), | ||
opRewards: yup | ||
.string() | ||
.test(testIsPositiveBigNumberish) | ||
.default("0"), | ||
arbRewards: yup | ||
.string() | ||
.test(testIsPositiveBigNumberish) | ||
.default("0") | ||
.test(testIsPositiveBigNumberish), | ||
communityRewards: yup.string().test(testIsPositiveBigNumberish), | ||
referralRewards: yup.string().test(testIsPositiveBigNumberish), | ||
opRewards: yup.string().test(testIsPositiveBigNumberish), | ||
arbRewards: yup.string().test(testIsPositiveBigNumberish) | ||
}) | ||
.defined() | ||
.notRequired() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the metadata object is going to be removed, maybe this validation logic can also be removed
const amountBreakdownSum = Object.values( | ||
recipient.metadata.amountBreakdown | ||
).reduce((amountAcc, reward) => amountAcc.add(reward), BigNumber.from(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is also no longer necessary
No description provided.