Search code examples
rustscryptoradix-dlt

Radix: How to check token balance in Rust Scrypto test?


I am trying to write a Scrypto test to test my Radix Scrypto smart contract.

in Scrypto 0.9.0, the "balance" method shown below has been removed from the Account Component.

    let manifest = ManifestBuilder::new()
        .call_method(compo_addr, "balance", manifest_args!(resource_addr))
        .build();

How can I check my account(compo_addr) balance of a given token address(resource_addr) ?


Solution

  • let component_balance: Option<Decimal> = test_runner.account_balance(component_address, resource_address);