Skip to content

Commit

Permalink
Perform extra safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanofa committed Jul 3, 2023
1 parent 0bdece4 commit f2cd58e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/Recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,19 @@ async function algo(tx: string, enqueueSnackbar: any) {
if (!confirmedTxInfo) {
throw new Error("Transaction not found or not confirmed");
}
if (!confirmedTxInfo["inner-txns"]) {
throw new Error("Source Tx does not refer to a valid bridge transaction");
}
// transform the object to match the format expected by parseSequenceFromLogAlgorand
confirmedTxInfo["inner-txns"] = confirmedTxInfo["inner-txns"].map(
(txn: any) => ({
logs: [Buffer.from(txn["logs"][0], "base64")],
})
(innerTxn: any) => {
return {
...innerTxn,
logs: innerTxn["logs"]?.[0]
? [Buffer.from(innerTxn["logs"][0], "base64")]
: undefined,
};
}
);
const sequence = parseSequenceFromLogAlgorand(confirmedTxInfo);
if (!sequence) {
Expand Down

0 comments on commit f2cd58e

Please sign in to comment.