Skip to content

Commit

Permalink
ci(release): publish latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-happy-puppy committed Oct 9, 2024
1 parent df1b743 commit 6bac24a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
14 changes: 7 additions & 7 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
IPFS hash of the deployment:
- CIDv0: `QmbPRyz7JxeDFrkmKzQnSi5h8Vn5iP81skJA5SoXkfJb6G`
- CIDv1: `bafybeigb3zegvo3fwadtcskq6ty2fbznvkqu7jkxt56dequcbqenjo5kme`
- CIDv0: `QmSSKD7h4Q9E4bEtFW5zqeBJQ419v7BGHUushs7Myz2WQQ`
- CIDv1: `bafybeib44ixryspegordbiauzjcek6nvu4kqbdgucj6dgvwiv4jad6owde`

The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).

Expand All @@ -10,15 +10,15 @@ You can also access the Uniswap Interface from an IPFS gateway.
Your Uniswap settings are never remembered across different URLs.

IPFS gateways:
- https://bafybeigb3zegvo3fwadtcskq6ty2fbznvkqu7jkxt56dequcbqenjo5kme.ipfs.dweb.link/
- https://bafybeigb3zegvo3fwadtcskq6ty2fbznvkqu7jkxt56dequcbqenjo5kme.ipfs.cf-ipfs.com/
- [ipfs://QmbPRyz7JxeDFrkmKzQnSi5h8Vn5iP81skJA5SoXkfJb6G/](ipfs://QmbPRyz7JxeDFrkmKzQnSi5h8Vn5iP81skJA5SoXkfJb6G/)
- https://bafybeib44ixryspegordbiauzjcek6nvu4kqbdgucj6dgvwiv4jad6owde.ipfs.dweb.link/
- https://bafybeib44ixryspegordbiauzjcek6nvu4kqbdgucj6dgvwiv4jad6owde.ipfs.cf-ipfs.com/
- [ipfs://QmSSKD7h4Q9E4bEtFW5zqeBJQ419v7BGHUushs7Myz2WQQ/](ipfs://QmSSKD7h4Q9E4bEtFW5zqeBJQ419v7BGHUushs7Myz2WQQ/)

### 5.50.1 (2024-10-07)
### 5.50.2 (2024-10-09)


### Bug Fixes

* **web:** invalidate local activity cache for updates to transaction or signature state - prod (#12732) 74b24f2
* **web:** log step and original error on web (#12826) 5d4bd4f


2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web/5.50.1
web/5.50.2
25 changes: 19 additions & 6 deletions apps/web/src/state/sagas/transactions/swapSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ import {
import { isClassic } from 'uniswap/src/features/transactions/swap/utils/routing'
import { getClassicQuoteFromResponse } from 'uniswap/src/features/transactions/swap/utils/tradingApi'
import { createSaga } from 'uniswap/src/utils/saga'
import { errorToString } from 'utilities/src/errors'
import { percentFromFloat } from 'utilities/src/format/percent'
import { logger } from 'utilities/src/logger/logger'
import { LoggerErrorContext } from 'utilities/src/logger/types'
import { didUserReject } from 'utils/swapErrorToUserReadableMessage'

interface HandleSwapStepParams extends Omit<HandleOnChainStepParams, 'step' | 'info'> {
Expand Down Expand Up @@ -206,9 +208,7 @@ function* classicSwap(
}
} catch (error) {
const displayableError = getDisplayableError(error, step)
if (displayableError) {
logger.error(displayableError, { tags: { file: 'swapSaga', function: 'classicSwap' } })
}
logSwapError(displayableError, { tags: { file: 'swapSaga', function: 'classicSwap' } })
onFailure(displayableError)
return
}
Expand Down Expand Up @@ -256,9 +256,7 @@ function* uniswapXSwap(
}
} catch (error) {
const displayableError = getDisplayableError(error, step)
if (displayableError) {
logger.error(displayableError, { tags: { file: 'swapSaga', function: 'uniswapXSwap' } })
}
logSwapError(displayableError, { tags: { file: 'swapSaga', function: 'uniswapXSwap' } })
onFailure(displayableError)
return
}
Expand All @@ -267,6 +265,21 @@ function* uniswapXSwap(
yield* call(onSuccess)
}

function logSwapError(error: TransactionError | undefined, captureContext: LoggerErrorContext) {
if (error instanceof TransactionStepFailedError) {
logger.error(
{
...error,
step: JSON.stringify(error.step),
originalError: errorToString(error.originalError),
},
captureContext,
)
} else if (error) {
logger.error(error, captureContext)
}
}

function getDisplayableError(error: Error, step: TransactionStep): TransactionError | undefined {
// If the user rejects a request, or it's a known interruption e.g. trade update, we handle gracefully / do not show error UI
if (didUserReject(error) || error instanceof HandledTransactionInterrupt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,10 @@ export function validateTrade({
const inputsMatch = areAddressesEqual(currencyIn.wrapped.address, trade?.inputAmount.currency.wrapped.address)
const outputsMatch = areAddressesEqual(currencyOut.wrapped.address, trade.outputAmount.currency.wrapped.address)

// TODO(MOB-3028): check if this logic needs any adjustments once we add UniswapX support.
// Verify the amount specified in the quote response matches the exact amount from input state
const exactAmountFromQuote = isClassicQuote(trade.quote?.quote)
? exactCurrencyField === CurrencyField.INPUT
? trade.quote.quote.input?.amount
: trade.quote.quote.output?.amount
: undefined

const tokenAddressesMatch = inputsMatch && outputsMatch
const exactAmountsMatch = exactAmount?.toExact() !== exactAmountFromQuote

if (!(tokenAddressesMatch && exactAmountsMatch)) {
logger.error(new Error(`Mismatched ${!tokenAddressesMatch ? 'address' : 'exact amount'} in swap trade`), {
// TODO(WEB-5132): Add validation checking that exact amount from response matches exact amount from user input
if (!tokenAddressesMatch) {
logger.error(new Error(`Mismatched address in swap trade`), {
tags: { file: 'tradingApi/utils', function: 'validateTrade' },
extra: {
formState: {
Expand Down

0 comments on commit 6bac24a

Please sign in to comment.