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: CCTX tracking #170

Merged
merged 2 commits into from
Aug 19, 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
10 changes: 5 additions & 5 deletions packages/client/src/trackCCTX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
try {
const url = `${API}/zeta-chain/crosschain/inTxHashToCctx/${hash}`;
Copy link

@juansalvatore juansalvatore Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the url stil the same or should it change to inboundHashToCctx?
mainly because before it matched with the data key we have on line 37

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const apiResponseData = await apiFetch(url);
const res = apiResponseData?.inTxHashToCctx?.cctx_index;
const res = apiResponseData?.inboundHashToCctx?.cctx_index;
res.forEach((hash: any) => {
if (hash && !cctxs[hash] && !spinners[hash]) {
cctxs[hash] = [];
Expand All @@ -47,7 +47,7 @@
} catch (error) {}
};

const fetchCCTXData = async function (

Check warning on line 50 in packages/client/src/trackCCTX.ts

View workflow job for this annotation

GitHub Actions / build

Prefer using arrow functions over plain functions
this: ZetaChainClient,
hash: string,
emitter: any,
Expand All @@ -58,15 +58,15 @@
json: Boolean
) {
const cctx = await getCCTX(hash, API);
const receiver_chainId = cctx?.outbound_tx_params[0]?.receiver_chainId;
const outbound_tx_hash = cctx?.outbound_tx_params[0]?.outbound_tx_hash;
const receiver_chainId = cctx?.outbound_params[0]?.receiver_chainId;
const outbound_tx_hash = cctx?.outbound_params[0]?.outbound_tx_hash;
let confirmed_on_destination = false;
const tx = {
confirmed_on_destination,
outbound_tx_hash,
outbound_tx_tss_nonce: cctx?.outbound_tx_params[0]?.outbound_tx_tss_nonce,
outbound_tx_tss_nonce: cctx?.outbound_params[0]?.outbound_tx_tss_nonce,
receiver_chainId,
sender_chain_id: cctx?.inbound_tx_params?.sender_chain_id,
sender_chain_id: cctx?.outbound_params?.sender_chain_id,
status: cctx?.cctx_status?.status,
status_message: cctx?.cctx_status?.status_message,
};
Expand Down
Loading