Skip to content

Commit

Permalink
Added test for WETH price update
Browse files Browse the repository at this point in the history
  • Loading branch information
d1ll0n committed Nov 6, 2020
1 parent d0269d1 commit 35dbedb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/IndexedUniswapV2Oracle.spec.js
Expand Up @@ -265,6 +265,10 @@ describe('IndexedUniswapV2Oracle', async () => {
timestampUpdated = timestamp;
});

it('updatePrice() returns true if token is WETH', async () => {
expect(await oracle.callStatic.updatePrice(weth.address)).to.be.true;
});

it('hasPriceObservationInWindow()', async () => {
expect(await oracle.hasPriceObservationInWindow(token0.address, Math.floor(timestampUpdated / 3600))).to.be.true;
expect(await oracle.hasPriceObservationInWindow(token0.address, 0)).to.be.false;
Expand Down

0 comments on commit 35dbedb

Please sign in to comment.