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

WIP: reduce proof's file size #15

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

melisaguevara
Copy link

No description provided.

Copy link

linear bot commented Sep 11, 2024

@melisaguevara melisaguevara marked this pull request as draft September 11, 2024 20:26
Comment on lines +47 to +51
// Remove metadata object to reduce output file size
Object.values(recipientsWithProofs).forEach(
(recipientData) => (recipientData.metadata = {})
);

Copy link
Contributor

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?

Comment on lines 33 to +46
.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()
Copy link
Contributor

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

Comment on lines +123 to +125
const amountBreakdownSum = Object.values(
recipient.metadata.amountBreakdown
).reduce((amountAcc, reward) => amountAcc.add(reward), BigNumber.from(0));
Copy link
Contributor

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

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