Skip to content

fix(rust-client): wait for the final note-consume tx to commit in the custom-note and MASM-note tutorials#208

Merged
BrianSeong99 merged 1 commit into
mainfrom
kbg/fix/wait-final-consume-commit
Jul 11, 2026
Merged

fix(rust-client): wait for the final note-consume tx to commit in the custom-note and MASM-note tutorials#208
BrianSeong99 merged 1 commit into
mainfrom
kbg/fix/wait-final-consume-commit

Conversation

@Keinberger

Copy link
Copy Markdown
Collaborator

Overview

Two of the note tutorials submit their final "Bob consumes the note" transaction and then immediately print a MidenScan link and exit, without confirming the transaction committed. Every earlier step in the same files already waits for commitment, so the final and most important step was the only unconfirmed one, and the printed happy-path output could show a link for a transaction that had not actually landed yet.

This PR makes both tutorials wait for the final consume to commit before exiting.

Key Changes

  • rust-client/src/bin/hash_preimage_note.rs: call the file's existing wait_for_tx helper on the final consume transaction (one line).
  • rust-client/src/bin/note_creation_in_masm.rs: this file had no wait_for_tx helper, so I ported it verbatim from hash_preimage_note.rs and added the imports it needs (store::TransactionFilter, TransactionId, TransactionStatus), then call it on the final consume.
  • Both doc pages (custom_note_how_to.md, creating_notes_in_masm_tutorial.md): mirrored the code change inside the rust no_run block and regenerated the expected-output transcript from a real run. Regenerating also cleaned up some pre-existing staleness: the custom-note transcript had an old note found STEP-2 poll, a fabricated account delta line, and RpoDigest where the binary now prints Word; the MASM-note transcript was truncated mid-line.

Rationale

Correctness was never the issue here: these are local transactions, so a wrong secret or a broken note script already fails at proving and errors out. This is a robustness and output-honesty fix, so the tutorial's final line reflects a note that actually got consumed on-chain, matching how the rest of each file already behaves.

Tests

Ran both binaries against testnet: each now prints ✅ transaction <id> committed at STEP 4 and exits 0. cargo test --doc (17 passed, 0 failed) and prettier --check are green.

@Keinberger

Copy link
Copy Markdown
Collaborator Author

@brianseong could you give this one a review when you get a chance? 🙏

@Keinberger Keinberger requested a review from BrianSeong99 July 10, 2026 12:20

@BrianSeong99 BrianSeong99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved 👍

@BrianSeong99 BrianSeong99 merged commit 59a8b73 into main Jul 11, 2026
6 checks passed
@BrianSeong99 BrianSeong99 deleted the kbg/fix/wait-final-consume-commit branch July 11, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants