From 6979976770575f3c51a162597f711b738965c37e Mon Sep 17 00:00:00 2001 From: murat <155527010+kejan2514@users.noreply.github.com> Date: Fri, 18 Sep 2026 12:16:00 +0300 Subject: [PATCH] docs: demonstrate retrieving updated account balance --- .../rust-client/mint_consume_create_tutorial.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/src/rust-client/mint_consume_create_tutorial.md b/docs/src/rust-client/mint_consume_create_tutorial.md index 07e2cc2..66b2b17 100644 --- a/docs/src/rust-client/mint_consume_create_tutorial.md +++ b/docs/src/rust-client/mint_consume_create_tutorial.md @@ -114,6 +114,21 @@ println!( "All of Alice's notes consumed successfully. TX: {:?}", tx_id ); + +// `alice_account` was created before the consume transaction. Retrieve Alice +// again from the client before reading state changed by that transaction. +let updated_alice_account = client + .get_account(alice_account.id()) + .await? + .expect("Alice's account should be tracked by the client"); +let updated_balance = updated_alice_account + .vault() + .get_balance(AssetId::new_fungible(faucet_account.id()))?; +assert_eq!( + updated_balance.as_u64(), + 500, + "Alice should hold the five consumed 100-unit notes" +); ``` ## Step 4: Sending tokens to other accounts