-
Notifications
You must be signed in to change notification settings - Fork 101
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
[4.4] refactor(tokens): remove Uniswap currency entities usage #3199
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…protocol/cowswap into refactor/tokens-lib-wiring-4
…protocol/cowswap into refactor/tokens-lib-wiring-4
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
Summary
This is a continuation of migration from Uniswap entities.
To Test
Please, test everything in #3201