-
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
feat: ⚡ update sdk to send allocation date #428
base: development
Are you sure you want to change the base?
Conversation
const MICROSECONDS_PER_SECOND = 1000000; | ||
const MICROSECONDS_PER_DAY = 24 * 60 * 60 * 1000000; |
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.
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`; |
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.
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); |
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.
there is a better expect clause: https://jestjs.io/docs/expect#tobeclosetonumber-numdigits for this
No description provided.