Skip to content
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

chore: disable Polkadot Asset Hub due to potential issue of losing fund #1017

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions apps/web/src/components/widgets/dex/TransportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ import {
type Account,
} from '@domains/accounts'
import { bridgeAdapterState, bridgeState } from '@domains/bridge'
import { tokenPriceState } from '@domains/chains'
import { useExtrinsic } from '@domains/common'
import { type SubmittableExtrinsic } from '@polkadot/api/types'
import { type ISubmittableResult } from '@polkadot/types/types'
import { type Chain, type InputConfig } from '@polkawallet/bridge'
import * as Sentry from '@sentry/react'
import { useTokens as useBalancesLibTokens } from '@talismn/balances-react'
import { Decimal } from '@talismn/math'
import { CircularProgressIndicator, toast } from '@talismn/ui'
import { Maybe } from '@util/monads'
import { isEmpty, uniqBy } from 'lodash'
import { uniqBy } from 'lodash'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { RecoilLoadable, constSelector, useRecoilValue, useRecoilValueLoadable, type Loadable } from 'recoil'
import { Observable } from 'rxjs'
import { useAccountSelector } from '../AccountSelector'
import TokenSelectorButton from '../TokenSelectorButton'
import { tokenPriceState } from '@domains/chains'
import { useTokens as useBalancesLibTokens } from '@talismn/balances-react'
import AnimatedFiatNumber from '../AnimatedFiatNumber'
import TokenSelectorButton from '../TokenSelectorButton'

const TransportForm = () => {
const bridge = useRecoilValue(bridgeState)
Expand Down Expand Up @@ -75,16 +75,6 @@ const TransportForm = () => {
}
}, [sender, setRecipient])

const filterParams = <T extends Record<string, unknown>>(object: T) => {
const params = Object.fromEntries(Object.entries(object).filter(([_, value]) => value !== undefined))

if (isEmpty(params)) {
return undefined
}

return params
}

const routes = useMemo(
() =>
bridge.router
Expand Down Expand Up @@ -125,7 +115,7 @@ const TransportForm = () => {
)

const routeReversible = useMemo(() => {
const routes = bridge.router.getRouters(filterParams({ token }))
const routes = bridge.router.getAvailableRouters().filter(x => x.token === token)

if (fromChain === undefined && toChain === undefined) {
return false
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/domains/bridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const bridgeState = selector({
.filter((x): x is NonNullable<typeof x> => x !== undefined)
.map(x => x.adapter),
disabledRouters: [
// temportatily disable Kusama routes
// Temporarily disable Kusama routes
// due to: https://github.com/paritytech/polkadot-sdk/issues/3050
{ from: 'altair' },
{ from: 'kusama' },
Expand All @@ -39,6 +39,8 @@ export const bridgeState = selector({
{ from: 'robonomics' },
{ from: 'tinkernet' },
{ from: 'statemine' },
// Disable Asset Hub due to similarly reported issue
{ from: 'statemint' },
],
})
await bridge.isReady
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/atoms/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const BaseIconButtonFactory =
const theme = useTheme()
return (
<Element
as="button"
{...props}
css={[
{
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/molecules/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TextInput = Object.assign(
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: '0.8rem',
'> *:empty::after': {
'label:empty::after': {
content: `"\u200B"`,
},
}}
Expand Down Expand Up @@ -119,7 +119,7 @@ const TextInput = Object.assign(
justifyContent: 'space-between',
alignItems: 'center',
marginTop: '0.8rem',
'> *:empty::after': {
'label:empty::after': {
content: `"\u200B"`,
},
}}
Expand Down
Loading