use NonEmpty for all arguments to Queries methods where empty lists don't work #11155
Labels
component/json-api
HTTP JSON API
gardening
Cleanup code, improve tests, better automation, upgrade deps, fix flaky tests, address TODOs, etc.
good first issue
Good for newcomers
team/ledger-clients
Related to the Ledger Clients team's components.
wip-issue
This issue is being worked on. Use draft PRs for work in progress PRs.
There are several functions like
selectContractsMultiTemplate
inQueries
that will always fail if given an empty input of e.g. template/predicate pairs. Currently this isn't apparent from the signature, but it hasn't been changed because the callers inContractDao
aren't trivial.We should just percolate the
NonEmpty
requirement viaNonEmpty
types all the way back to where we parse client arguments from JSON. This might entail extending the method enrichments inNonEmpty
(e.g.map
is a major missing methodmap
now exists 🎉 ), or adding overrides to theFoldable1
instance therein (also done in #11592), and of course eliminating any needless code where we handle an impossible empty-data case, starting with where we make these assertions inQueries
in the first place.With respect to #11156, any party sets should use
NonEmpty
too, even though the current examples useOneAnd
.The text was updated successfully, but these errors were encountered: