Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Update uni v3.0.8 to v3.2.3 #160

Merged
merged 40 commits into from
Feb 25, 2021
Merged

Update uni v3.0.8 to v3.2.3 #160

merged 40 commits into from
Feb 25, 2021

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Feb 19, 2021

Updates and adapt to uniswap v3.2.3

Do not Squash 🥒, just normal merge

Test

🔭 GP Swap: Gnosis Protocol v2 Swap UI

Tasks

  • Merge and resolve conflicts
  • Fix HeaderMod, it changed a bit. Main change is a theme toggle instead of the gear icon for the settings (which is in the widget now)
  • Make sure the new way of selecting lists don't break anything --> Tokens by network #107
  • Review the "Default lists of lists" functionality. DEFAULT_ACTIVE_LIST_URLS: string[] = [GEMINI_LIST]
  • Check how routes are being displayed: SwapRoute use to have CurrencyLogo, not anymore: 
import CurrencyLogo from '../CurrencyLogo'
  • Review new file imports, for STATE, SYLE, UTILS etc.
  • Handle new tags! It created branches with the new versions. We need a process to update
  • Fix unit tests [Uni-v3.2.3] Fix e2e tests #174

Not in this PR:

Overview

  • The gear icon (settings), moved to the widget

  • New theme toggle button in the header
    image

  • Improved token selector
    image

  • Improved list selection, now with combination of lists!
    image

  • Better support for custom tokens
    image

  • When a token is not found, but is in one of the lists. It suggest to add it
    image

  • Route is simplified
    image

image

  • Also, the confirmation modal has been approved

image

  • Allows you to add the token to Metamask

image

image

  • Expert mode don't makes you write "confirm" any more
    image

  • Allow to disable multi-hops:
    image

image

Notes on how to do the merge (notes for next merge)

  • Make sure you have the upstream remote. If not git remote add upstream git@github.com:Uniswap/uniswap-interface.git

  • Fetch all info from the remote. 🚨 IMPORTANT: Don't bring their TAGSs 🚨: git fetch upstream--no-tags

  • Make sure you know the latest version that was merged. In this case v3.0.8

  • Make sure you know the latest version you want to merge. In this case v3.2.3

  • Review and document the changes: git log v3.0.8..v3.2.3 --oneline --decorate=1

  • Create a new branch for the merge: git checkout -b update-uni-v3.2.3

  • Merge: git merge v3.0.8

  • Resolve conflicts: try to favour their changes in the original files. Theoretically most of it, should be imports that we've done as absolut while theirs are relative

  • Try to run the app

  • Review new files that where added in the merge. They might import modified files of our custom dir. So, they would require to change the import to use global.

  • Review commits for changes we could be affected, or how we can use the change. Get a good understanding of the new features, fixes, etc

  • Review the Mod files. They should still compare line to line. So you can use vscode to compare the two files. Try to make it so they still compare line by line.

  • For making the tags , maybe next time there's a better way. But this time, I made the mistake of fetching all the tags from upstream, so it brought their versioning into ours. Anyways, I took the output, that showed the new branches and I created their new versions as versions in uniswap/<version>

\[new tag\] (.+) ->.+

git tag upstream/$1 uniswap/$1 && \

Notes on the conflict solving

  • Most of the conflicts, where import conflicts
  • Some updates of dependencies
  • Fix some conflicts with global imports instead of relative
  • Deleted ListSeelct component
  • Changed how the lists are handled
    • Affected the constants
    • For exaple affected at dimas state/orders/mocks.ts
      • changed useSelectedTokenList ---> useCombinedActiveList
      • Also changes what it returns
  • Adapted a few things to xDAI
    • Like combination logic for tokenLists: combineMaps in state/list/hooks
  • A few conflicts in custom!
  • They added WBTC for route calculations
  • Now the settings is in the widget
  • Changed the HeaderMod: compared with a diff and adapted it
    • deleted thigns, added things :)
  • Darkmode!
  • A lot of tags came when I updated. I had to
    • Save them in a file
    • Execute a command

Output of the merge

❯ git merge v3.2.3
Auto-merging yarn.lock
CONFLICT (content): Merge conflict in yarn.lock
Auto-merging tsconfig.json
Auto-merging src/theme/index.tsx
Auto-merging src/state/user/hooks.tsx
Auto-merging src/state/mint/hooks.ts
Auto-merging src/state/lists/updater.ts
CONFLICT (content): Merge conflict in src/state/lists/updater.ts
Auto-merging src/state/lists/reducer.ts
CONFLICT (content): Merge conflict in src/state/lists/reducer.ts
Auto-merging src/state/lists/reducer.test.ts
CONFLICT (content): Merge conflict in src/state/lists/reducer.test.ts
Auto-merging src/state/lists/hooks.ts
CONFLICT (content): Merge conflict in src/state/lists/hooks.ts
Auto-merging src/state/governance/hooks.ts
Auto-merging src/pages/Vote/index.tsx
Auto-merging src/pages/Vote/VotePage.tsx
CONFLICT (content): Merge conflict in src/pages/Vote/VotePage.tsx
Auto-merging src/pages/Swap/index.tsx
CONFLICT (content): Merge conflict in src/pages/Swap/index.tsx
Auto-merging src/pages/RemoveLiquidity/index.tsx
Auto-merging src/pages/PoolFinder/index.tsx
Auto-merging src/pages/Pool/index.tsx
Auto-merging src/pages/MigrateV1/index.tsx
CONFLICT (content): Merge conflict in src/pages/MigrateV1/index.tsx
Auto-merging src/pages/Earn/index.tsx
Auto-merging src/pages/Earn/Manage.tsx
Auto-merging src/pages/App.tsx
Auto-merging src/pages/AddLiquidity/index.tsx
Auto-merging src/index.tsx
CONFLICT (content): Merge conflict in src/index.tsx
Auto-merging src/hooks/useFetchListCallback.ts
Auto-merging src/data/V1.ts
Auto-merging src/constants/index.ts
CONFLICT (content): Merge conflict in src/constants/index.ts
Auto-merging src/components/swap/SwapRoute.tsx
CONFLICT (content): Merge conflict in src/components/swap/SwapRoute.tsx
Auto-merging src/components/swap/AdvancedSwapDetails.tsx
Auto-merging src/components/earn/PoolCard.tsx
Auto-merging src/components/TransactionConfirmationModal/index.tsx
CONFLICT (content): Merge conflict in src/components/TransactionConfirmationModal/index.tsx
Auto-merging src/components/TokenWarningModal/index.tsx
CONFLICT (content): Merge conflict in src/components/TokenWarningModal/index.tsx
Auto-merging src/components/Settings/index.tsx
Auto-merging src/components/SearchModal/filtering.ts
CONFLICT (content): Merge conflict in src/components/SearchModal/filtering.ts
CONFLICT (modify/delete): src/components/SearchModal/ListSelect.tsx deleted in v3.2.3 and modified in HEAD. Version HEAD of src/components/SearchModal/ListSelect.tsx left in tree.
Auto-merging src/components/SearchModal/CurrencySearch.tsx
CONFLICT (content): Merge conflict in src/components/SearchModal/CurrencySearch.tsx
Auto-merging src/components/SearchModal/CurrencyList.tsx
CONFLICT (content): Merge conflict in src/components/SearchModal/CurrencyList.tsx
Auto-merging src/components/PositionCard/index.tsx
Auto-merging src/components/Popups/ListUpdatePopup.tsx
Auto-merging src/components/Menu/index.tsx
Auto-merging src/components/Header/index.tsx
Auto-merging src/components/CurrencyInputPanel/index.tsx
Auto-merging package.json
CONFLICT (content): Merge conflict in package.json
Removing cypress/integration/token-warning.ts
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.

Changes

34dfb41 (tag: v3.2.3) feature(service worker): add offline support (#1319)
e77fcd2 (tag: v3.2.2) Update index.ts
0b7846e (tag: v3.2.1) fix(discord): correct links (#1315)
f450d34 (tag: v3.2.0) feat(transactions): enable button to add tokens to metamask (#1311)
76ab349 show hidden search results by default (#1310)
5c3c1c6 run npx browserslist@latest --update-db (#1303)
9efd5da (tag: v3.1.11) change branch in workflows
8fd894f (upstream/master) fix a prominent instance (#1304)
cc22183 (tag: v3.1.10) fix(modal cutoff, lists): make modal scrollable on small screens, fix typo, auto update all lists (#1301)
9175dd1 remove cloudflare insights
bbd50f0 fixes Uniswap/interface#1214
2291e3e (tag: v3.1.9) improvement(lists): enable Gemini by default (#1276)
28d8f0b (tag: v3.1.8) Improvement(token import): update import flow and style tweaks (#1273)
8bed390 (tag: v3.1.7) Improvements(lists): update defaults, style updates (#1270)
a1000c6 (tag: v3.1.6) improvement(routing): use WBTC pairs for routing swaps, style updates (#1269)
267204d (tag: v3.1.5) Improvement(lists): Switch to multiple active lists (#1237)
74f50f1 (tag: v3.1.4) fix(typo): toggle (#1260)
a70aa41 (tag: v3.1.3) Routing updates only (#1265)
587b659 (tag: v3.1.2) catch error in bytes32 string parsing (#1253)
5388cab (tag: v3.1.1) update vote timestamp estimation (#1242)
cadd68f (tag: v3.1.0) feat: allow overriding proposals in the UI (#1239)
ab8ce37 (tag: v3.0.18) fix(token lists): update to latest token-lists
5a9a71a improvement(analytics): try out cloudflare analytics
b93fd23 (tag: v3.0.17) Specially Designated Nationals and Blocked Persons Ethereum addresses
e9a11bb (tag: v3.0.16) fix(vote): make the vote page responsive
c5afbed (tag: v3.0.15) fixed bug causing wbtc to have 18 decimals (#1211)
5b2c445 (tag: v3.0.14) fix(list popup): big token list updates scroll issue (#1219)
7fd4005 (tag: v3.0.13) Fix(UNI page): hide inactive pools (#1213)
48eab0d (tag: v3.0.12) bump token lists
c9ee1b3 (tag: v3.0.11) Fix(pool page): show deposited liquidity on pool page (#1195)
eb4c305 (tag: v3.0.10) fix(ens): support ens names with dashes in them
d982562 (tag: v3.0.9) Allow absolute imports (#1185)

Tags

  • Updated tags manually
  • If you fetch directly from upstream you'll get some tags you don't want
  • One solution is to tag manually:
    • Get all tags and commits from uni git ls-remote --tags upstream > tags.txt
    • Delete from the TXT file the tags you don't want. Include only the ones between the versions you are updating
    • Use vscode to find and replace using a regex:
      • expression: (\w+) refs/tags/(.+)
      • value: git tag uniswap/$2 $1 && \
    • Execute the command (remember to delete the last && of the command

In this case, the execution returned:

❯ git push --tags
Total 0 (delta 0), reused 0 (delta 0)
To github.com:gnosis/gp-swap-ui.git
 * [new tag]         uniswap/v3.0.9 -> uniswap/v3.0.9
 * [new tag]         uniswap/v3.1.0 -> uniswap/v3.1.0
 * [new tag]         uniswap/v3.1.1 -> uniswap/v3.1.1
 * [new tag]         uniswap/v3.1.10 -> uniswap/v3.1.10
 * [new tag]         uniswap/v3.1.11 -> uniswap/v3.1.11
 * [new tag]         uniswap/v3.1.2 -> uniswap/v3.1.2
 * [new tag]         uniswap/v3.1.3 -> uniswap/v3.1.3
 * [new tag]         uniswap/v3.1.4 -> uniswap/v3.1.4
 * [new tag]         uniswap/v3.1.5 -> uniswap/v3.1.5
 * [new tag]         uniswap/v3.1.6 -> uniswap/v3.1.6
 * [new tag]         uniswap/v3.1.7 -> uniswap/v3.1.7
 * [new tag]         uniswap/v3.1.8 -> uniswap/v3.1.8
 * [new tag]         uniswap/v3.1.9 -> uniswap/v3.1.9
 * [new tag]         uniswap/v3.2.0 -> uniswap/v3.2.0
 * [new tag]         uniswap/v3.2.1 -> uniswap/v3.2.1
 * [new tag]         uniswap/v3.2.2 -> uniswap/v3.2.2
 * [new tag]         uniswap/v3.2.3 -> uniswap/v3.2.3
 * [new tag]         upstream/v3.0.8 -> upstream/v3.0.8

Test

Good Testing required with the review

anxolin and others added 30 commits November 3, 2020 09:16
* fix: parseENSAddress #1200

* fix: lint error #1200

* fix: parseENSAddress - allow to match domains with twice characters; disallow more than once dash next to each other
* Show staked liquidity on pool page

* update button, cleanup

* Show combined balance for staking cards

* hide buttons on position card if no balance
* Hide rewards

* remove config changes

* move active detection to hook, small changes

* replace string math
Co-authored-by: Moody Salem <moodysalem@users.noreply.github.com>
* feat: allow overriding proposals in the UI

* Fix code style issues with ESLint

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
* start routing fix for multi hops

* switch to input amount comparison on exactOut

* make percent logic more clear

* remove uneeded comaprisons

* move logic to functions for testing

* add multi hop disable switch

* add GA

* fix bug to return multihop no single

* update swap details

* code clean

* routing only
* basic support for multiple active lists

* start search across inactive lists

* store card before list update

* basic import flow for inactive tokens

* update supported lists

* update import flow for address pasting

* basic mvp

* hide filter if no results

* update min heights

* update manage view, index tokens on page load

* start routing fix for multi hops

* switch to input amount comparison on exactOut

* start list import view

* updated list UI, token search updates, list import flow, surpress popups and warnings

* add unsupported tokens

* show warning if logged out

* update to opyn list

* show token details on warning;

* make percent logic more clear

* remove uneeded comaprisons

* move logic to functions for testing

* test updates

* update list reducer tests

* remove unused locals

* code cleanup

* add unsupported local list

* add multi hop disable switch

* add GA

* fix bug to return multihop no single

* update swap details

* copy updates

* Visual refinements

* Further tweaks

* copy updates, actual list order

* Move settings button

* Update all trade views with settings cog

* Add better tips, remove darkmode toggle from dropdown

* Clean up routing UI

* UI tweaks

* minor tweaks

* copy updates

* add local default list, use existing function for trade comparison, disable v1 helper, show inactive/active at once

* updated inactive view

* remove slippage fix

* update output amount return

* center button, update search to character threshold

* reset add state on back navigation

* style tweak on add button

* fix bug on search results

Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
…#1269)

* 'Added WBTC to default option for routing in main UI"

* update settings button

Co-authored-by: Gismar <thegismar@gmail.com>
* update defaults, style updates

* update icon color
* update import flow and style tweaks

* update tests

* Update tsconfig.json
* update import flow and style tweaks

* update tests

* Update tsconfig.json

* add gemini

* enable gemini
… typo, auto update all lists (#1301)

* update all lists, not just active ones

* fix typo
* show hidden search results by default

* update break styles

* optimize filter, use debounce on input

* increase debounce time
* start on adding button for watching tokens

* add tokens to metamask

* add confirmation view

* reset modal view
@github-actions
Copy link
Contributor

  • 🔭 GP Swap: Gnosis Protocol v2 Swap UI

Comment on lines -22 to +24
export const WBTC = new Token(ChainId.MAINNET, '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', 18, 'WBTC', 'Wrapped BTC')
export const WBTC = new Token(ChainId.MAINNET, '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', 8, 'WBTC', 'Wrapped BTC')
Copy link
Contributor

Choose a reason for hiding this comment

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

Oopsie

Copy link
Contributor

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Well, as far as I can tell, all is ok?
Integration tests are failing though.
And I have not tested it

src/custom/components/Header/HeaderMod.tsx Show resolved Hide resolved
@anxolin anxolin merged commit a62ded4 into develop Feb 25, 2021
@anxolin
Copy link
Contributor Author

anxolin commented Feb 25, 2021

@alfetopito @W3stside I did the review, and fixed the test. Tested a few things. There was a lot of changes. We should keep an eye, although all looks good.

Let me know if you want to do further review of this PR.

I think we should do frequent updates, so it doesn't get to this size of PRs. Maybe our biweekly deployment is a good time for making a PR of updating Uni.

@anxolin anxolin mentioned this pull request Mar 15, 2021
W3stside pushed a commit that referenced this pull request Jun 28, 2021
@anxolin anxolin deleted the update-uni-v3.2.3 branch July 2, 2021 13:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Cannot set property 'autoRefreshOnNetworkChange' of undefined