Skip to content

Commit

Permalink
Merge pull request #38 from Jeff-CCH/test/optimize-e2e
Browse files Browse the repository at this point in the history
fix: uniswap v3 slippage in e2e test
  • Loading branch information
Jeff-CCH authored Jan 16, 2024
2 parents e3959f7 + f6d6c43 commit 0f8a54a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-boxes-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

fix uniswap v3 slippage in e2e test
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-latest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Test
name: E2E Latest

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-mainnet-pb.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Test
name: E2E Mainnet Pinned Block

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v2/withdraw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('mainnet-pb: Test AaveV2 Withdraw Logic', function () {
const transactionRequest = routerKit.buildExecuteTransactionRequest({ permit2Datas, routerLogics, tokensReturn });
await expect(user.sendTransaction(transactionRequest)).to.not.be.reverted;
await expect(user.address).to.changeBalance(input.token, -input.amount, 1);
await expect(user.address).to.changeBalance(output.token, output.amount);
await expect(user.address).to.changeBalance(output.token, output.amount, 1);
});
});
});
6 changes: 3 additions & 3 deletions test/logics/uniswap-v3/swap-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('mainnet-pb: Test UniswapV3 SwapToken Logic', function () {
params: {
input: new common.TokenAmount(mainnetTokens.USDC, '1000'),
tokenOut: mainnetTokens.ETH,
slippage: 100,
slippage: 500,
},
},
{
Expand All @@ -53,7 +53,7 @@ describe('mainnet-pb: Test UniswapV3 SwapToken Logic', function () {
params: {
input: new common.TokenAmount(mainnetTokens.USDC, '1000'),
tokenOut: mainnetTokens.ETH,
slippage: 100,
slippage: 500,
},
balanceBps: 5000,
},
Expand All @@ -76,7 +76,7 @@ describe('mainnet-pb: Test UniswapV3 SwapToken Logic', function () {
params: {
tokenIn: mainnetTokens.USDC,
output: new common.TokenAmount(mainnetTokens.ETH, '1'),
slippage: 100,
slippage: 500,
},
},
{
Expand Down
3 changes: 0 additions & 3 deletions test/logics/utility/flash-loan-aggregrator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ describe('mainnet-pb: Test Utility FlashLoanAggregator Logic', function () {
{ loans: new common.TokenAmounts([mainnetTokens.WETH, '0.01'], [morphoblue.mainnetTokens.wstETH, '0.01']) },
{ repays: new common.TokenAmounts([mainnetTokens.WETH, '0.01'], [morphoblue.mainnetTokens.wstETH, '0.01']) },
// aave-v3
// TODO: consider server_error even run as single file
// TODOL: unknown block bnumber
{ loans: new common.TokenAmounts([aavev3.mainnetTokens['1INCH'], '1'], [aavev3.mainnetTokens.USDC, '1']) },
{ repays: new common.TokenAmounts([aavev3.mainnetTokens['1INCH'], '1'], [aavev3.mainnetTokens.USDC, '1']) },
{ protocolId: 'aave-v3', loans: new common.TokenAmounts([mainnetTokens.WETH, '1'], [mainnetTokens.USDC, '1']) },
// TODOL: unknown block bnumber
{ protocolId: 'aave-v3', repays: new common.TokenAmounts([mainnetTokens.WETH, '1'], [mainnetTokens.USDC, '1']) },
];

Expand Down

0 comments on commit 0f8a54a

Please sign in to comment.