Skip to content

Commit

Permalink
Fix the definition of receivedD to avoid reliance on (<>)
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Mar 16, 2023
1 parent 7d4f880 commit 8e55c9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/primitive/lib/Cardano/Wallet/Primitive/Types/UTxO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ excludingD u ins = (du, u `excluding` spent)

-- | Receive additional 'UTxO' / union.
receiveD :: UTxO -> UTxO -> (DeltaUTxO, UTxO)
receiveD a b = (da, a <> b)
where da = DeltaUTxO { excluded = mempty, received = b }
receiveD a b = (da, a <> new)
where
new = b `excluding` dom a
da = DeltaUTxO { excluded = mempty, received = new}

--------------------------------------------------------------------------------
-- Queries
Expand Down

0 comments on commit 8e55c9e

Please sign in to comment.