Skip to content

Commit

Permalink
fixup! Add QueryAllBurn and QueryBurnByAssetId
Browse files Browse the repository at this point in the history
Use LambdaCase
  • Loading branch information
eyeinsky committed May 30, 2023
1 parent 8c7e260 commit 05e414e
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -333,8 +333,9 @@ instance RI.Queryable MintBurnHandle where
-- * Filter in-memory events

upToSlot :: Maybe C.SlotNo -> [TxMintRow -> Bool]
upToSlot maybeSlotNo =
maybe [] (\slotNo -> [\row -> _txMintRowSlotNo row <= slotNo]) maybeSlotNo
upToSlot = \case
Just slotNo -> [\row -> _txMintRowSlotNo row <= slotNo]
Nothing -> []

matchesAssetId :: C.PolicyId -> C.AssetName -> TxMintRow -> Bool
matchesAssetId policyId assetName row =
Expand Down Expand Up @@ -374,7 +375,7 @@ instance RI.Queryable MintBurnHandle where
)

mkUpperBoundCondition :: Maybe C.SlotNo -> ([SQL.Query], [NamedParam])
mkUpperBoundCondition maybeUpperBound = case maybeUpperBound of
mkUpperBoundCondition = \case
Nothing -> ([], [])
Just s -> (["slotNo <= :slotNo"] , [":slotNo" := s])

Expand Down

0 comments on commit 05e414e

Please sign in to comment.