From 8786835496cd095988482e787a85f288752f145a Mon Sep 17 00:00:00 2001 From: Kamil Pyszkowski Date: Wed, 15 Nov 2023 12:01:41 +0100 Subject: [PATCH 1/6] Added TODO comment Bug with false positive "Unminting in progress" status --- src/pages/tBTC/Bridge/UnmintDetails.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/tBTC/Bridge/UnmintDetails.tsx b/src/pages/tBTC/Bridge/UnmintDetails.tsx index ceb7f3b60..01cf23a75 100644 --- a/src/pages/tBTC/Bridge/UnmintDetails.tsx +++ b/src/pages/tBTC/Bridge/UnmintDetails.tsx @@ -183,6 +183,10 @@ export const UnmintDetails: PageComponent = () => { const timelineBadgeBgColor = useColorModeValue("white", "brand.800") + // TODO: Resolve bug with false positive "Unminting in progress" status + // Plausible solution: fallback conditional rendering to the + // `shouldForceIsProcessCompleted` value + return ( Date: Wed, 15 Nov 2023 14:35:40 +0100 Subject: [PATCH 2/6] Apply fix for the bug Extended render condition to include `shouldForceIsProcessCompleted` boolean --- src/pages/tBTC/Bridge/UnmintDetails.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/tBTC/Bridge/UnmintDetails.tsx b/src/pages/tBTC/Bridge/UnmintDetails.tsx index 01cf23a75..6a5ce3d39 100644 --- a/src/pages/tBTC/Bridge/UnmintDetails.tsx +++ b/src/pages/tBTC/Bridge/UnmintDetails.tsx @@ -202,9 +202,13 @@ export const UnmintDetails: PageComponent = () => { - {!shouldDisplaySuccessStep && ( + {!(shouldDisplaySuccessStep || shouldForceIsProcessCompleted) && ( {" "} - In progress... From bc39cac088af4f3b5e164120d909cd934656dbf3 Mon Sep 17 00:00:00 2001 From: Kamil Pyszkowski Date: Wed, 15 Nov 2023 14:38:13 +0100 Subject: [PATCH 3/6] Remove TODO comment This reverts commit 8786835496cd095988482e787a85f288752f145a. --- src/pages/tBTC/Bridge/UnmintDetails.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pages/tBTC/Bridge/UnmintDetails.tsx b/src/pages/tBTC/Bridge/UnmintDetails.tsx index 6a5ce3d39..370c4550a 100644 --- a/src/pages/tBTC/Bridge/UnmintDetails.tsx +++ b/src/pages/tBTC/Bridge/UnmintDetails.tsx @@ -183,10 +183,6 @@ export const UnmintDetails: PageComponent = () => { const timelineBadgeBgColor = useColorModeValue("white", "brand.800") - // TODO: Resolve bug with false positive "Unminting in progress" status - // Plausible solution: fallback conditional rendering to the - // `shouldForceIsProcessCompleted` value - return ( Date: Mon, 20 Nov 2023 18:01:29 +0100 Subject: [PATCH 4/6] Resolve issue with env variable being overwritten CI set the environment variable on build `DAPP_DEVELOPMENT_TESTNET_CONTRACTS` but the dapp didn't read that because it had `REACT_APP_DAPP_DEVELOPMENT_TESTNET_CONTRACTS = false` and `.env` took precedence. The change sets the `.env` based on the specified environment variable so the dapp will now take that into account. --- .env | 2 +- .env.production | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 46acb5368..183a6239d 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ REACT_APP_SUPPORTED_CHAIN_ID=1337 REACT_APP_ETH_HOSTNAME_HTTP=http://localhost:8545 REACT_APP_ETH_HOSTNAME_WS=ws://localhost:8545 REACT_APP_MULTICALL_ADDRESS=$MULTICALL_ADDRESS -REACT_APP_DAPP_DEVELOPMENT_TESTNET_CONTRACTS=false +REACT_APP_DAPP_DEVELOPMENT_TESTNET_CONTRACTS=$DAPP_DEVELOPMENT_TESTNET_CONTRACTS REACT_APP_FEATURE_FLAG_TBTC_V2=true REACT_APP_FEATURE_FLAG_TBTC_V2_REDEMPTION=true diff --git a/.env.production b/.env.production index d836378d8..6a8c662b3 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,7 @@ REACT_APP_SUPPORTED_CHAIN_ID=$CHAIN_ID REACT_APP_ETH_HOSTNAME_HTTP=$ETH_HOSTNAME_HTTP REACT_APP_ETH_HOSTNAME_WS=$ETH_HOSTNAME_WS +REACT_APP_DAPP_DEVELOPMENT_TESTNET_CONTRACTS=$DAPP_DEVELOPMENT_TESTNET_CONTRACTS REACT_APP_FEATURE_FLAG_TBTC_V2=true REACT_APP_FEATURE_FLAG_TBTC_V2_REDEMPTION=true From fdce8f55fe6c6515361de187318aeba0dda5bf8b Mon Sep 17 00:00:00 2001 From: Kamil Pyszkowski Date: Tue, 21 Nov 2023 10:06:35 +0100 Subject: [PATCH 5/6] 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", From 9c44d110f540042c5df89605106de23f43abef90 Mon Sep 17 00:00:00 2001 From: Kamil Pyszkowski Date: Tue, 21 Nov 2023 10:13:30 +0100 Subject: [PATCH 6/6] Propagate the fix in more places There are more places in code where the same bug might occur. --- src/pages/tBTC/Bridge/UnmintDetails.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/tBTC/Bridge/UnmintDetails.tsx b/src/pages/tBTC/Bridge/UnmintDetails.tsx index 370c4550a..a410727f7 100644 --- a/src/pages/tBTC/Bridge/UnmintDetails.tsx +++ b/src/pages/tBTC/Bridge/UnmintDetails.tsx @@ -188,7 +188,9 @@ export const UnmintDetails: PageComponent = () => { as={BridgeProcessDetailsCard} spacing="4" // @ts-ignore - isProcessCompleted={shouldDisplaySuccessStep} + isProcessCompleted={ + shouldDisplaySuccessStep || shouldForceIsProcessCompleted + } > {_isFetching && } @@ -345,7 +347,7 @@ export const UnmintDetails: PageComponent = () => { ))} - {!shouldDisplaySuccessStep && ( + {!(shouldDisplaySuccessStep || shouldForceIsProcessCompleted) && (