MCPcopy Create free account
hub / github.com/PolymathNetwork/polymath-core / increaseTimeByDuration

Function increaseTimeByDuration

CLI/commands/helpers/time.js:70–82  ·  view source on GitHub ↗
(duration)

Source from the content-addressed store, hash-verified

68}
69
70async 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
84function increaseTimeToDate(date) {
85 var toDate = moment(date, ['MM-DD-YYYY', 'MM-DD-YYYY HH:mm:ss']);

Callers

nothing calls this directly

Calls 1

increaseTimeFunction · 0.70

Tested by

no test coverage detected