Skip to content

docs(rust-client): explain refreshed account state before balance checks#169

Open
trijohntri wants to merge 1 commit into0xMiden:mainfrom
trijohntri:patch-1
Open

docs(rust-client): explain refreshed account state before balance checks#169
trijohntri wants to merge 1 commit into0xMiden:mainfrom
trijohntri:patch-1

Conversation

@trijohntri
Copy link

Current behavior

The tutorial says Alice's wallet balance is updated after consuming notes, but it does not explain that the previously created alice_account variable may still reflect stale in-memory state.
As a result, users may read vault().get_balance(...) from stale data and see Ok(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 AccountRecordData handling and an updated balance print example.

Breaking changes

None.

Other info

Documentation-only update for Rust tutorial clarity.
Linked issue: #114
Closes #114

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.
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.

Explain how client updates account data by asserting on balance

1 participant