From 70b6ecdf7f244ef51d7dbe7e3095b49dac7db12a Mon Sep 17 00:00:00 2001 From: Nithish Date: Thu, 14 Dec 2023 22:19:26 +0530 Subject: [PATCH 1/9] fixed the submission of sign-in when there were no values --- src/app/pages/onboarding/sign-in/mnemonic-form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx index 594cc3e95e1..56b148ed5d8 100644 --- a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx +++ b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx @@ -96,7 +96,7 @@ export function MnemonicForm({ mnemonic, setMnemonic, twentyFourWordMode }: Mnem Date: Thu, 14 Dec 2023 22:19:26 +0530 Subject: [PATCH 2/9] fixed the submission of sign-in when there were no values --- src/app/pages/onboarding/sign-in/mnemonic-form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx index 594cc3e95e1..56b148ed5d8 100644 --- a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx +++ b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx @@ -96,7 +96,7 @@ export function MnemonicForm({ mnemonic, setMnemonic, twentyFourWordMode }: Mnem Date: Fri, 15 Dec 2023 20:30:02 +0530 Subject: [PATCH 3/9] fixed the submission of sign-in when there were no values --- src/app/pages/onboarding/sign-in/mnemonic-form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx index 56b148ed5d8..594cc3e95e1 100644 --- a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx +++ b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx @@ -96,7 +96,7 @@ export function MnemonicForm({ mnemonic, setMnemonic, twentyFourWordMode }: Mnem Date: Thu, 14 Dec 2023 22:25:53 +0530 Subject: [PATCH 4/9] Revert "feat: modified contracts and balance fetching" This reverts commit 63d29ba39ed228a95da777f41a365fb8e91bf911. --- src/app/common/hooks/use-bitcoin-contracts.ts | 24 ++++++------------- .../bitcoin-contract-list.tsx | 4 ++-- yarn.lock | 2 +- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/app/common/hooks/use-bitcoin-contracts.ts b/src/app/common/hooks/use-bitcoin-contracts.ts index 88355b05eb5..1f434476aaa 100644 --- a/src/app/common/hooks/use-bitcoin-contracts.ts +++ b/src/app/common/hooks/use-bitcoin-contracts.ts @@ -207,27 +207,17 @@ export function useBitcoinContracts() { close(); } - async function getAllActiveBitcoinContracts(): Promise { + async function getAllSignedBitcoinContracts(): Promise { const bitcoinContractInterface = await getBitcoinContractInterface(); if (!bitcoinContractInterface) return; - await bitcoinContractInterface.periodic_check(); const bitcoinContracts = await bitcoinContractInterface.get_contracts(); + const signedBitcoinContracts = bitcoinContracts.filter( + (bitcoinContract: BitcoinContractListItem) => bitcoinContract.state === 'Signed' + ); - const stateOrder = ['Signed', 'Confirmed']; - - const activeBitcoinContracts = bitcoinContracts - .filter( - (bitcoinContract: BitcoinContractListItem) => - bitcoinContract.state === 'Signed' || bitcoinContract.state === 'Confirmed' - ) - .sort( - (a: BitcoinContractListItem, b: BitcoinContractListItem) => - stateOrder.indexOf(a.state) - stateOrder.indexOf(b.state) - ); - - return activeBitcoinContracts; + return signedBitcoinContracts; } function getTransactionDetails(txId: string, bitcoinCollateral: number) { @@ -249,7 +239,7 @@ export function useBitcoinContracts() { async function sumBitcoinContractCollateralAmounts(): Promise { let bitcoinContractsCollateralSum = 0; - const bitcoinContracts = await getAllActiveBitcoinContracts(); + const bitcoinContracts = await getAllSignedBitcoinContracts(); if (!bitcoinContracts) return createMoneyFromDecimal(0, 'BTC'); bitcoinContracts.forEach((bitcoinContract: BitcoinContractListItem) => { @@ -323,7 +313,7 @@ export function useBitcoinContracts() { handleOffer, handleAccept, handleReject, - getAllActiveBitcoinContracts, + getAllSignedBitcoinContracts, sumBitcoinContractCollateralAmounts, sendRpcResponse, }; diff --git a/src/app/pages/bitcoin-contract-list/bitcoin-contract-list.tsx b/src/app/pages/bitcoin-contract-list/bitcoin-contract-list.tsx index 5f8766e5a95..069ff293fa5 100644 --- a/src/app/pages/bitcoin-contract-list/bitcoin-contract-list.tsx +++ b/src/app/pages/bitcoin-contract-list/bitcoin-contract-list.tsx @@ -12,14 +12,14 @@ import { BitcoinContractListItemLayout } from './components/bitcoin-contract-lis import { BitcoinContractListLayout } from './components/bitcoin-contract-list-layout'; export function BitcoinContractList() { - const { getAllActiveBitcoinContracts } = useBitcoinContracts(); + const { getAllSignedBitcoinContracts } = useBitcoinContracts(); const [bitcoinContracts, setBitcoinContracts] = useState([]); const [isLoading, setLoading] = useState(true); const [isError, setError] = useState(false); useOnMount(() => { const fetchAndFormatBitcoinContracts = async () => { - const fetchedBitcoinContracts = await getAllActiveBitcoinContracts(); + const fetchedBitcoinContracts = await getAllSignedBitcoinContracts(); if (!fetchedBitcoinContracts) { setError(true); setLoading(false); diff --git a/yarn.lock b/yarn.lock index b0a8cc32592..4f81fca3296 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12065,7 +12065,7 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== -is-unicode-supported@^1.1.0, is-unicode-supported@^1.2.0: +is-unicode-supported@^1.1.0, is-unicode-supported@^1.2.0, is-unicode-supported@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz#d824984b616c292a2e198207d4a609983842f714" integrity sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ== From 72c316067332ccb0c568b04bcc2fff3d4075059d Mon Sep 17 00:00:00 2001 From: Nithish Date: Fri, 15 Dec 2023 20:49:29 +0530 Subject: [PATCH 5/9] Revert "feat: updated dlc tools version" This reverts commit 8dc1d22f2157d5304a9119c9ea503ca0afd453ef. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3afd8938e89..84d07f18823 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "dependencies": { "@bitcoinerlab/secp256k1": "1.0.2", "@coinbase/cbpay-js": "1.0.2", - "@dlc-link/dlc-tools": "1.1.1", + "@dlc-link/dlc-tools": "1.1.0", "@fungible-systems/zone-file": "2.0.0", "@hirosystems/token-metadata-api-client": "1.1.0", "@ledgerhq/hw-transport-webusb": "6.27.19", diff --git a/yarn.lock b/yarn.lock index 4f81fca3296..bcdeabdc09b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -899,10 +899,10 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@dlc-link/dlc-tools@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@dlc-link/dlc-tools/-/dlc-tools-1.1.1.tgz#01e2351babb70b352247cf8e0e20aac9724c4f35" - integrity sha512-+4RlBjqv3Ws9ndc9dP+SWS/GZ7j18T3TlpzgEblR/WB8pA0FAV2D8Faz+S32m7q6CXFogArZXc/IoyQ+bx3Wtg== +"@dlc-link/dlc-tools@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@dlc-link/dlc-tools/-/dlc-tools-1.1.0.tgz#6d28f139ea971894c11ba182776cf97a35317eeb" + integrity sha512-P4APlS2PaA6pNEh2WFonGspMvO9HJXjmqQNYPeM9p+THUoQQDb8Uq9aTaiN8K/5oS8kqZCetkfdBijtgO9Vi+w== "@dnd-kit/accessibility@^3.1.0": version "3.1.0" From dc2c8f428b4238ab75cf72bb79c343ef6e1ce88d Mon Sep 17 00:00:00 2001 From: Nithish Date: Fri, 15 Dec 2023 20:53:12 +0530 Subject: [PATCH 6/9] Revert "Revert "feat: updated dlc tools version"" This reverts commit 72c316067332ccb0c568b04bcc2fff3d4075059d. --- src/app/pages/onboarding/sign-in/mnemonic-form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx index 594cc3e95e1..56b148ed5d8 100644 --- a/src/app/pages/onboarding/sign-in/mnemonic-form.tsx +++ b/src/app/pages/onboarding/sign-in/mnemonic-form.tsx @@ -96,7 +96,7 @@ export function MnemonicForm({ mnemonic, setMnemonic, twentyFourWordMode }: Mnem Date: Fri, 15 Dec 2023 21:01:34 +0530 Subject: [PATCH 7/9] Revert "Revert "feat: updated dlc tools version"" This reverts commit 72c316067332ccb0c568b04bcc2fff3d4075059d. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84d07f18823..26db783b445 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "dependencies": { "@bitcoinerlab/secp256k1": "1.0.2", "@coinbase/cbpay-js": "1.0.2", - "@dlc-link/dlc-tools": "1.1.0", + "@dlc-link/dlc-tools": "1.0.9", "@fungible-systems/zone-file": "2.0.0", "@hirosystems/token-metadata-api-client": "1.1.0", "@ledgerhq/hw-transport-webusb": "6.27.19", From 0e64afa1e5025cf0377c780068f404806b8abf95 Mon Sep 17 00:00:00 2001 From: Nithish Date: Fri, 15 Dec 2023 21:02:34 +0530 Subject: [PATCH 8/9] remove the unwanted file changes --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index bcdeabdc09b..b804b7214f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -899,10 +899,10 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@dlc-link/dlc-tools@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@dlc-link/dlc-tools/-/dlc-tools-1.1.0.tgz#6d28f139ea971894c11ba182776cf97a35317eeb" - integrity sha512-P4APlS2PaA6pNEh2WFonGspMvO9HJXjmqQNYPeM9p+THUoQQDb8Uq9aTaiN8K/5oS8kqZCetkfdBijtgO9Vi+w== +"dlc-link/dlc-tools@1.0.9": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@dlc-link/dlc-tools/-/dlc-tools-1.0.9.tgz#3dfe1d743e9d5e309732e55c824ffbf77039f2bf" + integrity sha512-+lxe6nrZCbuUWcMR4l9X+axqR1yB7lgtjsrP6Pp23GRqSGL+wvts+L8wSCJxTi6rDhBKfGzvau3SLOPrha/3Rw== "@dnd-kit/accessibility@^3.1.0": version "3.1.0" From 2a856583bdd577456959917402c1041b1b8be85a Mon Sep 17 00:00:00 2001 From: Nithish Date: Fri, 15 Dec 2023 21:05:42 +0530 Subject: [PATCH 9/9] remove the unwanted changes --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index b804b7214f0..ac7dec45539 100644 --- a/yarn.lock +++ b/yarn.lock @@ -899,7 +899,7 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"dlc-link/dlc-tools@1.0.9": +"@dlc-link/dlc-tools@1.0.9": version "1.0.9" resolved "https://registry.yarnpkg.com/@dlc-link/dlc-tools/-/dlc-tools-1.0.9.tgz#3dfe1d743e9d5e309732e55c824ffbf77039f2bf" integrity sha512-+lxe6nrZCbuUWcMR4l9X+axqR1yB7lgtjsrP6Pp23GRqSGL+wvts+L8wSCJxTi6rDhBKfGzvau3SLOPrha/3Rw==