From fdce8f55fe6c6515361de187318aeba0dda5bf8b Mon Sep 17 00:00:00 2001 From: Kamil Pyszkowski Date: Tue, 21 Nov 2023 10:06:35 +0100 Subject: [PATCH] Add missing network parameter There is an error with redemption validation function caused by the network parameter which fallbacks to mainnet on a testnet when is not provided. --- src/threshold-ts/tbtc/index.ts | 2 +- src/utils/forms.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/threshold-ts/tbtc/index.ts b/src/threshold-ts/tbtc/index.ts index 48b6db4f3..68255ff1b 100644 --- a/src/threshold-ts/tbtc/index.ts +++ b/src/threshold-ts/tbtc/index.ts @@ -1041,7 +1041,7 @@ export class TBTC implements ITBTC { return ( !isValidBtcAddress(btcAddress, network) || (!isPublicKeyHashTypeAddress(btcAddress, network) && - !isPayToScriptHashTypeAddress(btcAddress)) + !isPayToScriptHashTypeAddress(btcAddress, network)) ) } diff --git a/src/utils/forms.ts b/src/utils/forms.ts index 1617b133b..cb6780105 100644 --- a/src/utils/forms.ts +++ b/src/utils/forms.ts @@ -106,7 +106,7 @@ export const validateUnmintBTCAddress = ( } else if ( !isValidBtcAddress(address, network) || (!isPublicKeyHashTypeAddress(address, network) && - !isPayToScriptHashTypeAddress(address)) + !isPayToScriptHashTypeAddress(address, network)) ) { return `The BTC address has to start with ${getBridgeBTCSupportedAddressPrefixesText( "unmint",