fuels-ts
fuels-ts copied to clipboard
Combine similar methods in `BaseInvocationScope`
We currently have multiple dry-run methods within BaseInvocationScope: simulate, dryRun, and get.
We need to validate which methods we are maintaining and which ones we are going to remove.
This is some brainstorm originally posted here:
/*
Call - accepts optional flags
*/
call({ ..., dryRun: boolean, skipUtxoValidation: boolean })
// - Requires Wallet
// - Never use fake UTXOs
// valid calls
call({ ... }) // = default
call({ ..., dryRun: true }) // current simulate
call({ ..., dryRun: true, skipUtxoValidation: true }) // current dryRun
// invalid calls
call({ ..., skipUtxoValidation: true }) // throws error (requires dryRun=true)
call({ ..., dryRun: false, skipUtxoValidation: true }) // throws error (requires dryRun=true)
/*
Get - requires no special flags
*/
get({ ... })
// - Do not require but can receive a Wallet
// - Always use fake UTXOs (accounts for lack of balance)
This could potentially be done together with:
- https://github.com/FuelLabs/fuels-ts/issues/1452