mirror of
https://github.com/codex-storage/codex-contracts-eth.git
synced 2025-01-09 11:32:22 +00:00
321132b6fa
1. Replace all instances of `now()` with `await currentTime()` to get a more accurate representation of time from the block timestamp. Update examples.js to be async. 2. Move `RequestState` to `marketplace.js` 3. Delete `TestStorage` as `slashAmount` function no longer needed.
12 lines
374 B
JavaScript
12 lines
374 B
JavaScript
const hours = (amount) => amount * minutes(60)
|
|
const minutes = (amount) => amount * seconds(60)
|
|
const seconds = (amount) => amount
|
|
|
|
const periodic = (length) => ({
|
|
periodOf: (timestamp) => Math.floor(timestamp / length),
|
|
periodStart: (period) => period * length,
|
|
periodEnd: (period) => (period + 1) * length,
|
|
})
|
|
|
|
module.exports = { hours, minutes, seconds, periodic }
|