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

[4.4] refactor(tokens): remove Uniswap currency entities usage #3199

Merged
merged 5 commits into from
Oct 26, 2023

Conversation

shoom3301
Copy link
Collaborator

@shoom3301 shoom3301 commented Oct 10, 2023

Summary

This is a continuation of migration from Uniswap entities.

To Test

Please, test everything in #3201

@vercel
Copy link

vercel bot commented Oct 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
swap-dev 🔄 Building (Inspect) Visit Preview Oct 26, 2023 0:37am

🌃 Cosmos ↗︎

@shoom3301 shoom3301 changed the title Refactor/tokens lib wiring 4 [4.4] refactor(tokens): remove Uniswap currency entities usage Oct 10, 2023
@shoom3301 shoom3301 self-assigned this Oct 10, 2023
@shoom3301 shoom3301 requested a review from a team October 11, 2023 12:28
@shoom3301 shoom3301 marked this pull request as ready for review October 11, 2023 12:29
export function useSafeDeps(deps: unknown[]): unknown[] {
return deps.map((dep) => {
if (dep instanceof NativeCurrency) return dep.symbol
if (dep instanceof Token) return dep.address.toLowerCase()
if (dep instanceof CurrencyAmount) return dep.toExact() + dep.currency.symbol + dep.currency.isNative
if (dep instanceof WrappedTokenInfo) return dep.address
if (dep instanceof CurrencyAmount) return dep.toExact() + dep.currency.symbol + dep.currency.chainId
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, shouldn't we use the address.toLowerCase() here instead of symbol, since symbol is not unique?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, dor nativeCurrency, token and currency, dont we need the to compare also the chainId

export function useSafeDeps(deps: unknown[]): unknown[] {
return deps.map((dep) => {
if (dep instanceof NativeCurrency) return dep.symbol
if (dep instanceof Token) return dep.address.toLowerCase()
if (dep instanceof CurrencyAmount) return dep.toExact() + dep.currency.symbol + dep.currency.isNative
if (dep instanceof WrappedTokenInfo) return dep.address
if (dep instanceof CurrencyAmount) return dep.toExact() + dep.currency.symbol + dep.currency.chainId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, dor nativeCurrency, token and currency, dont we need the to compare also the chainId

…protocol/cowswap into refactor/tokens-lib-wiring-4

# Conflicts:
#	apps/cowswap-frontend/src/legacy/utils/trade.ts
* fix(tokens): fix e2e tests for tokens updates (#3193)

* refactor(tokens): remove legacy code (#3194)

* fix(tokens): fix tokens list loading state (#3201)
@shoom3301 shoom3301 merged commit e852cd9 into refactor/tokens-lib-wiring-3 Oct 26, 2023
4 of 5 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2023
@alfetopito alfetopito deleted the refactor/tokens-lib-wiring-4 branch October 26, 2023 17:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants