https://github.com/cmditch/solidity-time-testing
Using DS-Warp to test time reliant functions in solidity
https://github.com/cmditch/solidity-time-testing
Last synced: about 1 month ago
JSON representation
Using DS-Warp to test time reliant functions in solidity
- Host: GitHub
- URL: https://github.com/cmditch/solidity-time-testing
- Owner: cmditch
- Created: 2018-06-26T18:04:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-26T18:10:35.000Z (over 7 years ago)
- Last Synced: 2025-07-24T11:39:46.441Z (8 months ago)
- Language: Makefile
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Testing Passing Time in Soldity
## Run
```
git clone git@github.com:cmditch/solidity-time-testing.git
cd solidity-time-testing
dapp test
```
## Requirements
[Dapp.tools](https://dapp.tools/) required.
```
curl https://nixos.org/nix/install | sh
nix-channel --add https://nix.dapphub.com/pkgs/dapphub
nix-channel --update
nix-env -iA dapphub.{dapp,seth,hevm,evmdis}
```
## Info
In order to play nice with DSWarp, your contracts must implement a wrapper around `now`/`block.timestamp` called era().
In testing, you then create a "testable" version of the contract which mixes in DSWarp, allowing you to use `myTestContract.warp(2 days)`.