fuels-ts icon indicating copy to clipboard operation
fuels-ts copied to clipboard

Combine similar methods in `BaseInvocationScope`

Open Torres-ssf opened this issue 1 year ago • 1 comments

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)

Torres-ssf avatar Mar 12 '24 14:03 Torres-ssf

This could potentially be done together with:

  • https://github.com/FuelLabs/fuels-ts/issues/1452

arboleya avatar Mar 13 '24 12:03 arboleya