Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Next

* `utxosAtAddresses` doesn't throw error when querying for empty addresses list against Maestro provider.

## 0.14.1

* Added `utxosWithAsset` for efficiently querying of UTxOs containing a specified asset.
Expand Down
7 changes: 6 additions & 1 deletion src/GeniusYield/Providers/Maestro.hs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@ maestroUtxosAtAddresses :: Maestro.MaestroEnv 'Maestro.V1 -> [GYAddress] -> IO G
maestroUtxosAtAddresses env addrs = do
let addrsInText = map addressToText addrs
-- Here one would not get `MaestroNotFound` error.
addrUtxos <- handleMaestroError locationIdent <=< try $ Maestro.allPages (flip (Maestro.utxosAtMultiAddresses env (Just False) (Just False)) $ coerce addrsInText)
addrUtxos <-
if null addrs
then
pure []
else
handleMaestroError locationIdent <=< try $ Maestro.allPages (flip (Maestro.utxosAtMultiAddresses env (Just False) (Just False)) $ coerce addrsInText)

either (throwIO . MspvDeserializeFailure locationIdent) (pure . utxosFromList) (traverse utxoFromMaestro addrUtxos)
where
Expand Down
Loading