Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add sepolia values to uniswap tests #358

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

flanagansteve
Copy link

Before submitting this PR, please make sure:

  • [✅] Your code builds clean without any errors or warnings
  • [✅] You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:

We add correct chain names and contract addresses to the Uniswap tests, completing this PR's work and claiming eligibility for the Sepolia support bounty. This allows us to un-comment-out the Uniswap tests here: https://github.com/hummingbot/gateway/pull/329/files#diff-18939210c9e04cc371c028ec55e42ead2211dbd454ae377183f4b2cf2baedaa0

Tests performed by the developer:

The uniswap tests now pass:

(base) gateway:$ yarn test test/connectors/uniswap/uniswap.test.ts 
yarn run v1.22.19
$ jest --verbose test/connectors/uniswap/uniswap.test.ts
(node:9068) V8: /Users/steveflanagan/gateway/node_modules/brotli/build/encode.js:34 Linking failure in asm.js: Unexpected stdlib member
(Use `node --trace-warnings ...` to show where the warning was created)
2024-09-11 05:48:43 | info | 	Fetching trade data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
2024-09-11 05:48:43 | info | 	Best trade for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357: 2.000000WETH.
2024-09-11 05:48:43 | info | 	Fetching trade data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
2024-09-11 05:48:43 | info | 	Fetching trade data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
2024-09-11 05:48:43 | info | 	Best trade for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357: 1.000000WETH.
2024-09-11 05:48:43 | info | 	Fetching trade data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
2024-09-11 05:48:43 | info | 	Fetching pair data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
2024-09-11 05:48:43 | info | 	Best trade for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357: 0.500000 DAI.
2024-09-11 05:48:43 | info | 	Fetching pair data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
2024-09-11 05:48:43 | info | 	Fetching pair data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
2024-09-11 05:48:43 | info | 	Best trade for 0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357-0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14: 1.000000DAI.
2024-09-11 05:48:43 | info | 	Fetching pair data for 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14-0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357.
 PASS  test/connectors/uniswap/uniswap.test.ts (22.265 s)
  verify Uniswap estimateSellTrade
    when using router
      ✓ Should return an ExpectedTrade when available (22 ms)
      ✓ Should throw an error if no pair is available (19 ms)
    when using qouter
      ✓ Should return an ExpectedTrade when available (39 ms)
      ✓ Should throw an error if no pair is available (9 ms)
  verify Uniswap estimateBuyTrade
    when using router
      ✓ Should return an ExpectedTrade when available (4 ms)
      ✓ Should return an error if no pair is available (2 ms)
    when using qouter
      ✓ Should return an ExpectedTrade when available (22 ms)
      ✓ Should throw an error if no pair is available (9 ms)
  getAllowedSlippage
    ✓ return value of string when not null (2 ms)
    ✓ return value from config when string is null (1 ms)
    ✓ return value from config when string is malformed (1 ms)

Test Suites: 1 passed, 1 total
Tests:       11 passed, 11 total
Snapshots:   0 total
Time:        22.333 s
Ran all test suites matching /test\/connectors\/uniswap\/uniswap.test.ts/i.
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
✨  Done in 36.74s.

cc @ndeporzio (we are collaborators on this project at Panoptic)

@flanagansteve
Copy link
Author

flanagansteve commented Sep 10, 2024

The two merge conflicts are just about the hummingbot-gateway version. I rebased within 5 min of committing, and there haven't been any commits since, so I assume we can just drop the 2.0.1 and bump to dev-2.0.2

<<<<<<< feat/sepolia-tests
  "version": "dev-2.0.2",
=======
  "version": "2.0.1",
>>>>>>> main

@ndeporzio
Copy link

Confirming collaboration with @flanagansteve on this at Panoptic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants