FuelLabs/forc

forc call with `--wallet` parameter bugs

Ouverte

#167 ouverte le 8 août 2025

 (9 commentaires) (0 réaction) (1 personne assignée)Rust (0 fork)auto 404
forc-callgood first issueteam:tooling

Métriques du dépôt

Stars
 (0 étoile)
Métriques de merge PR
 (Métriques PR en attente)

Description

Description

forc call with --wallet parameter fails because the wallet has no base assets (0 balance), even for read-only function calls.

Steps to Reproduce

  1. Deploy a minimal Sway contract
  2. Run forc call without --wallet - works
  3. Run forc call with --wallet - fails

Example Contract

contract;

abi Demo {
    fn get_count() -> u64;
}

impl Demo for Contract {
    fn get_count() -> u64 {
        5
    }
}

Commands

Working command (without wallet - uses default signer - which has funds..):

forc call --abi ./out/release/demo-abi.json $CONTRACT_ADDRESS get_count

Failing command (with wallet):

forc call --abi ./out/release/demo-abi.json $CONTRACT_ADDRESS get_count --wallet

Error Output

thread 'main' panicked at /Users/runner/work/sway/sway/forc-plugins/forc-client/src/op/call/missing_contracts.rs:32:10:
Failed to build transaction: Provider("failed to adjust inputs to cover for missing base asset: failed to get base asset (f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07) inputs with amount: `1`: io error: Response errors; the target cannot be met due to insufficient coins available for f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07. Collected: 0.")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behaviour

  • The wallet parameter should not error/panic in the default dry-run mode - since funds are not required for read-only function calls.
  • Error message update: The current error is cryptic. It should clearly state: "Wallet has insufficient funds. Please fund your wallet with base asset ()."
    • This is for simulation and/or live-mode - where user funds should be taken into account.

Guide contributeur