Fix signalling tx not found on network error

This commit is contained in:
Willian Mitsuda 2022-01-24 16:36:16 -03:00
parent e62068c65a
commit f138444eee
1 changed files with 98 additions and 89 deletions

View File

@ -191,6 +191,7 @@ export const useTxData = (
}
const readTxData = async () => {
try {
const [_response, _receipt] = await Promise.all([
provider.getTransaction(txhash),
provider.getTransactionReceipt(txhash),
@ -246,7 +247,10 @@ export const useTxData = (
};
} catch (err) {
tokenMetas[t.token] = null;
console.warn(`Couldn't get token ${t.token} metadata; ignoring`, err);
console.warn(
`Couldn't get token ${t.token} metadata; ignoring`,
err
);
}
}
@ -282,7 +286,12 @@ export const useTxData = (
logs: _receipt.logs,
},
});
} catch (err) {
console.error(err);
setTxData(null);
}
};
readTxData();
}, [provider, txhash]);