Skip to content

Commit

Permalink
fix: L2 to L1 tutorial - check the proof output (#57)
Browse files Browse the repository at this point in the history
# Description

Actually verify the proof inclusion response and print it to the console
in the tutorial.

(before, if the proof was not correct - the script still finished
successfully without any warning)
  • Loading branch information
mm-zk authored Sep 3, 2024
1 parent 3398dae commit 0e19659
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion content/tutorials/how-to-send-l2-l1-message/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,13 @@ Create a `4.prove-inclusion.ts` file in the root directory with the next script:
// The full proof object, including root, proof and id
const PROOF = {};
proveL2MessageInclusion(L1_BATCH_NUMBER, PROOF, L1_BATCH_TX_INDEX, SENDER, MESSAGE);
proveL2MessageInclusion(L1_BATCH_NUMBER, PROOF, L1_BATCH_TX_INDEX, SENDER, MESSAGE).then(result => {
if (result == true) {
console.log("\x1b[32mThe proof is valid\x1b[0m");
} else {
console.log("\x1b[31mThe proof is not valid\x1b[0m");
}
});
} catch (error) {
console.error(error);
}
Expand Down

0 comments on commit 0e19659

Please sign in to comment.