How to use the @openzeppelin/test-helpers.time.latest function in @openzeppelin/test-helpers

To help you get started, we’ve selected a few @openzeppelin/test-helpers 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 ethersphere / swap-swear-and-swindle / test / ERC20SimpleSwap.should.js View on Github external
beforeEach(async function() {
    // If we expect this not to be the default value, we have to set the value here, as it depends on the most current time
    if(!expectedCanBeDecreasedAt.eq(new BN(0))) {
      this.expectedCanBeDecreasedAt = (await time.latest()).add(await this.ERC20SimpleSwap.DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT())
    } else {
      this.expectedCanBeDecreasedAt = expectedCanBeDecreasedAt
    }
    this.exptectedCanBeDecreasedAt = (await time.latest()).add(await this.ERC20SimpleSwap.DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT())
    this.hardDeposits = await this.ERC20SimpleSwap.hardDeposits(beneficiary)
  })
  it('should return the expected amount', function() {