@@ -79,7 +79,6 @@ import Cardano.Api.Parser.Text qualified as P
7979import Cardano.Api.Plutus.Internal.Script
8080import Cardano.Api.Serialise.Raw
8181import Cardano.Api.Serialise.SerialiseUsing
82- import Cardano.Api.Tx.Internal.Body.Lens qualified as A
8382
8483import Cardano.Chain.Common qualified as Byron
8584import Cardano.Ledger.Allegra.Core qualified as L
@@ -88,6 +87,7 @@ import Cardano.Ledger.Mary.TxOut as Mary (scaledMinDeposit)
8887import Cardano.Ledger.Mary.Value (MaryValue (.. ))
8988import Cardano.Ledger.Mary.Value qualified as L
9089import Cardano.Ledger.Mary.Value qualified as Mary
90+ import Cardano.Ledger.Val qualified as L
9191
9292import Data.Aeson (FromJSON , FromJSONKey , ToJSON , object , parseJSON , toJSON , withObject )
9393import Data.Aeson qualified as Aeson
@@ -99,8 +99,6 @@ import Data.ByteString (ByteString)
9999import Data.ByteString qualified as BS
100100import Data.ByteString.Short qualified as Short
101101import Data.Data (Data )
102- import Data.Function ((&) )
103- import Data.Group (invert )
104102import Data.List qualified as List
105103import Data.Map.Merge.Strict qualified as Map
106104import Data.Map.Strict (Map )
@@ -109,7 +107,6 @@ import Data.MonoTraversable
109107import Data.Text (Text )
110108import Data.Text qualified as Text
111109import GHC.Exts (IsList (.. ))
112- import Lens.Micro ((%~) )
113110
114111toByronLovelace :: Lovelace -> Maybe Byron. Lovelace
115112toByronLovelace (L. Coin x) =
@@ -295,11 +292,7 @@ negateValue (Value m) = Value (Map.map negate m)
295292
296293negateLedgerValue
297294 :: ShelleyBasedEra era -> L. Value (ShelleyLedgerEra era ) -> L. Value (ShelleyLedgerEra era )
298- negateLedgerValue sbe v =
299- caseShelleyToAllegraOrMaryEraOnwards
300- (\ _ -> v & A. adaAssetL sbe %~ L. Coin . negate . L. unCoin)
301- (\ w -> v & A. multiAssetL w %~ invert)
302- sbe
295+ negateLedgerValue sbe v = shelleyBasedEraConstraints sbe $ L. invert v
303296
304297filterValue :: (AssetId -> Bool ) -> Value -> Value
305298filterValue p (Value m) = Value (Map. filterWithKey (\ k _v -> p k) m)
0 commit comments