Skip to content

Commit

Permalink
Fix CCTX tracking if the destination chain is Bitcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Nov 8, 2023
1 parent 1ae3b53 commit 48e85c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions helpers/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ const fetchCCTXData = async (
let confirmed_on_destination = false;
if (outbound_tx_hash) {
const chainName = findByChainId(networks, parseInt(receiver_chainId));
const rpc = getEndpoints("evm", chainName as any)[0]?.url;
const provider = new ethers.providers.JsonRpcProvider(rpc);
const confirmed = await provider.getTransaction(outbound_tx_hash);
confirmed_on_destination = confirmed !== null;
if (chainName) {
const rpc = getEndpoints("evm", chainName as any)[0]?.url;
const provider = new ethers.providers.JsonRpcProvider(rpc);
const confirmed = await provider.getTransaction(outbound_tx_hash);
confirmed_on_destination = confirmed !== null;
}
}
const tx = {
confirmed_on_destination,
Expand Down

0 comments on commit 48e85c2

Please sign in to comment.