(duration)
| 68 | } |
| 69 | |
| 70 | async function increaseTimeByDuration(duration) { |
| 71 | if (await web3.eth.net.getId() === 15) { |
| 72 | if (duration > 0) { |
| 73 | await increaseTime(duration); |
| 74 | currentTime = (await web3.eth.getBlock('latest')).timestamp; |
| 75 | console.log(chalk.green(`Current datetime is ${currentTime} or ${moment.unix(currentTime).format("MM/DD/YYYY HH:mm:ss")}`)); |
| 76 | } else { |
| 77 | console.log(chalk.red(`It is not possible to go back in time. Please try again with a time in the future to travel to`)); |
| 78 | } |
| 79 | } else { |
| 80 | console.log(chalk.red(`Time traveling is only possible over develpment network`)); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | function increaseTimeToDate(date) { |
| 85 | var toDate = moment(date, ['MM-DD-YYYY', 'MM-DD-YYYY HH:mm:ss']); |
nothing calls this directly
no test coverage detected