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

feat: ⚡ update sdk to send allocation date #428

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

sadiabbasi
Copy link
Contributor

No description provided.

const MICROSECONDS_PER_SECOND = 1000000;
const MICROSECONDS_PER_DAY = 24 * 60 * 60 * 1000000;
Copy link
Contributor

Choose a reason for hiding this comment

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

better:
const MICROSECONDS_PER_DAY = 24 * 60 * 60 * MICROSECONDS_PER_SECOND;

return `${vestingPeriodInSeconds.toFixed(0)} seconds`;
} else {
// Return hours if it's more than a minute but less than a day
return `${(vestingPeriodInSeconds / 3600).toFixed(1)} hours`;
Copy link
Contributor

Choose a reason for hiding this comment

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

to be consistent, 3600 should also be a constant

// Validate allocation date matches expected allocation date
const tolerance = 1000; // 1 second in milliseconds

expect(Math.abs(allocationDate.getTime() - expectedAllocationDate.getTime())).toBeLessThanOrEqual(tolerance);
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a better expect clause: https://jestjs.io/docs/expect#tobeclosetonumber-numdigits for this

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