Skip to content

Commit

Permalink
modify + add tests, to accomodate new smart contracts constructors.
Browse files Browse the repository at this point in the history
  • Loading branch information
laalaguer committed Aug 12, 2021
1 parent 54a5cc1 commit a312650
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library UniswapV2Library {
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'e90c5eee4c17b35f49e920fdc550dd853e3347dd9070c6ad06899101ddf4e2a6' // init code hash
hex'e33c1c8294a27775a22adff754449281fee682d4c4d536c27b227c41ea315843' // init code hash
))));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ describe('ExampleComputeLiquidityValue', () => {
100,
expandTo18Decimals(5)
)
).to.eq('12705')
).to.eq('12706') // 12705
})

it('gas higher price', async () => {
Expand All @@ -261,7 +261,7 @@ describe('ExampleComputeLiquidityValue', () => {
105,
expandTo18Decimals(5)
)
).to.eq('13478')
).to.eq('13479') // 13478
})

it('gas lower price', async () => {
Expand All @@ -273,7 +273,7 @@ describe('ExampleComputeLiquidityValue', () => {
95,
expandTo18Decimals(5)
)
).to.eq('13523')
).to.eq('13524') // 13523
})

describe('after a swap', () => {
Expand Down
4 changes: 2 additions & 2 deletions uniswap-v2-periphery/test/ExampleSlidingWindowOracle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('ExampleSlidingWindowOracle', () => {
it('gas for first update (allocates empty array)', async () => {
const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides)
const receipt = await tx.wait()
expect(receipt.gasUsed).to.eq('116816')
expect(receipt.gasUsed).to.eq('116796') // 116816
}).retries(2) // gas test inconsistent

it('gas for second update in the same period (skips)', async () => {
Expand All @@ -165,7 +165,7 @@ describe('ExampleSlidingWindowOracle', () => {
await mineBlock(provider, startTime + 3600)
const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides)
const receipt = await tx.wait()
expect(receipt.gasUsed).to.eq('94703')
expect(receipt.gasUsed).to.eq('94683') // 94703
}).retries(2) // gas test inconsistent

it('second update in one timeslot does not overwrite', async () => {
Expand Down
2 changes: 1 addition & 1 deletion uniswap-v2-periphery/test/shared/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function v2Fixture(provider: Web3Provider, [wallet]: Wallet[]): Pro
await factoryV1.initializeFactory((await deployContract(wallet, UniswapV1Exchange, [])).address)

// deploy V2
const factoryV2 = await deployContract(wallet, UniswapV2Factory, [wallet.address])
const factoryV2 = await deployContract(wallet, UniswapV2Factory, [wallet.address, WETH.address])

// deploy routers
const router01 = await deployContract(wallet, UniswapV2Router01, [factoryV2.address, WETH.address], overrides)
Expand Down

0 comments on commit a312650

Please sign in to comment.