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

Time manipulation functions #114

Merged
merged 5 commits into from
May 31, 2022
Merged

Time manipulation functions #114

merged 5 commits into from
May 31, 2022

Conversation

Nathan-SL
Copy link
Contributor

Usage related changes

  • Block timestamp can be handled using the two devnet functions increaseTime() and setTime()

Development related changes

  • setTime() wil update the subsequent block timestamp keeping the offset

Checklist:

  • I have formatted the code
  • I have performed a self-review of the code
  • I have rebased to the base branch
  • I have documented the changes
  • I have updated the tests
  • I have created a PR to the plugin branch of starknet-hardhat-example.

@Nathan-SL Nathan-SL changed the title Time manipulation Time manipulation functions May 30, 2022
}, "Request failed. Make sure your network has the /increase_time endpoint");
}

public async setTime(seconds: number) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it would make sense to provide an option to set time in Date as well? Or does it make more sense to expect users to do the date manipulation anyway?

Copy link
Contributor

@badurinantun badurinantun left a comment

Choose a reason for hiding this comment

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

Can you add tests for this as well?

src/type-extensions.ts Outdated Show resolved Hide resolved
src/type-extensions.ts Outdated Show resolved Hide resolved
@FabijanC FabijanC merged commit 668235d into master May 31, 2022
@FabijanC FabijanC deleted the time-manipulation branch May 31, 2022 13:45
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.

3 participants