FuelLabs / FuelLabs/forc

forc call with `--wallet` parameter bugs

Open
#167 9 comments 0 reactions 1 assignee Claimed by @jintukumardas View on GitHub
forc-call good first issue team:tooling
Dominant language
Rust
Stars
0
Forks
0
Avg merge
1d 22h
Merged PRs (30d)
3

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
```sway
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..):
```bash
forc call --abi ./out/release/demo-abi.json $CONTRACT_ADDRESS get_count
```

Failing command (with wallet):
```bash
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.