FuelLabs/fuels-ts · warning · FuelError
INVALID_INPUT_PARAMETERS
INVALID_INPUT_PARAMETERS
Error message
Number of wallets must be greater than zero.
What it means
Thrown by `WalletsConfig.validate()` (test-utils) when the `count` (wallets) option is an empty array or a number <= 0. The test wallet launcher needs at least one wallet to seed, so it rejects a non-positive count before generating any test fixtures.
Source
Thrown at packages/account/src/test-utils/wallet-config.ts:151
});
}
});
});
return coins;
}
private static validate({
count: wallets,
assets,
coinsPerAsset,
amountPerCoin,
}: WalletsConfigOptions) {
if (
(Array.isArray(wallets) && wallets.length === 0) ||
(typeof wallets === 'number' && wallets <= 0)
) {
throw new FuelError(
FuelError.CODES.INVALID_INPUT_PARAMETERS,
'Number of wallets must be greater than zero.'
);
}
if (
(Array.isArray(assets) && assets.length === 0) ||
(typeof assets === 'number' && assets <= 0)
) {
throw new FuelError(
FuelError.CODES.INVALID_INPUT_PARAMETERS,
'Number of assets per wallet must be greater than zero.'
);
}
if (coinsPerAsset <= 0) {
throw new FuelError(
FuelError.CODES.INVALID_INPUT_PARAMETERS,
'Number of coins per asset must be greater than zero.'
);View on GitHub (pinned to b3f37c91ac)
Solutions
- Set `wallets` to a positive number or a non-empty array in your WalletsConfig.
- Guard the caller to skip setup entirely when the computed count is 0.
- Add an assertion in your test bootstrap before launching the node.
Example fix
// before
await launchTestNode({ walletsConfig: { count: 0, coinsPerAsset: 1, amountPerCoin: 100 } });
// after
await launchTestNode({ walletsConfig: { count: 2, coinsPerAsset: 1, amountPerCoin: 100 } }); Defensive patterns
Strategy: validation
Validate before calling
function walletCount(v: number | unknown[]): number { return Array.isArray(v) ? v.length : v; }
if (walletCount(config.count) <= 0) throw new Error('wallets must be > 0'); Type guard
null
Try / catch
null
Prevention
- Set count to a positive number or non-empty array.
- Skip test setup entirely when computed count is 0.
- Assert bootstrap config before launchTestNode.
When it happens
Trigger: Calling `launchTestNode` (or directly constructing a `WalletsConfig`) with `wallets: 0`, `wallets: -1`, or `wallets: []`. The validate check at wallet-config.ts:147 fires.
Common situations: Parameterizing a test setup from a config where the wallet count defaulted to 0; refactoring a test suite and forgetting to set the count; dynamically computing wallet count from a list that came back empty.
Related errors
AI-assisted analysis of FuelLabs/fuels-ts@b3f37c91ac (2026-08-12).
Data as JSON: /api/errors/68ac9c0b1c562525.
Report an issue: GitHub.