Skip to content

Commit

Permalink
Merge pull request #771 from hemilabs/enable-bitcoin-testnet
Browse files Browse the repository at this point in the history
Disable bitcoin for mainnet
  • Loading branch information
gndelia authored Jan 16, 2025
2 parents e5744d7 + 87beaa6 commit 8b7237f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions webapp/hooks/useNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,24 @@ export const useNetworks = function () {

// All enabled networks
const networks: RemoteChain[] = useMemo(
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
() => evmNetworks.concat(featureFlags.btcTunnelEnabled ? [bitcoin] : []),
[bitcoin, evmNetworks],
// TODO bitcoin is only enabled for testnet https://github.com/hemilabs/ui-monorepo/issues/738
() =>
evmNetworks.concat(
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
featureFlags.btcTunnelEnabled && type === 'testnet' ? [bitcoin] : [],
),
[bitcoin, evmNetworks, type],
)

// All enabled networks that can tunnel to/from Hemi
const remoteNetworks: RemoteChain[] = useMemo(
// TODO bitcoin is only enabled for testnet https://github.com/hemilabs/ui-monorepo/issues/738
() =>
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
evmRemoteNetworks.concat(featureFlags.btcTunnelEnabled ? [bitcoin] : []),
[bitcoin, evmRemoteNetworks],
evmRemoteNetworks.concat(
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
featureFlags.btcTunnelEnabled && type === 'testnet' ? [bitcoin] : [],
),
[bitcoin, evmRemoteNetworks, type],
)

return {
Expand Down

0 comments on commit 8b7237f

Please sign in to comment.