From 5a57729fa178b47b7e6d390d552c20cb9351fefe Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 19 Oct 2023 16:57:21 +0300 Subject: [PATCH 01/73] BACK-1332: run tests on GH Actions CI --- .github/workflows/ci.yaml | 3 +++ package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a588d6d0c..f2e176dca 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,3 +20,6 @@ jobs: - name: Run Eslint checks run: yarn check:es + + - name: Run Changed tests + run: yarn test:changedsince diff --git a/package.json b/package.json index 64a7404df..aae3a2805 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "check:pq": "pretty-quick --staged", "check:tsc": "tsc", "check:es": "eslint \"src/**/*.ts\" --ignore-pattern=\"*.test.ts\"", - "checks": "yarn check:pq && yarn check:tsc && yarn check:es" + "checks": "yarn check:pq && yarn check:tsc && yarn check:es", + "tests:changedsince": "jest --verbose --silent --changedSince=master --coverage" }, "dependencies": { "@0x/utils": "^4.5.2", From 59927b997626b9aaf230579f3ea59005f1fc0dc2 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 19 Oct 2023 17:03:51 +0300 Subject: [PATCH 02/73] adjust tests command in ci config --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f2e176dca..9c2276f5d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,4 +22,4 @@ jobs: run: yarn check:es - name: Run Changed tests - run: yarn test:changedsince + run: yarn tests:changedsince From 7142c701b33f58e02bf5f605e978a2c3d2374264 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 19 Oct 2023 17:12:52 +0300 Subject: [PATCH 03/73] debug --- .github/workflows/ci.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9c2276f5d..4330b6a2a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,6 +10,11 @@ jobs: name: Node ${{ matrix.node }} sample steps: - uses: actions/checkout@v2 + - run: | + git fetch --no-tags --depth=1 origin master + git checkout -b master + git checkout ${{ github.event.pull_request.head.sha }} + - name: Setup node uses: actions/setup-node@v2 with: From 968e57394e1bbd0c7bcb43516ca181605b9ff08e Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 19 Oct 2023 17:14:07 +0300 Subject: [PATCH 04/73] trigger builds From 566aafebb0bdbc09e32f110b7aa4132aa1c2ba48 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 19 Oct 2023 17:29:05 +0300 Subject: [PATCH 05/73] run test on ci --- src/dex/dexalot/dexalot-e2e.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dex/dexalot/dexalot-e2e.test.ts b/src/dex/dexalot/dexalot-e2e.test.ts index 5834b71b7..3ec2e5d3a 100644 --- a/src/dex/dexalot/dexalot-e2e.test.ts +++ b/src/dex/dexalot/dexalot-e2e.test.ts @@ -169,6 +169,12 @@ function testForNetwork( describe('Dexalot E2E', () => { const dexKey = 'Dexalot'; + describe('Test on ci', () => { + it('should', () => { + expect(true).toBe(true); + }) + }); + describe('Avalanche', () => { const network = Network.AVALANCHE; From 3a3f9fee45d842741d0a9bedfe5ff180e3733369 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 19 Oct 2023 17:52:34 +0300 Subject: [PATCH 06/73] update ci config --- .github/workflows/ci.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4330b6a2a..0e8d960b2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,10 +10,11 @@ jobs: name: Node ${{ matrix.node }} sample steps: - uses: actions/checkout@v2 + - run: | - git fetch --no-tags --depth=1 origin master - git checkout -b master - git checkout ${{ github.event.pull_request.head.sha }} + git fetch --no-tags --depth=1 origin master + git checkout -b master + git checkout ${{ github.event.pull_request.head.sha }} - name: Setup node uses: actions/setup-node@v2 From 9f61df4aa3536581e5b50611298f92ebd95d8f23 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 19 Oct 2023 18:07:08 +0300 Subject: [PATCH 07/73] update --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0e8d960b2..8076ed2a1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,10 @@ jobs: node: ['16.x'] name: Node ${{ matrix.node }} sample steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - run: | git fetch --no-tags --depth=1 origin master From 4faddfb6418459fde77622c8cde83ea5b17ad6bf Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 10:48:29 +0300 Subject: [PATCH 08/73] debug tests on ci --- src/dex/dexalot/dexalot-e2e.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dex/dexalot/dexalot-e2e.test.ts b/src/dex/dexalot/dexalot-e2e.test.ts index 3ec2e5d3a..eeabc2893 100644 --- a/src/dex/dexalot/dexalot-e2e.test.ts +++ b/src/dex/dexalot/dexalot-e2e.test.ts @@ -175,6 +175,12 @@ describe('Dexalot E2E', () => { }) }); + describe('New test', () => { + it('should2', () => { + expect(true).toBe(true); + }); + }); + describe('Avalanche', () => { const network = Network.AVALANCHE; From 0ecaabefd6847295163d104f083e9d482ad4828b Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 11:10:41 +0300 Subject: [PATCH 09/73] update ci config --- .github/workflows/ci.yaml | 5 +++-- package.json | 2 +- src/dex/dexalot/dexalot-e2e.test.ts | 18 ++++++------------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8076ed2a1..7a7209e75 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: + fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - run: | @@ -30,5 +31,5 @@ jobs: - name: Run Eslint checks run: yarn check:es - - name: Run Changed tests - run: yarn tests:changedsince + - name: Run Changed tests only + run: npx jest --verbose --onlyChanged --changedSince=${{ github.event.pull_request.base.sha }} diff --git a/package.json b/package.json index aae3a2805..70cc546d2 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "check:tsc": "tsc", "check:es": "eslint \"src/**/*.ts\" --ignore-pattern=\"*.test.ts\"", "checks": "yarn check:pq && yarn check:tsc && yarn check:es", - "tests:changedsince": "jest --verbose --silent --changedSince=master --coverage" + "tests:changedsince": "jest --verbose --onlyChanged --changedSince=origin/master" }, "dependencies": { "@0x/utils": "^4.5.2", diff --git a/src/dex/dexalot/dexalot-e2e.test.ts b/src/dex/dexalot/dexalot-e2e.test.ts index eeabc2893..15026468e 100644 --- a/src/dex/dexalot/dexalot-e2e.test.ts +++ b/src/dex/dexalot/dexalot-e2e.test.ts @@ -166,20 +166,14 @@ function testForNetwork( }); } -describe('Dexalot E2E', () => { - const dexKey = 'Dexalot'; - - describe('Test on ci', () => { - it('should', () => { - expect(true).toBe(true); - }) +describe('New test', () => { + it('should2', () => { + expect(true).toBe(true); }); +}); - describe('New test', () => { - it('should2', () => { - expect(true).toBe(true); - }); - }); +describe('Dexalot E2E', () => { + const dexKey = 'Dexalot'; describe('Avalanche', () => { const network = Network.AVALANCHE; From 9b933c7d7ec06985aa7d799049e5c517480b4a6c Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 11:25:21 +0300 Subject: [PATCH 10/73] update ci config --- .github/workflows/ci.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a7209e75..62edbfc6d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,11 +15,6 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - - run: | - git fetch --no-tags --depth=1 origin master - git checkout -b master - git checkout ${{ github.event.pull_request.head.sha }} - - name: Setup node uses: actions/setup-node@v2 with: @@ -32,4 +27,4 @@ jobs: run: yarn check:es - name: Run Changed tests only - run: npx jest --verbose --onlyChanged --changedSince=${{ github.event.pull_request.base.sha }} + run: npx jest --verbose --onlyChanged --changedSince=${{ github.event.workflow_run.head_sha }} From addf0fbf2e5260433d66e8c248c6e5c6a0207b46 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 11:30:10 +0300 Subject: [PATCH 11/73] debug ci context --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 62edbfc6d..b7612eb26 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,6 +9,10 @@ jobs: node: ['16.x'] name: Node ${{ matrix.node }} sample steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" - name: Checkout uses: actions/checkout@v3 with: From 8da6810a2310b2b68e12e36f1dd3b7179944bc22 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 11:32:27 +0300 Subject: [PATCH 12/73] debug ci context --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b7612eb26..b572f25d0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - fetch-depth: 0 + fetch-depth: 2 ref: ${{ github.event.pull_request.head.sha }} - name: Setup node From 39fee0515200b6f9b1f651493595cccc84a379b2 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 12:04:49 +0300 Subject: [PATCH 13/73] debug ci --- .github/workflows/ci.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b572f25d0..f932cb557 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,6 +9,23 @@ jobs: node: ['16.x'] name: Node ${{ matrix.node }} sample steps: + - name: Fetching base and head commit (pull_request) + if: github.event_name == 'pull_request' + run: | + git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }} + git fetch --no-tags --prune --no-recurse-submodules --depth=10 origin ${{ github.event.pull_request.base.sha }} + git checkout --progress --force ${{ github.event.pull_request.head.sha }} + + while [[ -n $(git rev-list shallow ^${{ github.event.pull_request.base.sha }}) ]] + do + git fetch --no-tags --prune --no-recurse-submodules --deepen=10 origin ${{ github.event.pull_request.base.sha }} + done + + base=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1) + + echo "BASE=$base" >> $GITHUB_ENV + echo "HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} From 8bff1f09b55804fd9c733c705bec950ea5bf9205 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 12:05:45 +0300 Subject: [PATCH 14/73] debug ci --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f932cb557..4c5c577f9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,6 @@ jobs: name: Node ${{ matrix.node }} sample steps: - name: Fetching base and head commit (pull_request) - if: github.event_name == 'pull_request' run: | git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }} git fetch --no-tags --prune --no-recurse-submodules --depth=10 origin ${{ github.event.pull_request.base.sha }} From 603ea82e7e34fc423a8548174f03079c0b85d870 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 13:45:39 +0300 Subject: [PATCH 15/73] debug ci --- .github/workflows/ci.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4c5c577f9..7b1689cc7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,6 +9,11 @@ jobs: node: ['16.x'] name: Node ${{ matrix.node }} sample steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Fetching base and head commit (pull_request) run: | git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }} @@ -25,10 +30,6 @@ jobs: echo "BASE=$base" >> $GITHUB_ENV echo "HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - name: Checkout uses: actions/checkout@v3 with: From de3d37acef4a3ceb47172dd1feb9bdedb4746c4b Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 14:03:19 +0300 Subject: [PATCH 16/73] debug ci --- .github/workflows/ci.yaml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7b1689cc7..b81487acc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,33 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" + - name: Initializing git repository + run: | + git init --initial-branch=main + git remote add origin ${{ github.event.repository.html_url }} + + - name: Fetching base and head commit (push) + if: github.event_name == 'push' + env: + PUSHED_COMMITS: ${{ toJSON(github.event.commits) }} + run: | + if [[ ${{ github.event.before }} == 0000000000000000000000000000000000000000 ]] + then + before=$(echo "$PUSHED_COMMITS" | jq .[0].id --raw-output) + + git fetch --no-tags --prune --no-recurse-submodules --depth=2 origin $before ${{ github.event.after }} + + echo "BASE=$(git rev-parse $before~1)" >> $GITHUB_ENV + else + git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{ github.event.before }} ${{ github.event.after }} + + echo "BASE=${{ github.event.before }}" >> $GITHUB_ENV + fi + + echo "HEAD=${{ github.event.after }}" >> $GITHUB_ENV + - name: Fetching base and head commit (pull_request) + if: github.event_name == 'pull_request' run: | git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }} git fetch --no-tags --prune --no-recurse-submodules --depth=10 origin ${{ github.event.pull_request.base.sha }} @@ -32,9 +58,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 2 - ref: ${{ github.event.pull_request.head.sha }} - name: Setup node uses: actions/setup-node@v2 From adf53988139bae87a74601deb77b711419ae1512 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 14:14:48 +0300 Subject: [PATCH 17/73] debug ci --- .github/workflows/ci.yaml | 57 +++++++-------------------------------- 1 file changed, 9 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b81487acc..1bbf954e5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,55 +14,16 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Initializing git repository - run: | - git init --initial-branch=main - git remote add origin ${{ github.event.repository.html_url }} - - - name: Fetching base and head commit (push) - if: github.event_name == 'push' - env: - PUSHED_COMMITS: ${{ toJSON(github.event.commits) }} - run: | - if [[ ${{ github.event.before }} == 0000000000000000000000000000000000000000 ]] - then - before=$(echo "$PUSHED_COMMITS" | jq .[0].id --raw-output) - - git fetch --no-tags --prune --no-recurse-submodules --depth=2 origin $before ${{ github.event.after }} - - echo "BASE=$(git rev-parse $before~1)" >> $GITHUB_ENV - else - git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{ github.event.before }} ${{ github.event.after }} - - echo "BASE=${{ github.event.before }}" >> $GITHUB_ENV - fi - - echo "HEAD=${{ github.event.after }}" >> $GITHUB_ENV - - - name: Fetching base and head commit (pull_request) - if: github.event_name == 'pull_request' - run: | - git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }} - git fetch --no-tags --prune --no-recurse-submodules --depth=10 origin ${{ github.event.pull_request.base.sha }} - git checkout --progress --force ${{ github.event.pull_request.head.sha }} - - while [[ -n $(git rev-list shallow ^${{ github.event.pull_request.base.sha }}) ]] - do - git fetch --no-tags --prune --no-recurse-submodules --deepen=10 origin ${{ github.event.pull_request.base.sha }} - done - - base=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1) - - echo "BASE=$base" >> $GITHUB_ENV - echo "HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup node - uses: actions/setup-node@v2 + - uses: actions/checkout@v2 + - run: | + git fetch --no-tags --depth=1 origin master + git checkout -b master + git checkout ${{ github.event.pull_request.head.sha }} + + - name: Setup Node.js + uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} - name: Install Dependencies run: yarn From d8eb0fd45ae47fdc00c48cd4bfa9f9d6fb4d8343 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 14:16:29 +0300 Subject: [PATCH 18/73] debug ci --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1bbf954e5..701cd2acb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,4 +32,4 @@ jobs: run: yarn check:es - name: Run Changed tests only - run: npx jest --verbose --onlyChanged --changedSince=${{ github.event.workflow_run.head_sha }} + run: npx jest --verbose --onlyChanged --changedSince=master From a2e378d08fb01e567a7de0e3c061dec6e5726c14 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 14:41:24 +0300 Subject: [PATCH 19/73] debug ci --- .github/workflows/ci.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 701cd2acb..0ec1ca484 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,10 +4,6 @@ on: push jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node: ['16.x'] - name: Node ${{ matrix.node }} sample steps: - name: Dump GitHub context env: @@ -23,7 +19,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: 16 - name: Install Dependencies run: yarn From 95c39868114c88e1da6b88c8d0588a9c94ad0e44 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 15:20:10 +0300 Subject: [PATCH 20/73] debug ci --- .github/workflows/ci.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0ec1ca484..e06b710d1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,10 +11,6 @@ jobs: run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v2 - - run: | - git fetch --no-tags --depth=1 origin master - git checkout -b master - git checkout ${{ github.event.pull_request.head.sha }} - name: Setup Node.js uses: actions/setup-node@v3 @@ -28,4 +24,5 @@ jobs: run: yarn check:es - name: Run Changed tests only - run: npx jest --verbose --onlyChanged --changedSince=master + if: github.event_name == 'pull_request' + run: npx jest --verbose --onlyChanged --changedSince=${{ github.event.pull_request.base.sha }} From 3e5d4150dc0bffe7f903191d2bb5aaaa10e4a835 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 15:25:53 +0300 Subject: [PATCH 21/73] debug ci --- .github/workflows/ci.yaml | 44 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e06b710d1..67878868a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,6 +10,48 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" + - name: Initializing git repository + run: | + git init --initial-branch=main + git remote add origin ${{ github.event.repository.html_url }} + + - name: Fetching base and head commit (push) + if: github.event_name == 'push' + env: + PUSHED_COMMITS: ${{ toJSON(github.event.commits) }} + run: | + if [[ ${{ github.event.before }} == 0000000000000000000000000000000000000000 ]] + then + before=$(echo "$PUSHED_COMMITS" | jq .[0].id --raw-output) + + git fetch --no-tags --prune --no-recurse-submodules --depth=2 origin $before ${{ github.event.after }} + + echo "BASE=$(git rev-parse $before~1)" >> $GITHUB_ENV + else + git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{ github.event.before }} ${{ github.event.after }} + + echo "BASE=${{ github.event.before }}" >> $GITHUB_ENV + fi + + echo "HEAD=${{ github.event.after }}" >> $GITHUB_ENV + + - name: Fetching base and head commit (pull_request) + if: github.event_name == 'pull_request' + run: | + git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }} + git fetch --no-tags --prune --no-recurse-submodules --depth=10 origin ${{ github.event.pull_request.base.sha }} + git checkout --progress --force ${{ github.event.pull_request.head.sha }} + + while [[ -n $(git rev-list shallow ^${{ github.event.pull_request.base.sha }}) ]] + do + git fetch --no-tags --prune --no-recurse-submodules --deepen=10 origin ${{ github.event.pull_request.base.sha }} + done + + base=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1) + + echo "BASE=$base" >> $GITHUB_ENV + echo "HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + - uses: actions/checkout@v2 - name: Setup Node.js @@ -25,4 +67,4 @@ jobs: - name: Run Changed tests only if: github.event_name == 'pull_request' - run: npx jest --verbose --onlyChanged --changedSince=${{ github.event.pull_request.base.sha }} + run: npx jest --verbose --onlyChanged --changedSince=${{ env.BASE }} From 981d66944af3998a68523b1e75dc9e00cc55729f Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 15:32:27 +0300 Subject: [PATCH 22/73] debug ci --- .github/workflows/ci.yaml | 75 +++++++++++++++------------------------ 1 file changed, 29 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 67878868a..d5ffd45af 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,52 +5,35 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - name: Initializing git repository - run: | - git init --initial-branch=main - git remote add origin ${{ github.event.repository.html_url }} - - - name: Fetching base and head commit (push) - if: github.event_name == 'push' - env: - PUSHED_COMMITS: ${{ toJSON(github.event.commits) }} - run: | - if [[ ${{ github.event.before }} == 0000000000000000000000000000000000000000 ]] - then - before=$(echo "$PUSHED_COMMITS" | jq .[0].id --raw-output) - - git fetch --no-tags --prune --no-recurse-submodules --depth=2 origin $before ${{ github.event.after }} - - echo "BASE=$(git rev-parse $before~1)" >> $GITHUB_ENV - else - git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{ github.event.before }} ${{ github.event.after }} - - echo "BASE=${{ github.event.before }}" >> $GITHUB_ENV - fi - - echo "HEAD=${{ github.event.after }}" >> $GITHUB_ENV - - - name: Fetching base and head commit (pull_request) - if: github.event_name == 'pull_request' - run: | - git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }} - git fetch --no-tags --prune --no-recurse-submodules --depth=10 origin ${{ github.event.pull_request.base.sha }} - git checkout --progress --force ${{ github.event.pull_request.head.sha }} - - while [[ -n $(git rev-list shallow ^${{ github.event.pull_request.base.sha }}) ]] - do - git fetch --no-tags --prune --no-recurse-submodules --deepen=10 origin ${{ github.event.pull_request.base.sha }} - done - - base=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1) - - echo "BASE=$base" >> $GITHUB_ENV - echo "HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + - name: Checkout + uses: actions/checkout@v3 + with: + # During a pre-merge check, Github creates and checks out an temporary merge commit. That + # commit won't work as the HEAD for jest --changedSince + ref: ${{ github.event.pull_request.head.sha }} + - name: Fetch merge base commits + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Fetch commits to a depth so that head and base reach their merge base. + comparison=$(gh api\ + repos/paraswap/parapswap-dex-lib/compare/${{ github.event.pull_request.base.sha }}...${{github.event.pull_request.head.sha }}) + behind_by=$(echo -E $comparison | jq -r '.behind_by') + ahead_by=$(echo -E $comparison | jq -r '.ahead_by') + echo "ahead_by: $ahead_by; behind by: $behind_by" + # +1 because fetch depth=1 is the commit itself. + if [[ $behind_by -gt 0 ]]; then + base_depth=$((behind_by+1)) + echo Fetching base to depth $base_depth + git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ + --depth=$base_depth origin ${{github.event.pull_request.base.sha }} + fi + if [[ $ahead_by -gt 0 ]]; then + head_depth=$((ahead_by+1)) + echo Fetching head to depth $head_depth + git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ + --depth=$head_depth origin ${{github.event.pull_request.head.sha }} + fi - uses: actions/checkout@v2 From 0596e68019e22af55dd0a5623b62a51b27154191 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 15:39:30 +0300 Subject: [PATCH 23/73] debug ci --- .github/workflows/ci.yaml | 49 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d5ffd45af..52c8869a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,32 +8,31 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - # During a pre-merge check, Github creates and checks out an temporary merge commit. That - # commit won't work as the HEAD for jest --changedSince ref: ${{ github.event.pull_request.head.sha }} - - name: Fetch merge base commits - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Fetch commits to a depth so that head and base reach their merge base. - comparison=$(gh api\ - repos/paraswap/parapswap-dex-lib/compare/${{ github.event.pull_request.base.sha }}...${{github.event.pull_request.head.sha }}) - behind_by=$(echo -E $comparison | jq -r '.behind_by') - ahead_by=$(echo -E $comparison | jq -r '.ahead_by') - echo "ahead_by: $ahead_by; behind by: $behind_by" - # +1 because fetch depth=1 is the commit itself. - if [[ $behind_by -gt 0 ]]; then - base_depth=$((behind_by+1)) - echo Fetching base to depth $base_depth - git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ - --depth=$base_depth origin ${{github.event.pull_request.base.sha }} - fi - if [[ $ahead_by -gt 0 ]]; then - head_depth=$((ahead_by+1)) - echo Fetching head to depth $head_depth - git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ - --depth=$head_depth origin ${{github.event.pull_request.head.sha }} - fi + + - name: Fetch merge base commits + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Fetch commits to a depth so that head and base reach their merge base. + comparison=$(gh api\ + repos/paraswap/parapswap-dex-lib/compare/${{ github.event.pull_request.base.sha }}...${{github.event.pull_request.head.sha }}) + behind_by=$(echo -E $comparison | jq -r '.behind_by') + ahead_by=$(echo -E $comparison | jq -r '.ahead_by') + echo "ahead_by: $ahead_by; behind by: $behind_by" + # +1 because fetch depth=1 is the commit itself. + if [[ $behind_by -gt 0 ]]; then + base_depth=$((behind_by+1)) + echo Fetching base to depth $base_depth + git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ + --depth=$base_depth origin ${{github.event.pull_request.base.sha }} + fi + if [[ $ahead_by -gt 0 ]]; then + head_depth=$((ahead_by+1)) + echo Fetching head to depth $head_depth + git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ + --depth=$head_depth origin ${{github.event.pull_request.head.sha }} + fi - uses: actions/checkout@v2 From 4dd1a93adf0723dcb2295d4786cdb346389cd49f Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 15:39:47 +0300 Subject: [PATCH 24/73] debug ci --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 52c8869a2..42f6073fa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} - + - name: Fetch merge base commits env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -49,4 +49,4 @@ jobs: - name: Run Changed tests only if: github.event_name == 'pull_request' - run: npx jest --verbose --onlyChanged --changedSince=${{ env.BASE }} + run: npx jest --verbose --onlyChanged --changedSince=${{github.event.pull_request.base.sha }} From a7191ac7193a953dcf28001aa8b6ccc6071e3aef Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 15:58:29 +0300 Subject: [PATCH 25/73] debug ci --- .github/workflows/ci.yaml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 42f6073fa..bfb99574f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,31 +10,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - name: Fetch merge base commits - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Fetch commits to a depth so that head and base reach their merge base. - comparison=$(gh api\ - repos/paraswap/parapswap-dex-lib/compare/${{ github.event.pull_request.base.sha }}...${{github.event.pull_request.head.sha }}) - behind_by=$(echo -E $comparison | jq -r '.behind_by') - ahead_by=$(echo -E $comparison | jq -r '.ahead_by') - echo "ahead_by: $ahead_by; behind by: $behind_by" - # +1 because fetch depth=1 is the commit itself. - if [[ $behind_by -gt 0 ]]; then - base_depth=$((behind_by+1)) - echo Fetching base to depth $base_depth - git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ - --depth=$base_depth origin ${{github.event.pull_request.base.sha }} - fi - if [[ $ahead_by -gt 0 ]]; then - head_depth=$((ahead_by+1)) - echo Fetching head to depth $head_depth - git -c protocol.version=2 fetch --no-tags --no-recurse-submodules\ - --depth=$head_depth origin ${{github.event.pull_request.head.sha }} - fi - - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v3 From 6295b9b9552e68932c4ea5979ab82a630c65f17f Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 16:00:03 +0300 Subject: [PATCH 26/73] debug ci --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bfb99574f..c68e36cd8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,4 +27,4 @@ jobs: - name: Run Changed tests only if: github.event_name == 'pull_request' - run: npx jest --verbose --onlyChanged --changedSince=${{github.event.pull_request.base.sha }} + run: npx jest --verbose --onlyChanged --changedSince=origin/master From 0e0b8a0831eb2db07a9d9c86ffefeb90ead35d91 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 16:00:16 +0300 Subject: [PATCH 27/73] debug ci --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c68e36cd8..7d178b304 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,5 +26,4 @@ jobs: run: yarn check:es - name: Run Changed tests only - if: github.event_name == 'pull_request' run: npx jest --verbose --onlyChanged --changedSince=origin/master From de5c7609c4771c5d65a16bad04a941d447edc092 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 16:06:12 +0300 Subject: [PATCH 28/73] remove npm script --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 70cc546d2..64a7404df 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,7 @@ "check:pq": "pretty-quick --staged", "check:tsc": "tsc", "check:es": "eslint \"src/**/*.ts\" --ignore-pattern=\"*.test.ts\"", - "checks": "yarn check:pq && yarn check:tsc && yarn check:es", - "tests:changedsince": "jest --verbose --onlyChanged --changedSince=origin/master" + "checks": "yarn check:pq && yarn check:tsc && yarn check:es" }, "dependencies": { "@0x/utils": "^4.5.2", From 0e526c64f07c1e9345abe086e951e216e25ec51c Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 18:15:34 +0300 Subject: [PATCH 29/73] update tests --- src/dex/dexalot/dexalot-e2e.test.ts | 6 ------ src/dex/solidly/solidly-e2e.test.ts | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dex/dexalot/dexalot-e2e.test.ts b/src/dex/dexalot/dexalot-e2e.test.ts index 15026468e..5834b71b7 100644 --- a/src/dex/dexalot/dexalot-e2e.test.ts +++ b/src/dex/dexalot/dexalot-e2e.test.ts @@ -166,12 +166,6 @@ function testForNetwork( }); } -describe('New test', () => { - it('should2', () => { - expect(true).toBe(true); - }); -}); - describe('Dexalot E2E', () => { const dexKey = 'Dexalot'; diff --git a/src/dex/solidly/solidly-e2e.test.ts b/src/dex/solidly/solidly-e2e.test.ts index 08e80d765..bcee7f69b 100644 --- a/src/dex/solidly/solidly-e2e.test.ts +++ b/src/dex/solidly/solidly-e2e.test.ts @@ -91,6 +91,12 @@ function testForNetwork( }); } +describe('New test', () => { + it('should2', () => { + expect(true).toBe(true); + }); +}); + describe('Solidly E2E', () => { describe('Fantom', () => { const network = Network.FANTOM; From f31fafa4ec1481ed1d3c41b55ef574de2805ec84 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 18:19:47 +0300 Subject: [PATCH 30/73] update ci config --- .github/workflows/ci.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d178b304..6befd0364 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,4 +26,17 @@ jobs: run: yarn check:es - name: Run Changed tests only + env: + TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_ACCOUNT_ID }} + TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} + TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} + HTTP_PROVIDER_1: ${{ secrets.HTTP_PROVIDER_1 }} + HTTP_PROVIDER_10: ${{ secrets.HTTP_PROVIDER_10 }} + HTTP_PROVIDER_56: ${{ secrets.HTTP_PROVIDER_56 }} + HTTP_PROVIDER_137: ${{ secrets.HTTP_PROVIDER_137 }} + HTTP_PROVIDER_250: ${{ secrets.HTTP_PROVIDER_250 }} + HTTP_PROVIDER_1101: ${{ secrets.HTTP_PROVIDER_1101 }} + HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }} + HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} + HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: npx jest --verbose --onlyChanged --changedSince=origin/master From 8f95dd56860958e0a94075bb0f9768aff080eb9f Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 20 Oct 2023 19:31:50 +0300 Subject: [PATCH 31/73] update ci config --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6befd0364..1dec0eac0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,7 @@ jobs: - name: Run Changed tests only env: - TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_ACCOUNT_ID }} + TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} HTTP_PROVIDER_1: ${{ secrets.HTTP_PROVIDER_1 }} From 92e969b8073208a9cba2ccd6e18ce33bd79ab7b4 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Mon, 23 Oct 2023 16:29:14 +0300 Subject: [PATCH 32/73] add timeout for tests --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1dec0eac0..feff84e3e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,6 +26,7 @@ jobs: run: yarn check:es - name: Run Changed tests only + timeout-minutes: 15 env: TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} From f1cf0d20799d1247096ac6a4630da194c8225870 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Mon, 23 Oct 2023 21:03:28 +0300 Subject: [PATCH 33/73] fix jest detect open handles --- src/dex/solidly/solidly-e2e.test.ts | 2668 +++++++++++++-------------- tests/tenderly-simulation.ts | 1 + 2 files changed, 1335 insertions(+), 1334 deletions(-) diff --git a/src/dex/solidly/solidly-e2e.test.ts b/src/dex/solidly/solidly-e2e.test.ts index bcee7f69b..8027d4007 100644 --- a/src/dex/solidly/solidly-e2e.test.ts +++ b/src/dex/solidly/solidly-e2e.test.ts @@ -98,1340 +98,1340 @@ describe('New test', () => { }); describe('Solidly E2E', () => { - describe('Fantom', () => { - const network = Network.FANTOM; - const tokens = Tokens[network]; - const holders = Holders[network]; - const provider = new StaticJsonRpcProvider( - generateConfig(network).privateHttpProvider, - network, - ); - - describe(`Solidly`, () => { - const dexKey = 'Solidly'; - - describe(`simpleSwap`, () => { - describe(`Volatile`, () => { - it('FTM -> USDC', async () => { - await testE2E( - tokens.FTM, - tokens.USDC, - holders.FTM, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('FTM -> SPIRIT', async () => { - await testE2E( - tokens.FTM, - tokens.SPIRIT, - holders.FTM, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('SPIRIT -> FTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.FTM, - holders.SPIRIT, - '11000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('SPIRIT -> WFTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.WFTM, - holders.SPIRIT, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - describe(`Stable`, () => { - it('USDC -> USDT', async () => { - await testE2E( - tokens.USDC, - tokens.FUSDT, - holders.USDC, - '100000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - }); - describe(`multiSwap`, () => { - describe(`Volatile`, () => { - it('FTM -> USDC', async () => { - await testE2E( - tokens.FTM, - tokens.USDC, - holders.FTM, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('FTM -> SPIRIT', async () => { - await testE2E( - tokens.FTM, - tokens.SPIRIT, - holders.FTM, - '11000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('SPIRIT -> FTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.FTM, - holders.SPIRIT, - '11000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('SPIRIT -> WFTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.WFTM, - holders.SPIRIT, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - describe(`Stable`, () => { - it('USDC -> USDT', async () => { - await testE2E( - tokens.USDC, - tokens.FUSDT, - holders.USDC, - '100000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - }); - }); - - describe('SpiritSwapV2', () => { - const dexKey = 'SpiritSwapV2'; - describe(`simpleSwap`, () => { - describe(`Volatile`, () => { - it('FTM -> USDC', async () => { - await testE2E( - tokens.FTM, - tokens.USDC, - holders.FTM, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('FTM -> SPIRIT', async () => { - await testE2E( - tokens.FTM, - tokens.SPIRIT, - holders.FTM, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('SPIRIT -> FTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.FTM, - holders.SPIRIT, - '11000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('SPIRIT -> WFTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.WFTM, - holders.SPIRIT, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - describe(`Stable`, () => { - it('USDC -> USDT', async () => { - await testE2E( - tokens.USDC, - tokens.FUSDT, - holders.USDC, - '100000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - }); - describe(`multiSwap`, () => { - describe(`Volatile`, () => { - it('FTM -> USDC', async () => { - await testE2E( - tokens.FTM, - tokens.USDC, - holders.FTM, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('FTM -> SPIRIT', async () => { - await testE2E( - tokens.FTM, - tokens.SPIRIT, - holders.FTM, - '11000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('SPIRIT -> FTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.FTM, - holders.SPIRIT, - '11000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('SPIRIT -> WFTM', async () => { - await testE2E( - tokens.SPIRIT, - tokens.WFTM, - holders.SPIRIT, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - describe(`Stable`, () => { - it('USDC -> USDT', async () => { - await testE2E( - tokens.USDC, - tokens.FUSDT, - holders.USDC, - '100000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - }); - }); - - describe('Equalizer', () => { - const dexKey = 'Equalizer'; - const network = Network.FANTOM; - - const tokenASymbol: string = 'FUSDT'; - const tokenBSymbol: string = 'USDC'; - - const tokenAAmount: string = '111110'; - const tokenBAmount: string = '100000'; - const nativeTokenAmount = '11000000000000000'; - - testForNetwork( - network, - dexKey, - tokenASymbol, - tokenBSymbol, - tokenAAmount, - tokenBAmount, - nativeTokenAmount, - ); - }); - - describe('Fvm', () => { - const dexKey = 'Fvm'; - const network = Network.FANTOM; - - const tokenASymbol: string = 'lzUSDC'; - const tokenBSymbol: string = 'axlUSDC'; - - const tokenAAmount: string = '1111100'; - const tokenBAmount: string = '1000000'; - const nativeTokenAmount = '11000000000000000'; - - testForNetwork( - network, - dexKey, - tokenASymbol, - tokenBSymbol, - tokenAAmount, - tokenBAmount, - nativeTokenAmount, - ); - }); - }); - - describe('Mainnet', () => { - const network = Network.MAINNET; - const tokens = Tokens[network]; - const holders = Holders[network]; - const provider = new StaticJsonRpcProvider( - generateConfig(network).privateHttpProvider, - network, - ); - - describe(`SolidlyV2`, () => { - const dexKey = 'SolidlyV2'; - - describe(`simpleSwap`, () => { - describe(`Volatile`, () => { - it('ETH -> USDC', async () => { - await testE2E( - tokens.ETH, - tokens.USDC, - holders.ETH, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - describe(`Stable`, () => { - it('USDC -> USDT', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - '10000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - }); - - describe(`multiSwap`, () => { - describe(`Volatile`, () => { - it('ETH -> USDC', async () => { - await testE2E( - tokens.ETH, - tokens.USDC, - holders.ETH, - '1000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - describe(`Stable`, () => { - it('USDC -> USDT', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - '10000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - }); - }); - }); - - describe('Polygon', () => { - const network = Network.POLYGON; - const tokens = Tokens[network]; - const holders = Holders[network]; - const provider = new StaticJsonRpcProvider( - generateConfig(network).privateHttpProvider, - network, - ); - - describe('Dystopia', () => { - const dexKey = 'Dystopia'; - const usdAmount = '1000000'; - - describe('Dystopia UniswapV2 Pools', () => { - const maticAmount = '1000000000000000000'; - - describe('simpleSwap', () => { - it('MATIC -> TOKEN', async () => { - await testE2E( - tokens.MATIC, - tokens.WETH, - holders.MATIC, - maticAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - - it('Token -> MATIC', async () => { - await testE2E( - tokens.USDT, - tokens.MATIC, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - - it('Token -> Token', async () => { - await testE2E( - tokens.WMATIC, - tokens.WETH, - holders.WMATIC, - maticAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - - describe('multiSwap', () => { - it('MATIC -> TOKEN', async () => { - await testE2E( - tokens.MATIC, - tokens.WETH, - holders.MATIC, - maticAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - - it('Token -> MATIC', async () => { - await testE2E( - tokens.USDT, - tokens.MATIC, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - - it('Token -> Token', async () => { - await testE2E( - tokens.WMATIC, - tokens.WETH, - holders.WMATIC, - maticAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - - describe('megaSwap', () => { - it('MATIC -> TOKEN', async () => { - await testE2E( - tokens.USDT, - tokens.MATIC, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - - it('Token -> MATIC', async () => { - await testE2E( - tokens.USDT, - tokens.MATIC, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - - it('Token -> Token', async () => { - await testE2E( - tokens.WMATIC, - tokens.WETH, - holders.WMATIC, - maticAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - }); - }); - - describe('Dystopia Stable Pools', () => { - describe('simpleSwap', () => { - it('Token -> Token', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - - describe('multiSwap', () => { - it('Token -> Token', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - - describe('megaSwap', () => { - it('Token -> Token', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - }); - }); - }); - }); - - describe('Optimism', () => { - const network = Network.OPTIMISM; - const tokens = Tokens[network]; - const holders = Holders[network]; - const provider = new StaticJsonRpcProvider( - generateConfig(network).privateHttpProvider, - network, - ); - - describe('Velodrome', () => { - const dexKey = 'Velodrome'; - - describe('simpleSwap', () => { - it('NATIVE -> TOKEN', async () => { - await testE2E( - tokens.ETH, - tokens.USDC, - holders.ETH, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('TOKEN -> NATIVE', async () => { - await testE2E( - tokens.USDC, - tokens.ETH, - holders.USDC, - '9900000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('TOKEN -> TOKEN', async () => { - await testE2E( - tokens.WETH, - tokens.USDC, - holders.WETH, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - - network, - provider, - ); - }); - }); - describe('multiSwap', () => { - it('NATIVE -> TOKEN', async () => { - await testE2E( - tokens.ETH, - tokens.USDC, - holders.ETH, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - - network, - provider, - ); - }); - it('TOKEN -> NATIVE', async () => { - await testE2E( - tokens.USDC, - tokens.ETH, - holders.USDC, - '9900000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('TOKEN -> TOKEN', async () => { - await testE2E( - tokens.WETH, - tokens.USDC, - holders.WETH, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - }); - - describe('VelodromeV2', () => { - const dexKey = 'VelodromeV2'; - - const network = Network.OPTIMISM; - - const tokenASymbol: string = 'USDC'; - const tokenBSymbol: string = 'USDT'; - - const tokenAAmount: string = '111110000'; - const tokenBAmount: string = '1100000000'; - const nativeTokenAmount = '11000000000000000'; - - testForNetwork( - network, - dexKey, - tokenASymbol, - tokenBSymbol, - tokenAAmount, - tokenBAmount, - nativeTokenAmount, - ); - }); - }); - - describe('BSC', () => { - const network = Network.BSC; - const tokens = Tokens[network]; - const holders = Holders[network]; - const provider = new StaticJsonRpcProvider( - generateConfig(network).privateHttpProvider, - network, - ); - - describe('Cone', () => { - const dexKey = 'Cone'; - const usdAmount = '1000000'; - - describe('Cone UniswapV2 Pools', () => { - const bnbAmount = '1000000000000000000'; - - describe('simpleSwap', () => { - it('BNB -> TOKEN', async () => { - await testE2E( - tokens.BNB, - tokens.BUSD, - holders.BNB, - bnbAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - - it('Token -> BNB', async () => { - await testE2E( - tokens.USDT, - tokens.BNB, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - - it('Token -> Token', async () => { - await testE2E( - tokens.WBNB, - tokens.CONE, - holders.WBNB, - bnbAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - - describe('multiSwap', () => { - it('BNB -> TOKEN', async () => { - await testE2E( - tokens.BNB, - tokens.BUSD, - holders.BNB, - bnbAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - - it('Token -> BNB', async () => { - await testE2E( - tokens.USDT, - tokens.BNB, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - - it('Token -> Token', async () => { - await testE2E( - tokens.WBNB, - tokens.CONE, - holders.WBNB, - bnbAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - - describe('megaSwap', () => { - it('BNB -> TOKEN', async () => { - await testE2E( - tokens.USDT, - tokens.BNB, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - - it('Token -> BNB', async () => { - await testE2E( - tokens.USDT, - tokens.BNB, - holders.USDT, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - - it('Token -> Token', async () => { - await testE2E( - tokens.WBNB, - tokens.CONE, - holders.WBNB, - bnbAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - }); - }); - - describe('Cone Stable Pools', () => { - describe('simpleSwap', () => { - it('Token -> Token', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - }); - - describe('multiSwap', () => { - it('Token -> Token', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - - describe('megaSwap', () => { - it('Token -> Token', async () => { - await testE2E( - tokens.USDC, - tokens.USDT, - holders.USDC, - usdAmount, - SwapSide.SELL, - dexKey, - ContractMethod.megaSwap, - network, - provider, - ); - }); - }); - }); - }); - - describe('Thena', () => { - const dexKey = 'Thena'; - - const sideToContractMethods = new Map([ - [ - SwapSide.SELL, - [ - ContractMethod.simpleSwap, - ContractMethod.multiSwap, - ContractMethod.megaSwap, - ], - ], - ]); - - const pairs: { name: string; sellAmount: string }[][] = [ - [ - { - name: 'BNB', - sellAmount: '1000000000000000000', - }, - { - name: 'USDT', - sellAmount: '10000000000000000000', - }, - ], - [ - { - name: 'USDT', - sellAmount: '10000000000000000000', - }, - { - name: 'USDC', - sellAmount: '10000000000000000000', - }, - ], - [ - { - name: 'ETH', - sellAmount: '5000000000000000000', - }, - { - name: 'BNB', - sellAmount: '1000000000000000000', - }, - ], - ]; - - sideToContractMethods.forEach((contractMethods, side) => - describe(`${side}`, () => { - contractMethods.forEach((contractMethod: ContractMethod) => { - pairs.forEach(pair => { - describe(`${contractMethod}`, () => { - it(`${pair[0].name} -> ${pair[1].name}`, async () => { - await testE2E( - tokens[pair[0].name], - tokens[pair[1].name], - holders[pair[0].name], - pair[0].sellAmount, - side, - dexKey, - contractMethod, - network, - provider, - ); - }); - it(`${pair[1].name} -> ${pair[0].name}`, async () => { - await testE2E( - tokens[pair[1].name], - tokens[pair[0].name], - holders[pair[1].name], - pair[1].sellAmount, - side, - dexKey, - contractMethod, - network, - provider, - ); - }); - }); - }); - }); - }), - ); - }); - }); - - describe('Avalanche', () => { - const network = Network.AVALANCHE; - const tokens = Tokens[network]; - const holders = Holders[network]; - const provider = new StaticJsonRpcProvider( - generateConfig(network).privateHttpProvider, - network, - ); - - describe('SoliSnek', () => { - const dexKey = 'SoliSnek'; - - describe('simpleSwap', () => { - it('NATIVE -> TOKEN', async () => { - await testE2E( - tokens.AVAX, - tokens.USDC, - holders.AVAX, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('TOKEN -> NATIVE', async () => { - await testE2E( - tokens.USDC, - tokens.AVAX, - holders.USDC, - '9900000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - network, - provider, - ); - }); - it('TOKEN -> TOKEN', async () => { - await testE2E( - tokens.WAVAX, - tokens.USDC, - holders.WAVAX, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.simpleSwap, - - network, - provider, - ); - }); - }); - describe('multiSwap', () => { - it('NATIVE -> TOKEN', async () => { - await testE2E( - tokens.AVAX, - tokens.USDC, - holders.AVAX, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - - network, - provider, - ); - }); - it('TOKEN -> NATIVE', async () => { - await testE2E( - tokens.USDC, - tokens.AVAX, - holders.USDC, - '9900000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - it('TOKEN -> TOKEN', async () => { - await testE2E( - tokens.WAVAX, - tokens.USDC, - holders.WAVAX, - '3000000000000000000', - SwapSide.SELL, - dexKey, - ContractMethod.multiSwap, - network, - provider, - ); - }); - }); - }); - }); - - describe('Arbitrum', () => { - const network = Network.ARBITRUM; - const tokens = Tokens[network]; - const holders = Holders[network]; - const provider = new StaticJsonRpcProvider( - generateConfig(network).privateHttpProvider, - network, - ); - - describe(`Chronos`, () => { - const dexKey = 'Chronos'; - - const sideToContractMethods = new Map([ - [ - SwapSide.SELL, - [ - ContractMethod.simpleSwap, - ContractMethod.multiSwap, - ContractMethod.megaSwap, - ], - ], - ]); - - const pairs: { name: string; sellAmount: string }[][] = [ - [ - { - name: 'ETH', - sellAmount: '1000000000000000000', - }, - { - name: 'USDC', - sellAmount: '100000000', - }, - ], - [ - { - name: 'USDT', - sellAmount: '100000000', - }, - { - name: 'USDC', - sellAmount: '100000000', - }, - ], - [ - { - name: 'USDC', - sellAmount: '100000000', - }, - { - name: 'DAI', - sellAmount: '100000000000000000000', - }, - ], - [ - { - name: 'ARB', - sellAmount: '100000000', - }, - { - name: 'ETH', - sellAmount: '100000000000000000000', - }, - ], - ]; - - sideToContractMethods.forEach((contractMethods, side) => - describe(`${side}`, () => { - contractMethods.forEach((contractMethod: ContractMethod) => { - pairs.forEach(pair => { - describe(`${contractMethod}`, () => { - it(`${pair[0].name} -> ${pair[1].name}`, async () => { - await testE2E( - tokens[pair[0].name], - tokens[pair[1].name], - holders[pair[0].name], - pair[0].sellAmount, - side, - dexKey, - contractMethod, - network, - provider, - ); - }); - it(`${pair[1].name} -> ${pair[0].name}`, async () => { - await testE2E( - tokens[pair[1].name], - tokens[pair[0].name], - holders[pair[1].name], - pair[1].sellAmount, - side, - dexKey, - contractMethod, - network, - provider, - ); - }); - }); - }); - }); - }), - ); - }); - - describe('Ramses', () => { - const dexKey = 'Ramses'; - - const sideToContractMethods = new Map([ - [ - SwapSide.SELL, - [ - ContractMethod.simpleSwap, - ContractMethod.multiSwap, - ContractMethod.megaSwap, - ], - ], - ]); - - const pairs: { name: string; sellAmount: string }[][] = [ - [ - { - name: 'ETH', - sellAmount: '10000000000000', - }, - { - name: 'USDCe', - sellAmount: '100000000', - }, - ], - [ - { - name: 'WETH', - sellAmount: '10000000000000', - }, - { - name: 'USDCe', - sellAmount: '100000000', - }, - ], - [ - { - name: 'USDT', - sellAmount: '100000000', - }, - { - name: 'USDCe', - sellAmount: '100000000', - }, - ], - [ - { - name: 'USDCe', - sellAmount: '500000', - }, - { - name: 'DAI', - sellAmount: '1000000000000000000', - }, - ], - ]; - - sideToContractMethods.forEach((contractMethods, side) => - describe(`${side}`, () => { - contractMethods.forEach((contractMethod: ContractMethod) => { - pairs.forEach(pair => { - describe(`${contractMethod}`, () => { - it(`${pair[0].name} -> ${pair[1].name}`, async () => { - await testE2E( - tokens[pair[0].name], - tokens[pair[1].name], - holders[pair[0].name], - pair[0].sellAmount, - side, - dexKey, - contractMethod, - network, - provider, - ); - }); - it(`${pair[1].name} -> ${pair[0].name}`, async () => { - await testE2E( - tokens[pair[1].name], - tokens[pair[0].name], - holders[pair[1].name], - pair[1].sellAmount, - side, - dexKey, - contractMethod, - network, - provider, - ); - }); - }); - }); - }); - }), - ); - }); - }); + // describe('Fantom', () => { + // const network = Network.FANTOM; + // const tokens = Tokens[network]; + // const holders = Holders[network]; + // const provider = new StaticJsonRpcProvider( + // generateConfig(network).privateHttpProvider, + // network, + // ); + // + // describe(`Solidly`, () => { + // const dexKey = 'Solidly'; + // + // describe(`simpleSwap`, () => { + // describe(`Volatile`, () => { + // it('FTM -> USDC', async () => { + // await testE2E( + // tokens.FTM, + // tokens.USDC, + // holders.FTM, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('FTM -> SPIRIT', async () => { + // await testE2E( + // tokens.FTM, + // tokens.SPIRIT, + // holders.FTM, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> FTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.FTM, + // holders.SPIRIT, + // '11000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> WFTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.WFTM, + // holders.SPIRIT, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // describe(`Stable`, () => { + // it('USDC -> USDT', async () => { + // await testE2E( + // tokens.USDC, + // tokens.FUSDT, + // holders.USDC, + // '100000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // describe(`multiSwap`, () => { + // describe(`Volatile`, () => { + // it('FTM -> USDC', async () => { + // await testE2E( + // tokens.FTM, + // tokens.USDC, + // holders.FTM, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('FTM -> SPIRIT', async () => { + // await testE2E( + // tokens.FTM, + // tokens.SPIRIT, + // holders.FTM, + // '11000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> FTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.FTM, + // holders.SPIRIT, + // '11000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> WFTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.WFTM, + // holders.SPIRIT, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // describe(`Stable`, () => { + // it('USDC -> USDT', async () => { + // await testE2E( + // tokens.USDC, + // tokens.FUSDT, + // holders.USDC, + // '100000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // + // describe('SpiritSwapV2', () => { + // const dexKey = 'SpiritSwapV2'; + // describe(`simpleSwap`, () => { + // describe(`Volatile`, () => { + // it('FTM -> USDC', async () => { + // await testE2E( + // tokens.FTM, + // tokens.USDC, + // holders.FTM, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('FTM -> SPIRIT', async () => { + // await testE2E( + // tokens.FTM, + // tokens.SPIRIT, + // holders.FTM, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> FTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.FTM, + // holders.SPIRIT, + // '11000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> WFTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.WFTM, + // holders.SPIRIT, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // describe(`Stable`, () => { + // it('USDC -> USDT', async () => { + // await testE2E( + // tokens.USDC, + // tokens.FUSDT, + // holders.USDC, + // '100000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // describe(`multiSwap`, () => { + // describe(`Volatile`, () => { + // it('FTM -> USDC', async () => { + // await testE2E( + // tokens.FTM, + // tokens.USDC, + // holders.FTM, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('FTM -> SPIRIT', async () => { + // await testE2E( + // tokens.FTM, + // tokens.SPIRIT, + // holders.FTM, + // '11000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> FTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.FTM, + // holders.SPIRIT, + // '11000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('SPIRIT -> WFTM', async () => { + // await testE2E( + // tokens.SPIRIT, + // tokens.WFTM, + // holders.SPIRIT, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // describe(`Stable`, () => { + // it('USDC -> USDT', async () => { + // await testE2E( + // tokens.USDC, + // tokens.FUSDT, + // holders.USDC, + // '100000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // + // describe('Equalizer', () => { + // const dexKey = 'Equalizer'; + // const network = Network.FANTOM; + // + // const tokenASymbol: string = 'FUSDT'; + // const tokenBSymbol: string = 'USDC'; + // + // const tokenAAmount: string = '111110'; + // const tokenBAmount: string = '100000'; + // const nativeTokenAmount = '11000000000000000'; + // + // testForNetwork( + // network, + // dexKey, + // tokenASymbol, + // tokenBSymbol, + // tokenAAmount, + // tokenBAmount, + // nativeTokenAmount, + // ); + // }); + // + // describe('Fvm', () => { + // const dexKey = 'Fvm'; + // const network = Network.FANTOM; + // + // const tokenASymbol: string = 'lzUSDC'; + // const tokenBSymbol: string = 'axlUSDC'; + // + // const tokenAAmount: string = '1111100'; + // const tokenBAmount: string = '1000000'; + // const nativeTokenAmount = '11000000000000000'; + // + // testForNetwork( + // network, + // dexKey, + // tokenASymbol, + // tokenBSymbol, + // tokenAAmount, + // tokenBAmount, + // nativeTokenAmount, + // ); + // }); + // }); + + // describe('Mainnet', () => { + // const network = Network.MAINNET; + // const tokens = Tokens[network]; + // const holders = Holders[network]; + // const provider = new StaticJsonRpcProvider( + // generateConfig(network).privateHttpProvider, + // network, + // ); + // + // describe(`SolidlyV2`, () => { + // const dexKey = 'SolidlyV2'; + // + // describe(`simpleSwap`, () => { + // describe(`Volatile`, () => { + // it('ETH -> USDC', async () => { + // await testE2E( + // tokens.ETH, + // tokens.USDC, + // holders.ETH, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // describe(`Stable`, () => { + // it('USDC -> USDT', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // '10000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // + // describe(`multiSwap`, () => { + // describe(`Volatile`, () => { + // it('ETH -> USDC', async () => { + // await testE2E( + // tokens.ETH, + // tokens.USDC, + // holders.ETH, + // '1000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // describe(`Stable`, () => { + // it('USDC -> USDT', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // '10000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // }); + + // describe('Polygon', () => { + // const network = Network.POLYGON; + // const tokens = Tokens[network]; + // const holders = Holders[network]; + // const provider = new StaticJsonRpcProvider( + // generateConfig(network).privateHttpProvider, + // network, + // ); + // + // describe('Dystopia', () => { + // const dexKey = 'Dystopia'; + // const usdAmount = '1000000'; + // + // describe('Dystopia UniswapV2 Pools', () => { + // const maticAmount = '1000000000000000000'; + // + // describe('simpleSwap', () => { + // it('MATIC -> TOKEN', async () => { + // await testE2E( + // tokens.MATIC, + // tokens.WETH, + // holders.MATIC, + // maticAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> MATIC', async () => { + // await testE2E( + // tokens.USDT, + // tokens.MATIC, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> Token', async () => { + // await testE2E( + // tokens.WMATIC, + // tokens.WETH, + // holders.WMATIC, + // maticAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('multiSwap', () => { + // it('MATIC -> TOKEN', async () => { + // await testE2E( + // tokens.MATIC, + // tokens.WETH, + // holders.MATIC, + // maticAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> MATIC', async () => { + // await testE2E( + // tokens.USDT, + // tokens.MATIC, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> Token', async () => { + // await testE2E( + // tokens.WMATIC, + // tokens.WETH, + // holders.WMATIC, + // maticAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('megaSwap', () => { + // it('MATIC -> TOKEN', async () => { + // await testE2E( + // tokens.USDT, + // tokens.MATIC, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> MATIC', async () => { + // await testE2E( + // tokens.USDT, + // tokens.MATIC, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> Token', async () => { + // await testE2E( + // tokens.WMATIC, + // tokens.WETH, + // holders.WMATIC, + // maticAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // + // describe('Dystopia Stable Pools', () => { + // describe('simpleSwap', () => { + // it('Token -> Token', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('multiSwap', () => { + // it('Token -> Token', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('megaSwap', () => { + // it('Token -> Token', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // }); + + // describe('Optimism', () => { + // const network = Network.OPTIMISM; + // const tokens = Tokens[network]; + // const holders = Holders[network]; + // const provider = new StaticJsonRpcProvider( + // generateConfig(network).privateHttpProvider, + // network, + // ); + // + // describe('Velodrome', () => { + // const dexKey = 'Velodrome'; + // + // describe('simpleSwap', () => { + // it('NATIVE -> TOKEN', async () => { + // await testE2E( + // tokens.ETH, + // tokens.USDC, + // holders.ETH, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('TOKEN -> NATIVE', async () => { + // await testE2E( + // tokens.USDC, + // tokens.ETH, + // holders.USDC, + // '9900000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('TOKEN -> TOKEN', async () => { + // await testE2E( + // tokens.WETH, + // tokens.USDC, + // holders.WETH, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // + // network, + // provider, + // ); + // }); + // }); + // describe('multiSwap', () => { + // it('NATIVE -> TOKEN', async () => { + // await testE2E( + // tokens.ETH, + // tokens.USDC, + // holders.ETH, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // + // network, + // provider, + // ); + // }); + // it('TOKEN -> NATIVE', async () => { + // await testE2E( + // tokens.USDC, + // tokens.ETH, + // holders.USDC, + // '9900000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('TOKEN -> TOKEN', async () => { + // await testE2E( + // tokens.WETH, + // tokens.USDC, + // holders.WETH, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // + // describe('VelodromeV2', () => { + // const dexKey = 'VelodromeV2'; + // + // const network = Network.OPTIMISM; + // + // const tokenASymbol: string = 'USDC'; + // const tokenBSymbol: string = 'USDT'; + // + // const tokenAAmount: string = '111110000'; + // const tokenBAmount: string = '1100000000'; + // const nativeTokenAmount = '11000000000000000'; + // + // testForNetwork( + // network, + // dexKey, + // tokenASymbol, + // tokenBSymbol, + // tokenAAmount, + // tokenBAmount, + // nativeTokenAmount, + // ); + // }); + // }); + + // describe('BSC', () => { + // const network = Network.BSC; + // const tokens = Tokens[network]; + // const holders = Holders[network]; + // const provider = new StaticJsonRpcProvider( + // generateConfig(network).privateHttpProvider, + // network, + // ); + // + // describe('Cone', () => { + // const dexKey = 'Cone'; + // const usdAmount = '1000000'; + // + // describe('Cone UniswapV2 Pools', () => { + // const bnbAmount = '1000000000000000000'; + // + // describe('simpleSwap', () => { + // it('BNB -> TOKEN', async () => { + // await testE2E( + // tokens.BNB, + // tokens.BUSD, + // holders.BNB, + // bnbAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> BNB', async () => { + // await testE2E( + // tokens.USDT, + // tokens.BNB, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> Token', async () => { + // await testE2E( + // tokens.WBNB, + // tokens.CONE, + // holders.WBNB, + // bnbAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('multiSwap', () => { + // it('BNB -> TOKEN', async () => { + // await testE2E( + // tokens.BNB, + // tokens.BUSD, + // holders.BNB, + // bnbAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> BNB', async () => { + // await testE2E( + // tokens.USDT, + // tokens.BNB, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> Token', async () => { + // await testE2E( + // tokens.WBNB, + // tokens.CONE, + // holders.WBNB, + // bnbAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('megaSwap', () => { + // it('BNB -> TOKEN', async () => { + // await testE2E( + // tokens.USDT, + // tokens.BNB, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> BNB', async () => { + // await testE2E( + // tokens.USDT, + // tokens.BNB, + // holders.USDT, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // + // it('Token -> Token', async () => { + // await testE2E( + // tokens.WBNB, + // tokens.CONE, + // holders.WBNB, + // bnbAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // + // describe('Cone Stable Pools', () => { + // describe('simpleSwap', () => { + // it('Token -> Token', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('multiSwap', () => { + // it('Token -> Token', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // + // describe('megaSwap', () => { + // it('Token -> Token', async () => { + // await testE2E( + // tokens.USDC, + // tokens.USDT, + // holders.USDC, + // usdAmount, + // SwapSide.SELL, + // dexKey, + // ContractMethod.megaSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // + // describe('Thena', () => { + // const dexKey = 'Thena'; + // + // const sideToContractMethods = new Map([ + // [ + // SwapSide.SELL, + // [ + // ContractMethod.simpleSwap, + // ContractMethod.multiSwap, + // ContractMethod.megaSwap, + // ], + // ], + // ]); + // + // const pairs: { name: string; sellAmount: string }[][] = [ + // [ + // { + // name: 'BNB', + // sellAmount: '1000000000000000000', + // }, + // { + // name: 'USDT', + // sellAmount: '10000000000000000000', + // }, + // ], + // [ + // { + // name: 'USDT', + // sellAmount: '10000000000000000000', + // }, + // { + // name: 'USDC', + // sellAmount: '10000000000000000000', + // }, + // ], + // [ + // { + // name: 'ETH', + // sellAmount: '5000000000000000000', + // }, + // { + // name: 'BNB', + // sellAmount: '1000000000000000000', + // }, + // ], + // ]; + // + // sideToContractMethods.forEach((contractMethods, side) => + // describe(`${side}`, () => { + // contractMethods.forEach((contractMethod: ContractMethod) => { + // pairs.forEach(pair => { + // describe(`${contractMethod}`, () => { + // it(`${pair[0].name} -> ${pair[1].name}`, async () => { + // await testE2E( + // tokens[pair[0].name], + // tokens[pair[1].name], + // holders[pair[0].name], + // pair[0].sellAmount, + // side, + // dexKey, + // contractMethod, + // network, + // provider, + // ); + // }); + // it(`${pair[1].name} -> ${pair[0].name}`, async () => { + // await testE2E( + // tokens[pair[1].name], + // tokens[pair[0].name], + // holders[pair[1].name], + // pair[1].sellAmount, + // side, + // dexKey, + // contractMethod, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // }), + // ); + // }); + // }); + + // describe('Avalanche', () => { + // const network = Network.AVALANCHE; + // const tokens = Tokens[network]; + // const holders = Holders[network]; + // const provider = new StaticJsonRpcProvider( + // generateConfig(network).privateHttpProvider, + // network, + // ); + // + // describe('SoliSnek', () => { + // const dexKey = 'SoliSnek'; + // + // describe('simpleSwap', () => { + // it('NATIVE -> TOKEN', async () => { + // await testE2E( + // tokens.AVAX, + // tokens.USDC, + // holders.AVAX, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('TOKEN -> NATIVE', async () => { + // await testE2E( + // tokens.USDC, + // tokens.AVAX, + // holders.USDC, + // '9900000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // network, + // provider, + // ); + // }); + // it('TOKEN -> TOKEN', async () => { + // await testE2E( + // tokens.WAVAX, + // tokens.USDC, + // holders.WAVAX, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.simpleSwap, + // + // network, + // provider, + // ); + // }); + // }); + // describe('multiSwap', () => { + // it('NATIVE -> TOKEN', async () => { + // await testE2E( + // tokens.AVAX, + // tokens.USDC, + // holders.AVAX, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // + // network, + // provider, + // ); + // }); + // it('TOKEN -> NATIVE', async () => { + // await testE2E( + // tokens.USDC, + // tokens.AVAX, + // holders.USDC, + // '9900000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // it('TOKEN -> TOKEN', async () => { + // await testE2E( + // tokens.WAVAX, + // tokens.USDC, + // holders.WAVAX, + // '3000000000000000000', + // SwapSide.SELL, + // dexKey, + // ContractMethod.multiSwap, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + + // describe('Arbitrum', () => { + // const network = Network.ARBITRUM; + // const tokens = Tokens[network]; + // const holders = Holders[network]; + // const provider = new StaticJsonRpcProvider( + // generateConfig(network).privateHttpProvider, + // network, + // ); + // + // describe(`Chronos`, () => { + // const dexKey = 'Chronos'; + // + // const sideToContractMethods = new Map([ + // [ + // SwapSide.SELL, + // [ + // ContractMethod.simpleSwap, + // ContractMethod.multiSwap, + // ContractMethod.megaSwap, + // ], + // ], + // ]); + // + // const pairs: { name: string; sellAmount: string }[][] = [ + // [ + // { + // name: 'ETH', + // sellAmount: '1000000000000000000', + // }, + // { + // name: 'USDC', + // sellAmount: '100000000', + // }, + // ], + // [ + // { + // name: 'USDT', + // sellAmount: '100000000', + // }, + // { + // name: 'USDC', + // sellAmount: '100000000', + // }, + // ], + // [ + // { + // name: 'USDC', + // sellAmount: '100000000', + // }, + // { + // name: 'DAI', + // sellAmount: '100000000000000000000', + // }, + // ], + // [ + // { + // name: 'ARB', + // sellAmount: '100000000', + // }, + // { + // name: 'ETH', + // sellAmount: '100000000000000000000', + // }, + // ], + // ]; + // + // sideToContractMethods.forEach((contractMethods, side) => + // describe(`${side}`, () => { + // contractMethods.forEach((contractMethod: ContractMethod) => { + // pairs.forEach(pair => { + // describe(`${contractMethod}`, () => { + // it(`${pair[0].name} -> ${pair[1].name}`, async () => { + // await testE2E( + // tokens[pair[0].name], + // tokens[pair[1].name], + // holders[pair[0].name], + // pair[0].sellAmount, + // side, + // dexKey, + // contractMethod, + // network, + // provider, + // ); + // }); + // it(`${pair[1].name} -> ${pair[0].name}`, async () => { + // await testE2E( + // tokens[pair[1].name], + // tokens[pair[0].name], + // holders[pair[1].name], + // pair[1].sellAmount, + // side, + // dexKey, + // contractMethod, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // }), + // ); + // }); + // + // describe('Ramses', () => { + // const dexKey = 'Ramses'; + // + // const sideToContractMethods = new Map([ + // [ + // SwapSide.SELL, + // [ + // ContractMethod.simpleSwap, + // ContractMethod.multiSwap, + // ContractMethod.megaSwap, + // ], + // ], + // ]); + // + // const pairs: { name: string; sellAmount: string }[][] = [ + // [ + // { + // name: 'ETH', + // sellAmount: '10000000000000', + // }, + // { + // name: 'USDCe', + // sellAmount: '100000000', + // }, + // ], + // [ + // { + // name: 'WETH', + // sellAmount: '10000000000000', + // }, + // { + // name: 'USDCe', + // sellAmount: '100000000', + // }, + // ], + // [ + // { + // name: 'USDT', + // sellAmount: '100000000', + // }, + // { + // name: 'USDCe', + // sellAmount: '100000000', + // }, + // ], + // [ + // { + // name: 'USDCe', + // sellAmount: '500000', + // }, + // { + // name: 'DAI', + // sellAmount: '1000000000000000000', + // }, + // ], + // ]; + // + // sideToContractMethods.forEach((contractMethods, side) => + // describe(`${side}`, () => { + // contractMethods.forEach((contractMethod: ContractMethod) => { + // pairs.forEach(pair => { + // describe(`${contractMethod}`, () => { + // it(`${pair[0].name} -> ${pair[1].name}`, async () => { + // await testE2E( + // tokens[pair[0].name], + // tokens[pair[1].name], + // holders[pair[0].name], + // pair[0].sellAmount, + // side, + // dexKey, + // contractMethod, + // network, + // provider, + // ); + // }); + // it(`${pair[1].name} -> ${pair[0].name}`, async () => { + // await testE2E( + // tokens[pair[1].name], + // tokens[pair[0].name], + // holders[pair[1].name], + // pair[1].sellAmount, + // side, + // dexKey, + // contractMethod, + // network, + // provider, + // ); + // }); + // }); + // }); + // }); + // }), + // ); + // }); + // }); describe('Base', () => { const network = Network.BASE; diff --git a/tests/tenderly-simulation.ts b/tests/tenderly-simulation.ts index ddc53c786..894ea941b 100644 --- a/tests/tenderly-simulation.ts +++ b/tests/tenderly-simulation.ts @@ -76,6 +76,7 @@ export class TenderlySimulation implements TransactionSimulator { } try { + await process.nextTick(() => { }); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express let res = await axios.post( `https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/fork`, { From ef47bc639e1ba91b3045a47b5b11279fbb054c65 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 11:52:23 +0300 Subject: [PATCH 34/73] add --forceExit option for jjest tests --- .github/workflows/ci.yaml | 2 +- src/dex/solidly/solidly-e2e.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index feff84e3e..a87286170 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,4 +40,4 @@ jobs: HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }} HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} - run: npx jest --verbose --onlyChanged --changedSince=origin/master + run: npx jest --verbose --onlyChanged --changedSince=origin/master --forceExit diff --git a/src/dex/solidly/solidly-e2e.test.ts b/src/dex/solidly/solidly-e2e.test.ts index 8c27c2373..826a1155c 100644 --- a/src/dex/solidly/solidly-e2e.test.ts +++ b/src/dex/solidly/solidly-e2e.test.ts @@ -92,7 +92,7 @@ function testForNetwork( } describe('New test', () => { - it('should2', () => { + it('should2 ', () => { expect(true).toBe(true); }); }); From bd23fc84419dfa0a2cd3263a06d52cc2040e9d41 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 15:07:37 +0300 Subject: [PATCH 35/73] update --- .github/workflows/ci.yaml | 9 ++++++++- src/dex/dexalot/dexalot-e2e.test.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a87286170..5509c6285 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,4 +40,11 @@ jobs: HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }} HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} - run: npx jest --verbose --onlyChanged --changedSince=origin/master --forceExit + run: | + CHANGED_SPECS=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep test.ts) + if [ -n "$CHANGED_SPECS" ]; then + echo "Running the following changed specs" + echo $CHANGED_SPECS + npx jest --ci --verbose $CHANGED_SPECS + fi +# run: npx jest --verbose --onlyChanged --changedSince=origin/master --forceExit diff --git a/src/dex/dexalot/dexalot-e2e.test.ts b/src/dex/dexalot/dexalot-e2e.test.ts index 5834b71b7..1945a2dd4 100644 --- a/src/dex/dexalot/dexalot-e2e.test.ts +++ b/src/dex/dexalot/dexalot-e2e.test.ts @@ -167,7 +167,7 @@ function testForNetwork( } describe('Dexalot E2E', () => { - const dexKey = 'Dexalot'; + const dexKey = 'Dexalot '; describe('Avalanche', () => { const network = Network.AVALANCHE; From 61879d1771ead381f3a1ec0afc21019f2ad0601b Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 15:14:19 +0300 Subject: [PATCH 36/73] update --- .github/workflows/ci.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5509c6285..0addd97f1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,11 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Checkout uses: actions/checkout@v3 with: @@ -45,6 +50,6 @@ jobs: if [ -n "$CHANGED_SPECS" ]; then echo "Running the following changed specs" echo $CHANGED_SPECS - npx jest --ci --verbose $CHANGED_SPECS + npx jest --ci --forceExit --verbose $CHANGED_SPECS fi # run: npx jest --verbose --onlyChanged --changedSince=origin/master --forceExit From 67cd64304767d1ed3d20040d0e308758d6ca5842 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 16:14:37 +0300 Subject: [PATCH 37/73] update --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0addd97f1..4b632d6fb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,7 +46,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_SPECS=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep test.ts) + CHANGED_SPECS=$(git diff --name-only origin/master origin/${{ github.ref }} | grep test.ts) if [ -n "$CHANGED_SPECS" ]; then echo "Running the following changed specs" echo $CHANGED_SPECS From fbcef53f3c48c4ce212164ddd7050233fbaee0cb Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 16:29:12 +0300 Subject: [PATCH 38/73] update --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4b632d6fb..4c9e6556c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,7 +46,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_SPECS=$(git diff --name-only origin/master origin/${{ github.ref }} | grep test.ts) + CHANGED_SPECS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts) if [ -n "$CHANGED_SPECS" ]; then echo "Running the following changed specs" echo $CHANGED_SPECS From 1ddede9645d42c9c64e62f00e92494f4f6d7fa7c Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 16:45:14 +0300 Subject: [PATCH 39/73] update --- src/dex/dexalot/dexalot-e2e.test.ts | 2 +- tests/tenderly-simulation.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dex/dexalot/dexalot-e2e.test.ts b/src/dex/dexalot/dexalot-e2e.test.ts index 1945a2dd4..5834b71b7 100644 --- a/src/dex/dexalot/dexalot-e2e.test.ts +++ b/src/dex/dexalot/dexalot-e2e.test.ts @@ -167,7 +167,7 @@ function testForNetwork( } describe('Dexalot E2E', () => { - const dexKey = 'Dexalot '; + const dexKey = 'Dexalot'; describe('Avalanche', () => { const network = Network.AVALANCHE; diff --git a/tests/tenderly-simulation.ts b/tests/tenderly-simulation.ts index 894ea941b..b1bcd5982 100644 --- a/tests/tenderly-simulation.ts +++ b/tests/tenderly-simulation.ts @@ -110,6 +110,7 @@ export class TenderlySimulation implements TransactionSimulator { }; try { if (stateOverrides) { + await process.nextTick(() => { }); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express const result = await axios.post( ` https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/contracts/encode-states`, @@ -134,6 +135,7 @@ export class TenderlySimulation implements TransactionSimulator { ); } + await process.nextTick(() => { }); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express const { data } = await axios.post( `https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/fork/${this.forkId}/simulate`, _params, From 0174f3abd31157bcdf7f2fcc92d4718de67cb78f Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 17:08:10 +0300 Subject: [PATCH 40/73] no changed tests --- .github/workflows/ci.yaml | 6 - src/dex/solidly/solidly-e2e.test.ts | 2672 +++++++++++++-------------- 2 files changed, 1333 insertions(+), 1345 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4c9e6556c..d0b4a2202 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,11 +5,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Checkout uses: actions/checkout@v3 with: @@ -52,4 +47,3 @@ jobs: echo $CHANGED_SPECS npx jest --ci --forceExit --verbose $CHANGED_SPECS fi -# run: npx jest --verbose --onlyChanged --changedSince=origin/master --forceExit diff --git a/src/dex/solidly/solidly-e2e.test.ts b/src/dex/solidly/solidly-e2e.test.ts index 826a1155c..dc90a71d1 100644 --- a/src/dex/solidly/solidly-e2e.test.ts +++ b/src/dex/solidly/solidly-e2e.test.ts @@ -91,1347 +91,1341 @@ function testForNetwork( }); } -describe('New test', () => { - it('should2 ', () => { - expect(true).toBe(true); +describe('Solidly E2E', () => { + describe('Fantom', () => { + const network = Network.FANTOM; + const tokens = Tokens[network]; + const holders = Holders[network]; + const provider = new StaticJsonRpcProvider( + generateConfig(network).privateHttpProvider, + network, + ); + + describe(`Solidly`, () => { + const dexKey = 'Solidly'; + + describe(`simpleSwap`, () => { + describe(`Volatile`, () => { + it('FTM -> USDC', async () => { + await testE2E( + tokens.FTM, + tokens.USDC, + holders.FTM, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('FTM -> SPIRIT', async () => { + await testE2E( + tokens.FTM, + tokens.SPIRIT, + holders.FTM, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('SPIRIT -> FTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.FTM, + holders.SPIRIT, + '11000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('SPIRIT -> WFTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.WFTM, + holders.SPIRIT, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + describe(`Stable`, () => { + it('USDC -> USDT', async () => { + await testE2E( + tokens.USDC, + tokens.FUSDT, + holders.USDC, + '100000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + }); + describe(`multiSwap`, () => { + describe(`Volatile`, () => { + it('FTM -> USDC', async () => { + await testE2E( + tokens.FTM, + tokens.USDC, + holders.FTM, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('FTM -> SPIRIT', async () => { + await testE2E( + tokens.FTM, + tokens.SPIRIT, + holders.FTM, + '11000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('SPIRIT -> FTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.FTM, + holders.SPIRIT, + '11000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('SPIRIT -> WFTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.WFTM, + holders.SPIRIT, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + describe(`Stable`, () => { + it('USDC -> USDT', async () => { + await testE2E( + tokens.USDC, + tokens.FUSDT, + holders.USDC, + '100000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + }); + }); + + describe('SpiritSwapV2', () => { + const dexKey = 'SpiritSwapV2'; + describe(`simpleSwap`, () => { + describe(`Volatile`, () => { + it('FTM -> USDC', async () => { + await testE2E( + tokens.FTM, + tokens.USDC, + holders.FTM, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('FTM -> SPIRIT', async () => { + await testE2E( + tokens.FTM, + tokens.SPIRIT, + holders.FTM, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('SPIRIT -> FTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.FTM, + holders.SPIRIT, + '11000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('SPIRIT -> WFTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.WFTM, + holders.SPIRIT, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + describe(`Stable`, () => { + it('USDC -> USDT', async () => { + await testE2E( + tokens.USDC, + tokens.FUSDT, + holders.USDC, + '100000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + }); + describe(`multiSwap`, () => { + describe(`Volatile`, () => { + it('FTM -> USDC', async () => { + await testE2E( + tokens.FTM, + tokens.USDC, + holders.FTM, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('FTM -> SPIRIT', async () => { + await testE2E( + tokens.FTM, + tokens.SPIRIT, + holders.FTM, + '11000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('SPIRIT -> FTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.FTM, + holders.SPIRIT, + '11000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('SPIRIT -> WFTM', async () => { + await testE2E( + tokens.SPIRIT, + tokens.WFTM, + holders.SPIRIT, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + describe(`Stable`, () => { + it('USDC -> USDT', async () => { + await testE2E( + tokens.USDC, + tokens.FUSDT, + holders.USDC, + '100000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + }); + }); + + describe('Equalizer', () => { + const dexKey = 'Equalizer'; + const network = Network.FANTOM; + + const tokenASymbol: string = 'FUSDT'; + const tokenBSymbol: string = 'USDC'; + + const tokenAAmount: string = '111110'; + const tokenBAmount: string = '100000'; + const nativeTokenAmount = '11000000000000000'; + + testForNetwork( + network, + dexKey, + tokenASymbol, + tokenBSymbol, + tokenAAmount, + tokenBAmount, + nativeTokenAmount, + ); + }); + + describe('Fvm', () => { + const dexKey = 'Fvm'; + const network = Network.FANTOM; + + const tokenASymbol: string = 'lzUSDC'; + const tokenBSymbol: string = 'axlUSDC'; + + const tokenAAmount: string = '1111100'; + const tokenBAmount: string = '1000000'; + const nativeTokenAmount = '11000000000000000'; + + testForNetwork( + network, + dexKey, + tokenASymbol, + tokenBSymbol, + tokenAAmount, + tokenBAmount, + nativeTokenAmount, + ); + }); }); -}); -describe('Solidly E2E', () => { - // describe('Fantom', () => { - // const network = Network.FANTOM; - // const tokens = Tokens[network]; - // const holders = Holders[network]; - // const provider = new StaticJsonRpcProvider( - // generateConfig(network).privateHttpProvider, - // network, - // ); - // - // describe(`Solidly`, () => { - // const dexKey = 'Solidly'; - // - // describe(`simpleSwap`, () => { - // describe(`Volatile`, () => { - // it('FTM -> USDC', async () => { - // await testE2E( - // tokens.FTM, - // tokens.USDC, - // holders.FTM, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('FTM -> SPIRIT', async () => { - // await testE2E( - // tokens.FTM, - // tokens.SPIRIT, - // holders.FTM, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> FTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.FTM, - // holders.SPIRIT, - // '11000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> WFTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.WFTM, - // holders.SPIRIT, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // describe(`Stable`, () => { - // it('USDC -> USDT', async () => { - // await testE2E( - // tokens.USDC, - // tokens.FUSDT, - // holders.USDC, - // '100000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // describe(`multiSwap`, () => { - // describe(`Volatile`, () => { - // it('FTM -> USDC', async () => { - // await testE2E( - // tokens.FTM, - // tokens.USDC, - // holders.FTM, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('FTM -> SPIRIT', async () => { - // await testE2E( - // tokens.FTM, - // tokens.SPIRIT, - // holders.FTM, - // '11000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> FTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.FTM, - // holders.SPIRIT, - // '11000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> WFTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.WFTM, - // holders.SPIRIT, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // describe(`Stable`, () => { - // it('USDC -> USDT', async () => { - // await testE2E( - // tokens.USDC, - // tokens.FUSDT, - // holders.USDC, - // '100000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // - // describe('SpiritSwapV2', () => { - // const dexKey = 'SpiritSwapV2'; - // describe(`simpleSwap`, () => { - // describe(`Volatile`, () => { - // it('FTM -> USDC', async () => { - // await testE2E( - // tokens.FTM, - // tokens.USDC, - // holders.FTM, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('FTM -> SPIRIT', async () => { - // await testE2E( - // tokens.FTM, - // tokens.SPIRIT, - // holders.FTM, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> FTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.FTM, - // holders.SPIRIT, - // '11000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> WFTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.WFTM, - // holders.SPIRIT, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // describe(`Stable`, () => { - // it('USDC -> USDT', async () => { - // await testE2E( - // tokens.USDC, - // tokens.FUSDT, - // holders.USDC, - // '100000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // describe(`multiSwap`, () => { - // describe(`Volatile`, () => { - // it('FTM -> USDC', async () => { - // await testE2E( - // tokens.FTM, - // tokens.USDC, - // holders.FTM, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('FTM -> SPIRIT', async () => { - // await testE2E( - // tokens.FTM, - // tokens.SPIRIT, - // holders.FTM, - // '11000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> FTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.FTM, - // holders.SPIRIT, - // '11000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('SPIRIT -> WFTM', async () => { - // await testE2E( - // tokens.SPIRIT, - // tokens.WFTM, - // holders.SPIRIT, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // describe(`Stable`, () => { - // it('USDC -> USDT', async () => { - // await testE2E( - // tokens.USDC, - // tokens.FUSDT, - // holders.USDC, - // '100000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // - // describe('Equalizer', () => { - // const dexKey = 'Equalizer'; - // const network = Network.FANTOM; - // - // const tokenASymbol: string = 'FUSDT'; - // const tokenBSymbol: string = 'USDC'; - // - // const tokenAAmount: string = '111110'; - // const tokenBAmount: string = '100000'; - // const nativeTokenAmount = '11000000000000000'; - // - // testForNetwork( - // network, - // dexKey, - // tokenASymbol, - // tokenBSymbol, - // tokenAAmount, - // tokenBAmount, - // nativeTokenAmount, - // ); - // }); - // - // describe('Fvm', () => { - // const dexKey = 'Fvm'; - // const network = Network.FANTOM; - // - // const tokenASymbol: string = 'lzUSDC'; - // const tokenBSymbol: string = 'axlUSDC'; - // - // const tokenAAmount: string = '1111100'; - // const tokenBAmount: string = '1000000'; - // const nativeTokenAmount = '11000000000000000'; - // - // testForNetwork( - // network, - // dexKey, - // tokenASymbol, - // tokenBSymbol, - // tokenAAmount, - // tokenBAmount, - // nativeTokenAmount, - // ); - // }); - // }); - - // describe('Mainnet', () => { - // const network = Network.MAINNET; - // const tokens = Tokens[network]; - // const holders = Holders[network]; - // const provider = new StaticJsonRpcProvider( - // generateConfig(network).privateHttpProvider, - // network, - // ); - // - // describe(`SolidlyV2`, () => { - // const dexKey = 'SolidlyV2'; - // - // describe(`simpleSwap`, () => { - // describe(`Volatile`, () => { - // it('ETH -> USDC', async () => { - // await testE2E( - // tokens.ETH, - // tokens.USDC, - // holders.ETH, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // describe(`Stable`, () => { - // it('USDC -> USDT', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // '10000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // - // describe(`multiSwap`, () => { - // describe(`Volatile`, () => { - // it('ETH -> USDC', async () => { - // await testE2E( - // tokens.ETH, - // tokens.USDC, - // holders.ETH, - // '1000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // describe(`Stable`, () => { - // it('USDC -> USDT', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // '10000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // }); - - // describe('Polygon', () => { - // const network = Network.POLYGON; - // const tokens = Tokens[network]; - // const holders = Holders[network]; - // const provider = new StaticJsonRpcProvider( - // generateConfig(network).privateHttpProvider, - // network, - // ); - // - // describe('Dystopia', () => { - // const dexKey = 'Dystopia'; - // const usdAmount = '1000000'; - // - // describe('Dystopia UniswapV2 Pools', () => { - // const maticAmount = '1000000000000000000'; - // - // describe('simpleSwap', () => { - // it('MATIC -> TOKEN', async () => { - // await testE2E( - // tokens.MATIC, - // tokens.WETH, - // holders.MATIC, - // maticAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> MATIC', async () => { - // await testE2E( - // tokens.USDT, - // tokens.MATIC, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> Token', async () => { - // await testE2E( - // tokens.WMATIC, - // tokens.WETH, - // holders.WMATIC, - // maticAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('multiSwap', () => { - // it('MATIC -> TOKEN', async () => { - // await testE2E( - // tokens.MATIC, - // tokens.WETH, - // holders.MATIC, - // maticAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> MATIC', async () => { - // await testE2E( - // tokens.USDT, - // tokens.MATIC, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> Token', async () => { - // await testE2E( - // tokens.WMATIC, - // tokens.WETH, - // holders.WMATIC, - // maticAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('megaSwap', () => { - // it('MATIC -> TOKEN', async () => { - // await testE2E( - // tokens.USDT, - // tokens.MATIC, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> MATIC', async () => { - // await testE2E( - // tokens.USDT, - // tokens.MATIC, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> Token', async () => { - // await testE2E( - // tokens.WMATIC, - // tokens.WETH, - // holders.WMATIC, - // maticAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // - // describe('Dystopia Stable Pools', () => { - // describe('simpleSwap', () => { - // it('Token -> Token', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('multiSwap', () => { - // it('Token -> Token', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('megaSwap', () => { - // it('Token -> Token', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // }); - - // describe('Optimism', () => { - // const network = Network.OPTIMISM; - // const tokens = Tokens[network]; - // const holders = Holders[network]; - // const provider = new StaticJsonRpcProvider( - // generateConfig(network).privateHttpProvider, - // network, - // ); - // - // describe('Velodrome', () => { - // const dexKey = 'Velodrome'; - // - // describe('simpleSwap', () => { - // it('NATIVE -> TOKEN', async () => { - // await testE2E( - // tokens.ETH, - // tokens.USDC, - // holders.ETH, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('TOKEN -> NATIVE', async () => { - // await testE2E( - // tokens.USDC, - // tokens.ETH, - // holders.USDC, - // '9900000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('TOKEN -> TOKEN', async () => { - // await testE2E( - // tokens.WETH, - // tokens.USDC, - // holders.WETH, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // - // network, - // provider, - // ); - // }); - // }); - // describe('multiSwap', () => { - // it('NATIVE -> TOKEN', async () => { - // await testE2E( - // tokens.ETH, - // tokens.USDC, - // holders.ETH, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // - // network, - // provider, - // ); - // }); - // it('TOKEN -> NATIVE', async () => { - // await testE2E( - // tokens.USDC, - // tokens.ETH, - // holders.USDC, - // '9900000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('TOKEN -> TOKEN', async () => { - // await testE2E( - // tokens.WETH, - // tokens.USDC, - // holders.WETH, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // - // describe('VelodromeV2', () => { - // const dexKey = 'VelodromeV2'; - // - // const network = Network.OPTIMISM; - // - // const tokenASymbol: string = 'USDC'; - // const tokenBSymbol: string = 'USDT'; - // - // const tokenAAmount: string = '111110000'; - // const tokenBAmount: string = '1100000000'; - // const nativeTokenAmount = '11000000000000000'; - // - // testForNetwork( - // network, - // dexKey, - // tokenASymbol, - // tokenBSymbol, - // tokenAAmount, - // tokenBAmount, - // nativeTokenAmount, - // ); - // }); - // }); - - // describe('BSC', () => { - // const network = Network.BSC; - // const tokens = Tokens[network]; - // const holders = Holders[network]; - // const provider = new StaticJsonRpcProvider( - // generateConfig(network).privateHttpProvider, - // network, - // ); - // - // describe('Cone', () => { - // const dexKey = 'Cone'; - // const usdAmount = '1000000'; - // - // describe('Cone UniswapV2 Pools', () => { - // const bnbAmount = '1000000000000000000'; - // - // describe('simpleSwap', () => { - // it('BNB -> TOKEN', async () => { - // await testE2E( - // tokens.BNB, - // tokens.BUSD, - // holders.BNB, - // bnbAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> BNB', async () => { - // await testE2E( - // tokens.USDT, - // tokens.BNB, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> Token', async () => { - // await testE2E( - // tokens.WBNB, - // tokens.CONE, - // holders.WBNB, - // bnbAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('multiSwap', () => { - // it('BNB -> TOKEN', async () => { - // await testE2E( - // tokens.BNB, - // tokens.BUSD, - // holders.BNB, - // bnbAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> BNB', async () => { - // await testE2E( - // tokens.USDT, - // tokens.BNB, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> Token', async () => { - // await testE2E( - // tokens.WBNB, - // tokens.CONE, - // holders.WBNB, - // bnbAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('megaSwap', () => { - // it('BNB -> TOKEN', async () => { - // await testE2E( - // tokens.USDT, - // tokens.BNB, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> BNB', async () => { - // await testE2E( - // tokens.USDT, - // tokens.BNB, - // holders.USDT, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // - // it('Token -> Token', async () => { - // await testE2E( - // tokens.WBNB, - // tokens.CONE, - // holders.WBNB, - // bnbAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // - // describe('Cone Stable Pools', () => { - // describe('simpleSwap', () => { - // it('Token -> Token', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('multiSwap', () => { - // it('Token -> Token', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // - // describe('megaSwap', () => { - // it('Token -> Token', async () => { - // await testE2E( - // tokens.USDC, - // tokens.USDT, - // holders.USDC, - // usdAmount, - // SwapSide.SELL, - // dexKey, - // ContractMethod.megaSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // - // describe('Thena', () => { - // const dexKey = 'Thena'; - // - // const sideToContractMethods = new Map([ - // [ - // SwapSide.SELL, - // [ - // ContractMethod.simpleSwap, - // ContractMethod.multiSwap, - // ContractMethod.megaSwap, - // ], - // ], - // ]); - // - // const pairs: { name: string; sellAmount: string }[][] = [ - // [ - // { - // name: 'BNB', - // sellAmount: '1000000000000000000', - // }, - // { - // name: 'USDT', - // sellAmount: '10000000000000000000', - // }, - // ], - // [ - // { - // name: 'USDT', - // sellAmount: '10000000000000000000', - // }, - // { - // name: 'USDC', - // sellAmount: '10000000000000000000', - // }, - // ], - // [ - // { - // name: 'ETH', - // sellAmount: '5000000000000000000', - // }, - // { - // name: 'BNB', - // sellAmount: '1000000000000000000', - // }, - // ], - // ]; - // - // sideToContractMethods.forEach((contractMethods, side) => - // describe(`${side}`, () => { - // contractMethods.forEach((contractMethod: ContractMethod) => { - // pairs.forEach(pair => { - // describe(`${contractMethod}`, () => { - // it(`${pair[0].name} -> ${pair[1].name}`, async () => { - // await testE2E( - // tokens[pair[0].name], - // tokens[pair[1].name], - // holders[pair[0].name], - // pair[0].sellAmount, - // side, - // dexKey, - // contractMethod, - // network, - // provider, - // ); - // }); - // it(`${pair[1].name} -> ${pair[0].name}`, async () => { - // await testE2E( - // tokens[pair[1].name], - // tokens[pair[0].name], - // holders[pair[1].name], - // pair[1].sellAmount, - // side, - // dexKey, - // contractMethod, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // }), - // ); - // }); - // }); - - // describe('Avalanche', () => { - // const network = Network.AVALANCHE; - // const tokens = Tokens[network]; - // const holders = Holders[network]; - // const provider = new StaticJsonRpcProvider( - // generateConfig(network).privateHttpProvider, - // network, - // ); - // - // describe('SoliSnek', () => { - // const dexKey = 'SoliSnek'; - // - // describe('simpleSwap', () => { - // it('NATIVE -> TOKEN', async () => { - // await testE2E( - // tokens.AVAX, - // tokens.USDC, - // holders.AVAX, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('TOKEN -> NATIVE', async () => { - // await testE2E( - // tokens.USDC, - // tokens.AVAX, - // holders.USDC, - // '9900000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // network, - // provider, - // ); - // }); - // it('TOKEN -> TOKEN', async () => { - // await testE2E( - // tokens.WAVAX, - // tokens.USDC, - // holders.WAVAX, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.simpleSwap, - // - // network, - // provider, - // ); - // }); - // }); - // describe('multiSwap', () => { - // it('NATIVE -> TOKEN', async () => { - // await testE2E( - // tokens.AVAX, - // tokens.USDC, - // holders.AVAX, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // - // network, - // provider, - // ); - // }); - // it('TOKEN -> NATIVE', async () => { - // await testE2E( - // tokens.USDC, - // tokens.AVAX, - // holders.USDC, - // '9900000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // it('TOKEN -> TOKEN', async () => { - // await testE2E( - // tokens.WAVAX, - // tokens.USDC, - // holders.WAVAX, - // '3000000000000000000', - // SwapSide.SELL, - // dexKey, - // ContractMethod.multiSwap, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - - // describe('Arbitrum', () => { - // const network = Network.ARBITRUM; - // const tokens = Tokens[network]; - // const holders = Holders[network]; - // const provider = new StaticJsonRpcProvider( - // generateConfig(network).privateHttpProvider, - // network, - // ); - // - // describe(`Chronos`, () => { - // const dexKey = 'Chronos'; - // - // const sideToContractMethods = new Map([ - // [ - // SwapSide.SELL, - // [ - // ContractMethod.simpleSwap, - // ContractMethod.multiSwap, - // ContractMethod.megaSwap, - // ], - // ], - // ]); - // - // const pairs: { name: string; sellAmount: string }[][] = [ - // [ - // { - // name: 'ETH', - // sellAmount: '1000000000000000000', - // }, - // { - // name: 'USDC', - // sellAmount: '100000000', - // }, - // ], - // [ - // { - // name: 'USDT', - // sellAmount: '100000000', - // }, - // { - // name: 'USDC', - // sellAmount: '100000000', - // }, - // ], - // [ - // { - // name: 'USDC', - // sellAmount: '100000000', - // }, - // { - // name: 'DAI', - // sellAmount: '100000000000000000000', - // }, - // ], - // [ - // { - // name: 'ARB', - // sellAmount: '100000000', - // }, - // { - // name: 'ETH', - // sellAmount: '100000000000000000000', - // }, - // ], - // ]; - // - // sideToContractMethods.forEach((contractMethods, side) => - // describe(`${side}`, () => { - // contractMethods.forEach((contractMethod: ContractMethod) => { - // pairs.forEach(pair => { - // describe(`${contractMethod}`, () => { - // it(`${pair[0].name} -> ${pair[1].name}`, async () => { - // await testE2E( - // tokens[pair[0].name], - // tokens[pair[1].name], - // holders[pair[0].name], - // pair[0].sellAmount, - // side, - // dexKey, - // contractMethod, - // network, - // provider, - // ); - // }); - // it(`${pair[1].name} -> ${pair[0].name}`, async () => { - // await testE2E( - // tokens[pair[1].name], - // tokens[pair[0].name], - // holders[pair[1].name], - // pair[1].sellAmount, - // side, - // dexKey, - // contractMethod, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // }), - // ); - // }); - // - // describe('Ramses', () => { - // const dexKey = 'Ramses'; - // - // const sideToContractMethods = new Map([ - // [ - // SwapSide.SELL, - // [ - // ContractMethod.simpleSwap, - // ContractMethod.multiSwap, - // ContractMethod.megaSwap, - // ], - // ], - // ]); - // - // const pairs: { name: string; sellAmount: string }[][] = [ - // [ - // { - // name: 'ETH', - // sellAmount: '10000000000000', - // }, - // { - // name: 'USDCe', - // sellAmount: '100000000', - // }, - // ], - // [ - // { - // name: 'WETH', - // sellAmount: '10000000000000', - // }, - // { - // name: 'USDCe', - // sellAmount: '100000000', - // }, - // ], - // [ - // { - // name: 'USDT', - // sellAmount: '100000000', - // }, - // { - // name: 'USDCe', - // sellAmount: '100000000', - // }, - // ], - // [ - // { - // name: 'USDCe', - // sellAmount: '500000', - // }, - // { - // name: 'DAI', - // sellAmount: '1000000000000000000', - // }, - // ], - // ]; - // - // sideToContractMethods.forEach((contractMethods, side) => - // describe(`${side}`, () => { - // contractMethods.forEach((contractMethod: ContractMethod) => { - // pairs.forEach(pair => { - // describe(`${contractMethod}`, () => { - // it(`${pair[0].name} -> ${pair[1].name}`, async () => { - // await testE2E( - // tokens[pair[0].name], - // tokens[pair[1].name], - // holders[pair[0].name], - // pair[0].sellAmount, - // side, - // dexKey, - // contractMethod, - // network, - // provider, - // ); - // }); - // it(`${pair[1].name} -> ${pair[0].name}`, async () => { - // await testE2E( - // tokens[pair[1].name], - // tokens[pair[0].name], - // holders[pair[1].name], - // pair[1].sellAmount, - // side, - // dexKey, - // contractMethod, - // network, - // provider, - // ); - // }); - // }); - // }); - // }); - // }), - // ); - // }); - // }); + describe('Mainnet', () => { + const network = Network.MAINNET; + const tokens = Tokens[network]; + const holders = Holders[network]; + const provider = new StaticJsonRpcProvider( + generateConfig(network).privateHttpProvider, + network, + ); + + describe(`SolidlyV2`, () => { + const dexKey = 'SolidlyV2'; + + describe(`simpleSwap`, () => { + describe(`Volatile`, () => { + it('ETH -> USDC', async () => { + await testE2E( + tokens.ETH, + tokens.USDC, + holders.ETH, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + describe(`Stable`, () => { + it('USDC -> USDT', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + '10000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + }); + + describe(`multiSwap`, () => { + describe(`Volatile`, () => { + it('ETH -> USDC', async () => { + await testE2E( + tokens.ETH, + tokens.USDC, + holders.ETH, + '1000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + describe(`Stable`, () => { + it('USDC -> USDT', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + '10000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + }); + }); + }); + + describe('Polygon', () => { + const network = Network.POLYGON; + const tokens = Tokens[network]; + const holders = Holders[network]; + const provider = new StaticJsonRpcProvider( + generateConfig(network).privateHttpProvider, + network, + ); + + describe('Dystopia', () => { + const dexKey = 'Dystopia'; + const usdAmount = '1000000'; + + describe('Dystopia UniswapV2 Pools', () => { + const maticAmount = '1000000000000000000'; + + describe('simpleSwap', () => { + it('MATIC -> TOKEN', async () => { + await testE2E( + tokens.MATIC, + tokens.WETH, + holders.MATIC, + maticAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + + it('Token -> MATIC', async () => { + await testE2E( + tokens.USDT, + tokens.MATIC, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + + it('Token -> Token', async () => { + await testE2E( + tokens.WMATIC, + tokens.WETH, + holders.WMATIC, + maticAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + + describe('multiSwap', () => { + it('MATIC -> TOKEN', async () => { + await testE2E( + tokens.MATIC, + tokens.WETH, + holders.MATIC, + maticAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + + it('Token -> MATIC', async () => { + await testE2E( + tokens.USDT, + tokens.MATIC, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + + it('Token -> Token', async () => { + await testE2E( + tokens.WMATIC, + tokens.WETH, + holders.WMATIC, + maticAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + + describe('megaSwap', () => { + it('MATIC -> TOKEN', async () => { + await testE2E( + tokens.USDT, + tokens.MATIC, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + + it('Token -> MATIC', async () => { + await testE2E( + tokens.USDT, + tokens.MATIC, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + + it('Token -> Token', async () => { + await testE2E( + tokens.WMATIC, + tokens.WETH, + holders.WMATIC, + maticAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + }); + }); + + describe('Dystopia Stable Pools', () => { + describe('simpleSwap', () => { + it('Token -> Token', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + + describe('multiSwap', () => { + it('Token -> Token', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + + describe('megaSwap', () => { + it('Token -> Token', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + }); + }); + }); + }); + + describe('Optimism', () => { + const network = Network.OPTIMISM; + const tokens = Tokens[network]; + const holders = Holders[network]; + const provider = new StaticJsonRpcProvider( + generateConfig(network).privateHttpProvider, + network, + ); + + describe('Velodrome', () => { + const dexKey = 'Velodrome'; + + describe('simpleSwap', () => { + it('NATIVE -> TOKEN', async () => { + await testE2E( + tokens.ETH, + tokens.USDC, + holders.ETH, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('TOKEN -> NATIVE', async () => { + await testE2E( + tokens.USDC, + tokens.ETH, + holders.USDC, + '9900000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('TOKEN -> TOKEN', async () => { + await testE2E( + tokens.WETH, + tokens.USDC, + holders.WETH, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + + network, + provider, + ); + }); + }); + describe('multiSwap', () => { + it('NATIVE -> TOKEN', async () => { + await testE2E( + tokens.ETH, + tokens.USDC, + holders.ETH, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + + network, + provider, + ); + }); + it('TOKEN -> NATIVE', async () => { + await testE2E( + tokens.USDC, + tokens.ETH, + holders.USDC, + '9900000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('TOKEN -> TOKEN', async () => { + await testE2E( + tokens.WETH, + tokens.USDC, + holders.WETH, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + }); + + describe('VelodromeV2', () => { + const dexKey = 'VelodromeV2'; + + const network = Network.OPTIMISM; + + const tokenASymbol: string = 'USDC'; + const tokenBSymbol: string = 'USDT'; + + const tokenAAmount: string = '111110000'; + const tokenBAmount: string = '1100000000'; + const nativeTokenAmount = '11000000000000000'; + + testForNetwork( + network, + dexKey, + tokenASymbol, + tokenBSymbol, + tokenAAmount, + tokenBAmount, + nativeTokenAmount, + ); + }); + }); + + describe('BSC', () => { + const network = Network.BSC; + const tokens = Tokens[network]; + const holders = Holders[network]; + const provider = new StaticJsonRpcProvider( + generateConfig(network).privateHttpProvider, + network, + ); + + describe('Cone', () => { + const dexKey = 'Cone'; + const usdAmount = '1000000'; + + describe('Cone UniswapV2 Pools', () => { + const bnbAmount = '1000000000000000000'; + + describe('simpleSwap', () => { + it('BNB -> TOKEN', async () => { + await testE2E( + tokens.BNB, + tokens.BUSD, + holders.BNB, + bnbAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + + it('Token -> BNB', async () => { + await testE2E( + tokens.USDT, + tokens.BNB, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + + it('Token -> Token', async () => { + await testE2E( + tokens.WBNB, + tokens.CONE, + holders.WBNB, + bnbAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + + describe('multiSwap', () => { + it('BNB -> TOKEN', async () => { + await testE2E( + tokens.BNB, + tokens.BUSD, + holders.BNB, + bnbAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + + it('Token -> BNB', async () => { + await testE2E( + tokens.USDT, + tokens.BNB, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + + it('Token -> Token', async () => { + await testE2E( + tokens.WBNB, + tokens.CONE, + holders.WBNB, + bnbAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + + describe('megaSwap', () => { + it('BNB -> TOKEN', async () => { + await testE2E( + tokens.USDT, + tokens.BNB, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + + it('Token -> BNB', async () => { + await testE2E( + tokens.USDT, + tokens.BNB, + holders.USDT, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + + it('Token -> Token', async () => { + await testE2E( + tokens.WBNB, + tokens.CONE, + holders.WBNB, + bnbAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + }); + }); + + describe('Cone Stable Pools', () => { + describe('simpleSwap', () => { + it('Token -> Token', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + }); + + describe('multiSwap', () => { + it('Token -> Token', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + + describe('megaSwap', () => { + it('Token -> Token', async () => { + await testE2E( + tokens.USDC, + tokens.USDT, + holders.USDC, + usdAmount, + SwapSide.SELL, + dexKey, + ContractMethod.megaSwap, + network, + provider, + ); + }); + }); + }); + }); + + describe('Thena', () => { + const dexKey = 'Thena'; + + const sideToContractMethods = new Map([ + [ + SwapSide.SELL, + [ + ContractMethod.simpleSwap, + ContractMethod.multiSwap, + ContractMethod.megaSwap, + ], + ], + ]); + + const pairs: { name: string; sellAmount: string }[][] = [ + [ + { + name: 'BNB', + sellAmount: '1000000000000000000', + }, + { + name: 'USDT', + sellAmount: '10000000000000000000', + }, + ], + [ + { + name: 'USDT', + sellAmount: '10000000000000000000', + }, + { + name: 'USDC', + sellAmount: '10000000000000000000', + }, + ], + [ + { + name: 'ETH', + sellAmount: '5000000000000000000', + }, + { + name: 'BNB', + sellAmount: '1000000000000000000', + }, + ], + ]; + + sideToContractMethods.forEach((contractMethods, side) => + describe(`${side}`, () => { + contractMethods.forEach((contractMethod: ContractMethod) => { + pairs.forEach(pair => { + describe(`${contractMethod}`, () => { + it(`${pair[0].name} -> ${pair[1].name}`, async () => { + await testE2E( + tokens[pair[0].name], + tokens[pair[1].name], + holders[pair[0].name], + pair[0].sellAmount, + side, + dexKey, + contractMethod, + network, + provider, + ); + }); + it(`${pair[1].name} -> ${pair[0].name}`, async () => { + await testE2E( + tokens[pair[1].name], + tokens[pair[0].name], + holders[pair[1].name], + pair[1].sellAmount, + side, + dexKey, + contractMethod, + network, + provider, + ); + }); + }); + }); + }); + }), + ); + }); + }); + + describe('Avalanche', () => { + const network = Network.AVALANCHE; + const tokens = Tokens[network]; + const holders = Holders[network]; + const provider = new StaticJsonRpcProvider( + generateConfig(network).privateHttpProvider, + network, + ); + + describe('SoliSnek', () => { + const dexKey = 'SoliSnek'; + + describe('simpleSwap', () => { + it('NATIVE -> TOKEN', async () => { + await testE2E( + tokens.AVAX, + tokens.USDC, + holders.AVAX, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('TOKEN -> NATIVE', async () => { + await testE2E( + tokens.USDC, + tokens.AVAX, + holders.USDC, + '9900000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + network, + provider, + ); + }); + it('TOKEN -> TOKEN', async () => { + await testE2E( + tokens.WAVAX, + tokens.USDC, + holders.WAVAX, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.simpleSwap, + + network, + provider, + ); + }); + }); + describe('multiSwap', () => { + it('NATIVE -> TOKEN', async () => { + await testE2E( + tokens.AVAX, + tokens.USDC, + holders.AVAX, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + + network, + provider, + ); + }); + it('TOKEN -> NATIVE', async () => { + await testE2E( + tokens.USDC, + tokens.AVAX, + holders.USDC, + '9900000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + it('TOKEN -> TOKEN', async () => { + await testE2E( + tokens.WAVAX, + tokens.USDC, + holders.WAVAX, + '3000000000000000000', + SwapSide.SELL, + dexKey, + ContractMethod.multiSwap, + network, + provider, + ); + }); + }); + }); + }); + + describe('Arbitrum', () => { + const network = Network.ARBITRUM; + const tokens = Tokens[network]; + const holders = Holders[network]; + const provider = new StaticJsonRpcProvider( + generateConfig(network).privateHttpProvider, + network, + ); + + describe(`Chronos`, () => { + const dexKey = 'Chronos'; + + const sideToContractMethods = new Map([ + [ + SwapSide.SELL, + [ + ContractMethod.simpleSwap, + ContractMethod.multiSwap, + ContractMethod.megaSwap, + ], + ], + ]); + + const pairs: { name: string; sellAmount: string }[][] = [ + [ + { + name: 'ETH', + sellAmount: '1000000000000000000', + }, + { + name: 'USDC', + sellAmount: '100000000', + }, + ], + [ + { + name: 'USDT', + sellAmount: '100000000', + }, + { + name: 'USDC', + sellAmount: '100000000', + }, + ], + [ + { + name: 'USDC', + sellAmount: '100000000', + }, + { + name: 'DAI', + sellAmount: '100000000000000000000', + }, + ], + [ + { + name: 'ARB', + sellAmount: '100000000', + }, + { + name: 'ETH', + sellAmount: '100000000000000000000', + }, + ], + ]; + + sideToContractMethods.forEach((contractMethods, side) => + describe(`${side}`, () => { + contractMethods.forEach((contractMethod: ContractMethod) => { + pairs.forEach(pair => { + describe(`${contractMethod}`, () => { + it(`${pair[0].name} -> ${pair[1].name}`, async () => { + await testE2E( + tokens[pair[0].name], + tokens[pair[1].name], + holders[pair[0].name], + pair[0].sellAmount, + side, + dexKey, + contractMethod, + network, + provider, + ); + }); + it(`${pair[1].name} -> ${pair[0].name}`, async () => { + await testE2E( + tokens[pair[1].name], + tokens[pair[0].name], + holders[pair[1].name], + pair[1].sellAmount, + side, + dexKey, + contractMethod, + network, + provider, + ); + }); + }); + }); + }); + }), + ); + }); + + describe('Ramses', () => { + const dexKey = 'Ramses'; + + const sideToContractMethods = new Map([ + [ + SwapSide.SELL, + [ + ContractMethod.simpleSwap, + ContractMethod.multiSwap, + ContractMethod.megaSwap, + ], + ], + ]); + + const pairs: { name: string; sellAmount: string }[][] = [ + [ + { + name: 'ETH', + sellAmount: '10000000000000', + }, + { + name: 'USDCe', + sellAmount: '100000000', + }, + ], + [ + { + name: 'WETH', + sellAmount: '10000000000000', + }, + { + name: 'USDCe', + sellAmount: '100000000', + }, + ], + [ + { + name: 'USDT', + sellAmount: '100000000', + }, + { + name: 'USDCe', + sellAmount: '100000000', + }, + ], + [ + { + name: 'USDCe', + sellAmount: '500000', + }, + { + name: 'DAI', + sellAmount: '1000000000000000000', + }, + ], + ]; + + sideToContractMethods.forEach((contractMethods, side) => + describe(`${side}`, () => { + contractMethods.forEach((contractMethod: ContractMethod) => { + pairs.forEach(pair => { + describe(`${contractMethod}`, () => { + it(`${pair[0].name} -> ${pair[1].name}`, async () => { + await testE2E( + tokens[pair[0].name], + tokens[pair[1].name], + holders[pair[0].name], + pair[0].sellAmount, + side, + dexKey, + contractMethod, + network, + provider, + ); + }); + it(`${pair[1].name} -> ${pair[0].name}`, async () => { + await testE2E( + tokens[pair[1].name], + tokens[pair[0].name], + holders[pair[1].name], + pair[1].sellAmount, + side, + dexKey, + contractMethod, + network, + provider, + ); + }); + }); + }); + }); + }), + ); + }); + }); describe('Base', () => { const network = Network.BASE; From bb67cb505a0a4d084b25242413f2e8e13ff4bc8a Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 18:56:49 +0300 Subject: [PATCH 41/73] update --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0b4a2202..bfb818d16 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,4 +46,6 @@ jobs: echo "Running the following changed specs" echo $CHANGED_SPECS npx jest --ci --forceExit --verbose $CHANGED_SPECS + else + echo "There are no changed tests...skipping" fi From a96f006244d256a01859967e2889d5502a912a60 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 19:02:07 +0300 Subject: [PATCH 42/73] update --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bfb818d16..beb61b0e1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,6 +42,7 @@ jobs: HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | CHANGED_SPECS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts) + echo $CHANGED_SPECS if [ -n "$CHANGED_SPECS" ]; then echo "Running the following changed specs" echo $CHANGED_SPECS From 5dbdbf2ff5db25ee8e518ebafa4588c53147771d Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 19:11:43 +0300 Subject: [PATCH 43/73] update --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index beb61b0e1..22fa77c18 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,7 +46,7 @@ jobs: if [ -n "$CHANGED_SPECS" ]; then echo "Running the following changed specs" echo $CHANGED_SPECS - npx jest --ci --forceExit --verbose $CHANGED_SPECS +# npx jest --ci --forceExit --verbose $CHANGED_SPECS else echo "There are no changed tests...skipping" fi From 417fd9cb0ccb1514c2e9534c4633283da3bf7736 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Tue, 24 Oct 2023 19:12:35 +0300 Subject: [PATCH 44/73] update --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 22fa77c18..8f2c50951 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,7 +46,6 @@ jobs: if [ -n "$CHANGED_SPECS" ]; then echo "Running the following changed specs" echo $CHANGED_SPECS -# npx jest --ci --forceExit --verbose $CHANGED_SPECS else echo "There are no changed tests...skipping" fi From d410c6bf55792b09a54c99783b77cc318016647b Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Wed, 25 Oct 2023 12:44:17 +0300 Subject: [PATCH 45/73] debug --- .github/workflows/ci.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8f2c50951..796b006d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,9 +43,3 @@ jobs: run: | CHANGED_SPECS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts) echo $CHANGED_SPECS - if [ -n "$CHANGED_SPECS" ]; then - echo "Running the following changed specs" - echo $CHANGED_SPECS - else - echo "There are no changed tests...skipping" - fi From 5676341b96d2d9ede2f41544b4d10d5b78584582 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Wed, 25 Oct 2023 12:47:00 +0300 Subject: [PATCH 46/73] debug --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 796b006d2..d4ed713f9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,5 +41,5 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_SPECS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts) - echo $CHANGED_SPECS + CHANGED_TESTS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts) + echo "$CHANGED_SPECS" From 810ec64aee7425b2d48f489e270057987d97b83a Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Wed, 25 Oct 2023 12:48:54 +0300 Subject: [PATCH 47/73] debug --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d4ed713f9..2b832b735 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,4 +42,3 @@ jobs: HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | CHANGED_TESTS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts) - echo "$CHANGED_SPECS" From c4e5c6284ba4aceb1147456b2b7ce108fa8d76ad Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Wed, 25 Oct 2023 12:52:05 +0300 Subject: [PATCH 48/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2b832b735..00a128e2d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,4 +41,4 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts) + git diff --name-only origin/master ${{ github.ref }} | grep test.ts From 387ac6f5439905fadd6f26131df903fe750c1b06 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Wed, 25 Oct 2023 13:07:45 +0300 Subject: [PATCH 49/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 00a128e2d..338b676b1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,4 +41,4 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - git diff --name-only origin/master ${{ github.ref }} | grep test.ts + git diff --exit-code --name-only origin/master ${{ github.ref }} | grep test.ts From cf4d3c57260aaf48c28f3923e430722e17b55c9c Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Wed, 25 Oct 2023 13:22:44 +0300 Subject: [PATCH 50/73] debug --- .github/workflows/ci.yaml | 9 ++++++++- src/dex/solidly/solidly-e2e.test.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 338b676b1..03cd4f1ce 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,4 +41,11 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - git diff --exit-code --name-only origin/master ${{ github.ref }} | grep test.ts + CHANGED_TESTS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts || true) + echo "$CHANGED_TESTS" + if [ -n "$CHANGED_TESTS" ]; then + echo "Running the following changed specs" + npx jest --ci --forceExit --verbose $CHANGED_TESTS + else + echo "There are no changed tests...skipping" + fi diff --git a/src/dex/solidly/solidly-e2e.test.ts b/src/dex/solidly/solidly-e2e.test.ts index d6abdc5b5..f3e5ab9e5 100644 --- a/src/dex/solidly/solidly-e2e.test.ts +++ b/src/dex/solidly/solidly-e2e.test.ts @@ -92,7 +92,7 @@ function testForNetwork( } describe('Solidly E2E', () => { - describe('Fantom', () => { + describe('Fantom ', () => { const network = Network.FANTOM; const tokens = Tokens[network]; const holders = Holders[network]; From 3ab4dc0a614158b3a47d197635026c6b5197e656 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Wed, 25 Oct 2023 13:26:03 +0300 Subject: [PATCH 51/73] debug --- src/dex/solidly/solidly-e2e.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dex/solidly/solidly-e2e.test.ts b/src/dex/solidly/solidly-e2e.test.ts index f3e5ab9e5..d6abdc5b5 100644 --- a/src/dex/solidly/solidly-e2e.test.ts +++ b/src/dex/solidly/solidly-e2e.test.ts @@ -92,7 +92,7 @@ function testForNetwork( } describe('Solidly E2E', () => { - describe('Fantom ', () => { + describe('Fantom', () => { const network = Network.FANTOM; const tokens = Tokens[network]; const holders = Holders[network]; From 6ddbd82384ac447437436d7dbfa61ffcf1fc455c Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 13:00:39 +0300 Subject: [PATCH 52/73] debug --- .github/workflows/ci.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 03cd4f1ce..1fd76f193 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,11 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Checkout uses: actions/checkout@v3 with: @@ -26,7 +31,7 @@ jobs: run: yarn check:es - name: Run Changed tests only - timeout-minutes: 15 + timeout-minutes: 60 env: TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} From a11f90ae1e66c2d1e7ba1bec8ebbedcd184b14e6 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 13:15:32 +0300 Subject: [PATCH 53/73] debug --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1fd76f193..f266672e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,7 +31,8 @@ jobs: run: yarn check:es - name: Run Changed tests only - timeout-minutes: 60 + if: ${{ github.base_ref != 'refs/heads/master }} + timeout-minutes: 15 env: TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} From 248b245b8d14d6b68f873d49e6b562116d35431f Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 15:28:58 +0300 Subject: [PATCH 54/73] debug --- .github/workflows/ci.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f266672e6..6934af31c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,10 +5,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" +# - name: Dump GitHub context +# env: +# GITHUB_CONTEXT: ${{ toJson(github) }} +# run: echo "$GITHUB_CONTEXT" + + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v7 + run: | + echo "Running on default: ${{ steps.branch-name.outputs.current_branch }}" + echo "Base branch: ${{ steps.branch-name.outputs.base_ref_branch }}" - name: Checkout uses: actions/checkout@v3 @@ -47,7 +54,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only origin/master ${{ github.ref }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only ${{ steps.branch-name.outputs.base_ref_branch }} ${{ github.ref }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From c21f66b3edc72743efdeaa3ad4c18048d620dbd9 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 15:32:40 +0300 Subject: [PATCH 55/73] debug --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6934af31c..d878e606e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,6 +13,8 @@ jobs: - name: Get branch name id: branch-name uses: tj-actions/branch-names@v7 + + - name: Dump vars run: | echo "Running on default: ${{ steps.branch-name.outputs.current_branch }}" echo "Base branch: ${{ steps.branch-name.outputs.base_ref_branch }}" From 097aee1e553e0bdbe41dc289925598a2310a218e Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 15:37:21 +0300 Subject: [PATCH 56/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d878e606e..568a81fbe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,7 +40,7 @@ jobs: run: yarn check:es - name: Run Changed tests only - if: ${{ github.base_ref != 'refs/heads/master }} + if: github.base_ref != 'refs/heads/master timeout-minutes: 15 env: TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} From 00f3cebd9942a21627a9c2498574a2354534b0d0 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 15:38:21 +0300 Subject: [PATCH 57/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 568a81fbe..ebb509d89 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,7 +40,7 @@ jobs: run: yarn check:es - name: Run Changed tests only - if: github.base_ref != 'refs/heads/master + if: ${{ github.base_ref != 'refs/heads/master' }} timeout-minutes: 15 env: TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} From 4ef797f0984dc29cd8d8818e6762a21648db9662 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 15:40:43 +0300 Subject: [PATCH 58/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ebb509d89..3e80e408e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: - name: Dump vars run: | echo "Running on default: ${{ steps.branch-name.outputs.current_branch }}" - echo "Base branch: ${{ steps.branch-name.outputs.base_ref_branch }}" + echo "Base branch: ${{ toJson(steps.branch-name.outputs) }}" - name: Checkout uses: actions/checkout@v3 From da989ce96d726a4c244b947927079bb184348879 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 15:55:54 +0300 Subject: [PATCH 59/73] debug --- .github/workflows/ci-tests.yaml | 48 +++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 50 ++------------------------------- 2 files changed, 50 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/ci-tests.yaml diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml new file mode 100644 index 000000000..5b6699ac6 --- /dev/null +++ b/.github/workflows/ci-tests.yaml @@ -0,0 +1,48 @@ +name: Run changed or added tests within PR +on: pull_request + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Dependencies + run: yarn + + - name: Run Changed tests only + timeout-minutes: 15 + env: + TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} + TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} + TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} + HTTP_PROVIDER_1: ${{ secrets.HTTP_PROVIDER_1 }} + HTTP_PROVIDER_10: ${{ secrets.HTTP_PROVIDER_10 }} + HTTP_PROVIDER_56: ${{ secrets.HTTP_PROVIDER_56 }} + HTTP_PROVIDER_137: ${{ secrets.HTTP_PROVIDER_137 }} + HTTP_PROVIDER_250: ${{ secrets.HTTP_PROVIDER_250 }} + HTTP_PROVIDER_1101: ${{ secrets.HTTP_PROVIDER_1101 }} + HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }} + HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} + HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} + run: | + CHANGED_TESTS=$(git diff --name-only ${{ github.base_ref }} ${{ github.ref }} | grep test.ts || true) + echo "$CHANGED_TESTS" + if [ -n "$CHANGED_TESTS" ]; then + echo "Running the following changed specs" + npx jest --ci --forceExit --verbose $CHANGED_TESTS + else + echo "There are no changed tests...skipping" + fi diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3e80e408e..e0eddf617 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,29 +4,9 @@ on: push jobs: build: runs-on: ubuntu-latest + name: Node ${{ matrix.node }} sample steps: -# - name: Dump GitHub context -# env: -# GITHUB_CONTEXT: ${{ toJson(github) }} -# run: echo "$GITHUB_CONTEXT" - - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v7 - - - name: Dump vars - run: | - echo "Running on default: ${{ steps.branch-name.outputs.current_branch }}" - echo "Base branch: ${{ toJson(steps.branch-name.outputs) }}" - - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 + - uses: actions/checkout@v2 - name: Setup Node.js uses: actions/setup-node@v3 @@ -38,29 +18,3 @@ jobs: - name: Run Eslint checks run: yarn check:es - - - name: Run Changed tests only - if: ${{ github.base_ref != 'refs/heads/master' }} - timeout-minutes: 15 - env: - TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} - TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} - TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} - HTTP_PROVIDER_1: ${{ secrets.HTTP_PROVIDER_1 }} - HTTP_PROVIDER_10: ${{ secrets.HTTP_PROVIDER_10 }} - HTTP_PROVIDER_56: ${{ secrets.HTTP_PROVIDER_56 }} - HTTP_PROVIDER_137: ${{ secrets.HTTP_PROVIDER_137 }} - HTTP_PROVIDER_250: ${{ secrets.HTTP_PROVIDER_250 }} - HTTP_PROVIDER_1101: ${{ secrets.HTTP_PROVIDER_1101 }} - HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }} - HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} - HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} - run: | - CHANGED_TESTS=$(git diff --name-only ${{ steps.branch-name.outputs.base_ref_branch }} ${{ github.ref }} | grep test.ts || true) - echo "$CHANGED_TESTS" - if [ -n "$CHANGED_TESTS" ]; then - echo "Running the following changed specs" - npx jest --ci --forceExit --verbose $CHANGED_TESTS - else - echo "There are no changed tests...skipping" - fi From 40c8b01ecdfa8edb302ef8743f51714c8eaf33d6 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 18:43:18 +0300 Subject: [PATCH 60/73] debug --- .github/workflows/ci-tests.yaml | 48 --------------------------------- .github/workflows/ci.yaml | 39 +++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/ci-tests.yaml diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml deleted file mode 100644 index 5b6699ac6..000000000 --- a/.github/workflows/ci-tests.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Run changed or added tests within PR -on: pull_request - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install Dependencies - run: yarn - - - name: Run Changed tests only - timeout-minutes: 15 - env: - TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} - TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} - TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} - HTTP_PROVIDER_1: ${{ secrets.HTTP_PROVIDER_1 }} - HTTP_PROVIDER_10: ${{ secrets.HTTP_PROVIDER_10 }} - HTTP_PROVIDER_56: ${{ secrets.HTTP_PROVIDER_56 }} - HTTP_PROVIDER_137: ${{ secrets.HTTP_PROVIDER_137 }} - HTTP_PROVIDER_250: ${{ secrets.HTTP_PROVIDER_250 }} - HTTP_PROVIDER_1101: ${{ secrets.HTTP_PROVIDER_1101 }} - HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }} - HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} - HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} - run: | - CHANGED_TESTS=$(git diff --name-only ${{ github.base_ref }} ${{ github.ref }} | grep test.ts || true) - echo "$CHANGED_TESTS" - if [ -n "$CHANGED_TESTS" ]; then - echo "Running the following changed specs" - npx jest --ci --forceExit --verbose $CHANGED_TESTS - else - echo "There are no changed tests...skipping" - fi diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e0eddf617..ad1c1aa0e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,12 +1,18 @@ name: CI -on: push +on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - name: Node ${{ matrix.node }} sample steps: - - uses: actions/checkout@v2 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v3 @@ -16,5 +22,28 @@ jobs: - name: Install Dependencies run: yarn - - name: Run Eslint checks - run: yarn check:es + - name: Run Changed tests only + if: github.event_name == 'pull_request' + timeout-minutes: 15 + env: + TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }} + TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} + TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} + HTTP_PROVIDER_1: ${{ secrets.HTTP_PROVIDER_1 }} + HTTP_PROVIDER_10: ${{ secrets.HTTP_PROVIDER_10 }} + HTTP_PROVIDER_56: ${{ secrets.HTTP_PROVIDER_56 }} + HTTP_PROVIDER_137: ${{ secrets.HTTP_PROVIDER_137 }} + HTTP_PROVIDER_250: ${{ secrets.HTTP_PROVIDER_250 }} + HTTP_PROVIDER_1101: ${{ secrets.HTTP_PROVIDER_1101 }} + HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }} + HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} + HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} + run: | + CHANGED_TESTS=$(git diff --name-only ${{ github.base_ref }} ${{ github.ref }} | grep test.ts || true) + echo "$CHANGED_TESTS" + if [ -n "$CHANGED_TESTS" ]; then + echo "Running the following changed specs" + npx jest --ci --forceExit --verbose $CHANGED_TESTS + else + echo "There are no changed tests...skipping" + fi From ebd7c4214b200400415911c9da5d9cba38874af0 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 18:54:20 +0300 Subject: [PATCH 61/73] debug --- .github/workflows/ci.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ad1c1aa0e..38bd11076 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,11 +5,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -22,6 +17,10 @@ jobs: - name: Install Dependencies run: yarn + - name: Run Eslint checks + if: github.event_name == 'push' + run: yarn check:es + - name: Run Changed tests only if: github.event_name == 'pull_request' timeout-minutes: 15 @@ -39,7 +38,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only ${{ github.base_ref }} ${{ github.ref }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.ref }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From 5c61f1c00c8be6fc9e191faece2b0781915fe212 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 18:58:37 +0300 Subject: [PATCH 62/73] debug --- .github/workflows/ci.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 38bd11076..9728e191f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,11 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v4 with: fetch-depth: 0 From f5313bf4c91bd7d0905dd4dd734c7c8f44a77169 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 19:02:42 +0300 Subject: [PATCH 63/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9728e191f..9f79fd8ec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.ref }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From 6f4c687994e265f0f9ecc8ac1ceaa9791d465481 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 19:12:00 +0300 Subject: [PATCH 64/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9f79fd8ec..3a6bedefc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From 7dc1be73b9c4dcb68dbc1f9539b3dbed9479c141 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 19:15:50 +0300 Subject: [PATCH 65/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a6bedefc..47a8877d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From 222590b09062803a204cf86b6771b12fc6e8246d Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 19:23:22 +0300 Subject: [PATCH 66/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 47a8877d5..e20748352 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.ref }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From 3ce84950a645bab4da3c6fedb66dfa6a4e5b1630 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 19:34:55 +0300 Subject: [PATCH 67/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e20748352..47a8877d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.ref }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From 221e8ccf9c4ea1028bb102eed162884e14086733 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 19:44:00 +0300 Subject: [PATCH 68/73] debug --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 47a8877d5..ee73e3b33 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,7 @@ jobs: HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }} HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }} run: | - CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} | grep test.ts || true) + CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep test.ts || true) echo "$CHANGED_TESTS" if [ -n "$CHANGED_TESTS" ]; then echo "Running the following changed specs" From c40d03964a44ea091d499b64c42a90d986af7647 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Fri, 27 Oct 2023 19:56:13 +0300 Subject: [PATCH 69/73] debug --- .github/workflows/ci.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee73e3b33..065b2e04e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,11 +5,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v4 with: fetch-depth: 0 From bd5979d2173c84b262d559d8e5c3f80a90f471e6 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Mon, 30 Oct 2023 15:44:13 +0300 Subject: [PATCH 70/73] debug --- src/dex/balancer-v2/new.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/dex/balancer-v2/new.test.ts diff --git a/src/dex/balancer-v2/new.test.ts b/src/dex/balancer-v2/new.test.ts new file mode 100644 index 000000000..a10047991 --- /dev/null +++ b/src/dex/balancer-v2/new.test.ts @@ -0,0 +1,10 @@ +import dotenv from 'dotenv'; +dotenv.config(); + + +describe('Test', () => { + it('should pass', () => { + console.log(process.env.TENDERLY_PROJECT); + expect(true).toBe(true); + }) +}); From 84334ebe91767c823618a1d46ed05026de14aafa Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Mon, 30 Oct 2023 15:49:12 +0300 Subject: [PATCH 71/73] debug --- .github/workflows/ci.yaml | 3 +++ test.txt | 1 + 2 files changed, 4 insertions(+) create mode 100644 test.txt diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 065b2e04e..48002f982 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,3 +46,6 @@ jobs: else echo "There are no changed tests...skipping" fi + + printf '%s\n' "$TENDERLY_PROJECT" > test.txt + cat test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +0 From 4fc44f24e393c3abf0ffc217b8ce0a54e61bd6b4 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 2 Nov 2023 17:01:54 +0300 Subject: [PATCH 72/73] debug --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48002f982..915ca7c13 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,12 +5,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 with: node-version: 16 From 8454d9e1f7c45e13ffd5e367c82a813d4f5416e4 Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Thu, 2 Nov 2023 17:03:06 +0300 Subject: [PATCH 73/73] debug --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 915ca7c13..4b57fbec4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,7 +5,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Git checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: fetch-depth: 0