-
Notifications
You must be signed in to change notification settings - Fork 76
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: Implement evm_increaseTime and evm_setNextBlockTimestamp #93
Merged
MexicanAce
merged 14 commits into
matter-labs:main
from
Moonsong-Labs:nish-fix-66-upstream
Sep 11, 2023
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
697bb07
add evm rpc methods increaseTime, setTime
nbaztec 84842db
improve docs
nbaztec bdec706
lint: newline
nbaztec 3dc83fe
add evm section in supported-apis
nbaztec 74a5cad
Merge branch 'main' into nish-fix-66-upstream
nbaztec 7c1594d
update Cargo.lock
nbaztec 0a2acdd
Merge branch 'main' into nish-fix-66-upstream
nbaztec b58f67e
Merge branch 'main' into nish-fix-66-upstream
nbaztec 058c0e8
Merge branch 'main' into nish-fix-66-upstream
nbaztec 8edf0c1
change method name and type to allow numeric inputs
nbaztec 35ec403
Merge branch 'main' into nish-fix-66-upstream
nbaztec e3daa6e
re-add evm_setTime
nbaztec 3c31378
Merge branch 'main' into nish-fix-66-upstream
nbaztec 5b11ae3
add test rest endpoints
nbaztec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think there's actually a need for both here. Ganache only supports evm_setTime, while Hardhat only support evm_setNextBlockTimestamp ... but I think they both do the same thing. Thoughts?
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.
We can either implement
evm_setTime
in this PR, or leave the line here in this table.Also, it looks like this change leaves 2 rows/entries for
evm_setNextBlockTimestamp
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.
Yeah they do exactly the same thing with the following differences:
setNextBlockTimestamp
allows only setting a timestamp forward in future, whilesetTime
supports setting it backwards.setNextBlockTimestamp
returns the newly set timestamp in response, whereassetTime
returns the difference between the current and the new timestamp.AFAIK
setTime
can be seen as a superset ofsetNextBlockTimestamp
and from most examples out there no one seems to be using the return value to do anything meaningful.I'm fine with supporting both, though it must be explicitly mentioned (to avoid any confusion for users) that these two achieve the same result and are mostly arising out of API differences between hardhat and ganache - though it does tend to make our API interface a bit messy.