-
Notifications
You must be signed in to change notification settings - Fork 1
fix: pass import+approve token e2e tests [PoC] #407
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
base: master
Are you sure you want to change the base?
Changes from all commits
ff99cd2
5528577
c970455
c274df9
e5b0ab0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,17 +17,21 @@ export function useTokensFromLists() { | |
| const { childChain, parentChain } = useNetworksRelationship(networks); | ||
| const { data: tokenLists, isLoading: isLoadingTokenLists } = useTokenLists(childChain.id); | ||
|
|
||
| const { data = emptyData, isLoading } = useSWRImmutable( | ||
| [tokenLists ?? [], parentChain.id, childChain.id, 'useTokensFromLists'], | ||
| ([_tokenLists, _parentChainId, _childChainId]) => | ||
| tokenListsToSearchableTokenStorage( | ||
| _tokenLists, | ||
| String(_parentChainId), | ||
| String(_childChainId), | ||
| ), | ||
| ); | ||
|
|
||
| return { data, isLoading: isLoadingTokenLists || isLoading }; | ||
| // Derived synchronously so the tokens can never lag behind the fetched lists, | ||
| // which an extra async hook allowed under heavy re-rendering | ||
|
Comment on lines
+20
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we used SWR because otherwise each caller of this hook would fetch and return their own instances, this was causing performance issues
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. Worth noting that this is only a PoC which tries to get E2Es passing again by fixing some erroring parts of the bridge. If removing token-list SWR got the E2Es passing, then it doesn't necessarily mean we will remove SWR, but that the current implementation is worth going over and optimizing a bit to find out what's wrong with it. Just gives us a starting point of where to poke. |
||
| const data = useMemo(() => { | ||
| if (!tokenLists) { | ||
| return emptyData; | ||
| } | ||
|
|
||
| return tokenListsToSearchableTokenStorage( | ||
| tokenLists, | ||
| String(parentChain.id), | ||
| String(childChain.id), | ||
| ); | ||
| }, [tokenLists, parentChain.id, childChain.id]); | ||
|
|
||
| return { data, isLoading: isLoadingTokenLists }; | ||
| } | ||
|
|
||
| export function useTokensFromUser(): ContractStorage<ERC20BridgeToken> { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.