How to use the ganache-time-traveler.revertToSnapshot function in ganache-time-traveler

To help you get started, we’ve selected a few ganache-time-traveler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aniemerg / yieldtoken / test / treasurer.js View on Github external
it("should allow for settlement", async() => {
    const TreasurerInstance = await Treasurer.deployed();
    var series = 2;
    snapShot = await helper.takeSnapshot();
    snapshotId = snapShot['result'];

    await helper.advanceTimeAndBlock(SECONDS_IN_DAY * 1.5);
    await TreasurerInstance.settlement(series);
    var rate = (await TreasurerInstance.settled(series)).toString();
    assert.equal(rate, web3.utils.toWei(".02"), "settled rate not set");
    //unwind state
    await helper.revertToSnapshot(snapshotId);
  });

ganache-time-traveler

A ganache utility that simplifies writing time dependent or stateless tests on a local Ethereum blockchain.

ISC
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis