Summary
After minting tokens to an account using MockToken::mint(), calling account.token_balance(&token) returns 0 instead of the minted amount. The balance is only visible through token.balance(&account.address()).
Steps to Reproduce
let env = MockEnv::builder()
.with_account("alice", Stroops::xlm(1_000))
.build();
let usdc = MockToken::new(&env, "USDC", 6);
let alice = env.account("alice");
usdc.mint(&alice.address(), 5_000_000);
// Bug: returns 0
let balance = alice.token_balance(&usdc);
assert_eq!(balance, 5_000_000); // FAILS
// Workaround: query directly on token
let balance2 = usdc.balance(&alice.address());
assert_eq!(balance2, 5_000_000); // passes
Root Cause (Hypothesis)
AccountHandle::token_balance may hold a stale reference or query the wrong storage key. Needs investigation in builders.rs.
Acceptance Criteria
Summary
After minting tokens to an account using
MockToken::mint(), callingaccount.token_balance(&token)returns0instead of the minted amount. The balance is only visible throughtoken.balance(&account.address()).Steps to Reproduce
Root Cause (Hypothesis)
AccountHandle::token_balancemay hold a stale reference or query the wrong storage key. Needs investigation inbuilders.rs.Acceptance Criteria
AccountHandle::token_balance(&token)returns live balance