diff --git a/src/families/bitcoin/logic.ts b/src/families/bitcoin/logic.ts index d7c682e2fc..9957284ca1 100644 --- a/src/families/bitcoin/logic.ts +++ b/src/families/bitcoin/logic.ts @@ -1,5 +1,4 @@ import cashaddr from "cashaddrjs"; -import bchaddr from "bchaddrjs"; import { Currency, isValidAddress } from "./wallet-btc"; import { RecipientRequired, InvalidAddress } from "@ledgerhq/errors"; import type { Account, CryptoCurrency, CryptoCurrencyIds } from "./../../types"; @@ -143,8 +142,8 @@ type CoinLogic = { injectGetAddressParams?: (arg0: Account) => any; }; -const bchToCashaddrAddressWithoutPrefix = (recipient) => - recipient ? bchaddr.toCashAddress(recipient).split(":")[1] : recipient; +export const bchToCashaddrAddressWithoutPrefix = (recipient) => + recipient ? recipient.substring(recipient.indexOf(":") + 1) : recipient; export const perCoinLogic: Record< CryptoCurrencyIds, diff --git a/src/families/bitcoin/specs.ts b/src/families/bitcoin/specs.ts index 138836a167..14bfb23fa5 100644 --- a/src/families/bitcoin/specs.ts +++ b/src/families/bitcoin/specs.ts @@ -257,7 +257,9 @@ const bitcoinLikeMutations = ({ test: ({ account }) => { expect( account.bitcoinResources?.utxos - .filter((u) => u.blockHeight && u.blockHeight < account.blockHeight) // Exclude pending UTXOs and the Utxos just written into new block + .filter( + (u) => u.blockHeight && u.blockHeight < account.blockHeight - 10 + ) // Exclude pending UTXOs and the Utxos just written into new block (10 blocks time) .reduce((p, c) => p.plus(c.value), new BigNumber(0)) .toString() ).toBe("0");