-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
improvement(swap): Better swap errors for FoT #1015
Merged
Merged
Changes from 6 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
1c69d38
move the gas estimation stuff into its own hook and report errors fro…
moodysalem b997e65
fix linter errors
moodysalem a5098a6
show the swap callback error separately
moodysalem dbb28b5
rename some variables
moodysalem b05e07b
use a manually specified key for gas estimates
moodysalem 3e707e9
Merge branch 'master' into better-swap-errors
moodysalem 646c44a
Merge branch 'master' into better-swap-errors
moodysalem e818962
flip price... thought i did this already
moodysalem 532f2d7
only show swap callback error if approval state is approved
moodysalem 504f10c
some clean up to the swap components
moodysalem 9934e87
stop proactively looking for gas estimates
moodysalem b67d5aa
improve some retry stuff, show errors inline
moodysalem 7d83a2e
add another retry test
moodysalem f7ce0f1
latest ethers
moodysalem f84aa07
fix integration tests
moodysalem e798d82
simplify modal and fix jitter on open in mobile
moodysalem 69a2cee
refactor confirmation modal into pieces before creating the error con…
moodysalem a024e92
finish refactoring of transaction confirmation modal
moodysalem 368c782
show error state in the transaction confirmation modal
moodysalem 1c5ba1d
fix lint errors
moodysalem 74b6639
error not always relevant
moodysalem 69e6f17
fix lint errors, remove action item
moodysalem a3ebbb1
move a lot of code into ConfirmSwapModal.tsx
moodysalem 00d2bf6
show accept changes flow, not styled
moodysalem dc2b6f9
Adjust styles for slippage error states
callil 9d47801
Add styles for updated price prompt
callil b368a62
Add input/output highlighting
callil 2aa81ca
lint errors
moodysalem dc02608
fix link to wallets in modal
moodysalem 0946891
use total supply instead of reserves for `noLiquidity` (fixes #701)
moodysalem 120c766
bump the walletconnect version to the fixed alpha
moodysalem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 16 additions & 4 deletions
20
src/components/Popups/TxnPopup.tsx → src/components/Popups/TransactionPopup.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
import React, { useContext } from 'react' | ||
import { AlertCircle, CheckCircle } from 'react-feather' | ||
import { ThemeContext } from 'styled-components' | ||
import styled, { ThemeContext } from 'styled-components' | ||
import { useActiveWeb3React } from '../../hooks' | ||
import { TYPE } from '../../theme' | ||
import { ExternalLink } from '../../theme/components' | ||
import { getEtherscanLink } from '../../utils' | ||
import { AutoColumn } from '../Column' | ||
import { AutoRow } from '../Row' | ||
|
||
export default function TxnPopup({ hash, success, summary }: { hash: string; success?: boolean; summary?: string }) { | ||
const RowNoFlex = styled(AutoRow)` | ||
flex-wrap: nowrap; | ||
` | ||
|
||
export default function TransactionPopup({ | ||
hash, | ||
success, | ||
summary | ||
}: { | ||
hash: string | ||
success?: boolean | ||
summary?: string | ||
}) { | ||
const { chainId } = useActiveWeb3React() | ||
|
||
const theme = useContext(ThemeContext) | ||
|
||
return ( | ||
<AutoRow> | ||
<RowNoFlex> | ||
<div style={{ paddingRight: 16 }}> | ||
{success ? <CheckCircle color={theme.green1} size={24} /> : <AlertCircle color={theme.red1} size={24} />} | ||
</div> | ||
<AutoColumn gap="8px"> | ||
<TYPE.body fontWeight={500}>{summary ?? 'Hash: ' + hash.slice(0, 8) + '...' + hash.slice(58, 65)}</TYPE.body> | ||
<ExternalLink href={getEtherscanLink(chainId, hash, 'transaction')}>View on Etherscan</ExternalLink> | ||
</AutoColumn> | ||
</AutoRow> | ||
</RowNoFlex> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
batches
eth_estimateGas
,eth_call
and potentiallyeth_blockNumber
though that is usually sequential with the other two