Skip to content

Commit

Permalink
fix: bridging functionality for testnet (#524)
Browse files Browse the repository at this point in the history
* fix: prevent chain client from downloading unrelated IBC requests

    - the requests can generate 404 Not Found responses if there is no
      chain-registry IBC data between these chains

* feat: enable bridge buttons of related found assets

* refactor: improve useChainUtil memoization

* fix: resolve correct chain denoms on any remote chain

* fix: use chain-registry info to determine IBC port and channel IDs

* refactor: abstract out useSingleHopChannelInfo

* refactor: pass SWR information through useSingleHopChannelInfo hook

* refactor: move IBC client status check to BridgeCard component

* refactor: remove previous usage of useIbcOpenTransfers checks:

    - the previous logic queried every connection, channel, and client
      of an IBC chain, this was a lot of data for some real chains
    - the new logic queries only the client state as the best check of
      liveliness

* feat: add source/destination client status output to BridgeCard

* refactor: remove unused remote chain hooks

* feat: tidy up URLs in notification toasts

* fix: add custom RPC client check for bank balance:

    - the previous check (now a suggested default check) did not
      prevent error of a validator having incorrect account sequencing
    - the error was: Error: Account '[account_number]' does not exist
      on chain. Send some tokens there before trying to query sequence

* fix: Bridge form should disable during active request

* fix: correct side (source/dest) bank balance checked for Bridge button

* fix: make Bridge button error text same size as submit text
  • Loading branch information
dib542 authored Jan 30, 2024
1 parent 2b93ec8 commit 1bb9f7b
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 451 deletions.
7 changes: 6 additions & 1 deletion src/components/cards/AssetsTableCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ function AssetRow({
const { data: trace } = useDenomTrace(denom);
const { data: token, isValidating } = useToken(denom);
const { data: nativeChain } = useNativeChain();
const singleHopIbcCounterParty =
token?.traces &&
token.traces.length === 1 &&
token.traces.at(0)?.type === 'ibc' &&
token.traces.at(0)?.counterparty;

return token ? (
<tr>
Expand Down Expand Up @@ -237,7 +242,7 @@ function AssetRow({
<td>
{token.chain.chain_id !== nativeChain.chain_id && (
// disable buttons if there is no known path to bridge them here
<fieldset disabled={!address || !token.ibc}>
<fieldset disabled={!address || !singleHopIbcCounterParty}>
<BridgeButton
className="button button-primary-outline nowrap mx-0"
from={token}
Expand Down
Loading

0 comments on commit 1bb9f7b

Please sign in to comment.