(toTime)
| 49 | } |
| 50 | |
| 51 | async function increaseTimeByDate(toTime) { |
| 52 | if (await web3.eth.net.getId() === 15) { |
| 53 | if (toTime.isValid()) { |
| 54 | let currentTime = (await web3.eth.getBlock('latest')).timestamp; |
| 55 | if (toTime.unix() > currentTime) { |
| 56 | await jumpToTime(toTime.unix()); |
| 57 | currentTime = (await web3.eth.getBlock('latest')).timestamp; |
| 58 | console.log(chalk.green(`Current datetime is ${currentTime} or ${moment.unix(currentTime).format("MM/DD/YYYY HH:mm:ss")}`)); |
| 59 | } else { |
| 60 | 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`)); |
| 61 | } |
| 62 | } else { |
| 63 | console.log(chalk.red(`Date format is not valid. Please use a valid Unix epoch time`)); |
| 64 | } |
| 65 | } else { |
| 66 | console.log(chalk.red(`Time traveling is only possible over develpment network`)); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | async function increaseTimeByDuration(duration) { |
| 71 | if (await web3.eth.net.getId() === 15) { |
no test coverage detected