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

Add option to manipulate timestamp of blocks #72

Open
3esmit opened this issue Mar 2, 2017 · 4 comments
Open

Add option to manipulate timestamp of blocks #72

3esmit opened this issue Mar 2, 2017 · 4 comments

Comments

@3esmit
Copy link

3esmit commented Mar 2, 2017

I'm working on a contract with Lock period. I'm having to change the constants from 25 days to 5 minutes to test. Would be interesting if we have a plugin or feature to manipulate timestamp of the block.

If that is not possible, a target time to execute transaction would be good too.

@asinyagin
Copy link
Contributor

@3esmit yeah, that seems to be a good feature for Studio. We have such call for testing purposes in the sandbox https://github.com/ether-camp/ethereum-sandbox/blob/master/api/sandbox.js#L172
Here's how you can use it https://github.com/ether-camp/ethereum-testing-reference/blob/43ab75e4fd33788700df01d19a04ba724dc540f3/test/vault/vault-test.js#L70

@3esmit
Copy link
Author

3esmit commented Mar 2, 2017

Nice, but I don't get how can I execute this javascript in my current project config. But as I see, you can manipulate the timestamp.
Would be good that block always use real timestamp, unless when defined manually. So ethereum studio just need have a input to set timestamp?

A option would be to set a hard timestamp, so there could be blocks with wrong timestamp order or even multiple blocks at the same timestamp (something impossible in a real ethereum network due consensus).
Other option would be to forward the clock that generates the timestamp to a new position defined.
Any would match my needs, and I don't know which aprooch is better for most use cases.

@asinyagin
Copy link
Contributor

It's a test-script which uses our testing framework. Here's more info on how to run such tests https://github.com/ether-camp/ethereum-testing-reference/.

@DaveAppleton
Copy link

Thank you. That's a great idea.

@romanman romanman removed the in-review label Mar 3, 2017
@romanman romanman modified the milestones: To-Assign, BackLog Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants