Currently, when the CoinsToSpend query cannot find enough coins it returns an error:
#[error("the target cannot be met due to no coins available or exceeding the {max} coin limit.")]
InsufficientCoinsForTheMax {
asset_id: AssetId,
collected_amount: u128,
max: u16,
},
The new behavior should be:
- add new field to the query, for example:
allow_partial: bool. If this field is set to true, then:
- do not return an error
- return coins that we were able to find even if they do not satisfy the query
Definition of Done:
InsufficientCoinsForTheMax error is never thrown (from both indexed and non-indexed coins to spend algorithm implementations) if the new flag is set
- Tests are updated to cover system behavior with this new flag
- Indexation documentation is updated: https://www.notion.so/fuellabs/Indexation-1932f2293f31806b87c1ef8160d3acd7