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

Rename currentEpoch to currentTimestamp - Not to be used interchangeably #169

Open
3 tasks
idiom-bytes opened this issue Sep 7, 2023 · 2 comments
Open
3 tasks
Assignees
Labels

Comments

@idiom-bytes
Copy link
Member

idiom-bytes commented Sep 7, 2023

Problem

An epoch is an index to a block of time epochs[1].timestamp.
A timestamp is a point in time (Sep 08 2021, 1631064675).

These are not the same type but are being used interchangeably in code. This doesn't read well when looking at old code, reviewing logic, or using it.

Example
image

DoD

  • Please rename cEpoch and currentEpoch + inside PredictoorContext to be cTimestamp and currentTimestamp.
  • Please review math and make sure it's working correctly.
  • Please review if anything similar exists elsewhere and adjust
@KatunaNorbert
Copy link
Member

If you try to get epoch from the contract it's going to return a timestamp

@kdetry kdetry self-assigned this Sep 12, 2023
@kdetry
Copy link
Contributor

kdetry commented Sep 13, 2023

let's do it currentEpochTimestamp because we do not get or set the real current timestamp (it is the value of the date.now() function). We set the timestamp of the current epoch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants