docs(rust-client): explain refreshed account state before balance checks#169
Open
trijohntri wants to merge 1 commit into0xMiden:mainfrom
Open
docs(rust-client): explain refreshed account state before balance checks#169trijohntri wants to merge 1 commit into0xMiden:mainfrom
trijohntri wants to merge 1 commit into0xMiden:mainfrom
Conversation
Adds a clarification to the Rust "Mint, Consume, and Create Notes" tutorial about account state refresh after note consumption. The tutorial now explains that the in-memory `alice_account` variable can be stale and demonstrates how to fetch the latest account record from the client store before reading vault balances. This addresses user confusion reported in tutorials issue 0xMiden#114. Documentation-only change; no runtime behavior changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current behavior
The tutorial says Alice's wallet balance is updated after consuming notes, but it does not explain that the previously created
alice_accountvariable may still reflect stale in-memory state.As a result, users may read
vault().get_balance(...)from stale data and seeOk(0).New behavior
The tutorial now explicitly explains that users should re-fetch Alice's account from the client store before checking balances.
A concrete code snippet is added, including
AccountRecordDatahandling and an updated balance print example.Breaking changes
None.
Other info
Documentation-only update for Rust tutorial clarity.
Linked issue: #114
Closes #114