Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update url to testnet #49

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/hooks/use-confirmation-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
txID: string | undefined,
vaultState: VaultState | undefined
): number {
const bitcoinExplorerTXURL = `https://devnet.dlc.link/electrs/tx/${txID}`;
const bitcoinExplorerHeightURL = `https://devnet.dlc.link/electrs/blocks/tip/height`;
const bitcoinExplorerTXURL = `https://testnet.dlc.link/electrs/tx/${txID}`;
const bitcoinExplorerHeightURL = `https://testnet.dlc.link/electrs/blocks/tip/height`;
const fetchInterval = useRef<number | undefined>(undefined);

const [transactionProgress, setTransactionProgress] = useState(0);
Expand All @@ -27,7 +27,7 @@
});
bitcoinCurrentBlockHeight = await response.json();
} catch (error) {
console.error(error);

Check warning on line 30 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

Unexpected console statement
}

let bitcoinTransactionBlockHeight;
Expand All @@ -39,7 +39,7 @@
const bitcoinTransactionDetails = await response.json();
bitcoinTransactionBlockHeight = bitcoinTransactionDetails.status.block_height;
} catch (error) {
console.error(error);

Check warning on line 42 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

Unexpected console statement
}

const difference = bitcoinCurrentBlockHeight - bitcoinTransactionBlockHeight;
Expand All @@ -51,12 +51,12 @@
}
};

fetchTransactionDetails();

Check warning on line 54 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

useEffect(() => {
fetchInterval.current = setInterval(fetchTransactionDetails, 10000) as unknown as number; // Cleanup the interval when the component unmounts
return () => clearInterval(fetchInterval.current);
}, [vaultState, txID]);

Check warning on line 59 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

React Hook useEffect has a missing dependency: 'fetchTransactionDetails'. Either include it or remove the dependency array

return memoizedTransactionProgress;
}
Loading