Skip to content

Commit a5ef8e4

Browse files
committed
style: remove commented-out deriveEq calls for AssocMap types
Replace commented-out deriveEq code with plain comments explaining why PlutusTx.Eq instances are absent, addressing review feedback.
1 parent 3e62cd2 commit a5ef8e4

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

plutus-ledger-api/src/PlutusLedgerApi/V2/Contexts.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ Since TxInfo contains Map fields (which use AssocMap internally), we cannot deri
119119
PlutusTx.Eq for it. This affects V2 onwards where assoc lists were changed to Maps.
120120
-}
121121

122-
-- See Note [No PlutusTx.Eq for types with AssocMap]
123-
-- deriveEq ''TxInfo
122+
-- No PlutusTx.Eq instance, see Note [No PlutusTx.Eq for types with AssocMap]
124123

125124
instance Pretty TxInfo where
126125
pretty TxInfo {txInfoInputs, txInfoReferenceInputs, txInfoOutputs, txInfoFee, txInfoMint, txInfoDCert, txInfoWdrl, txInfoValidRange, txInfoSignatories, txInfoRedeemers, txInfoData, txInfoId} =
@@ -148,8 +147,7 @@ data ScriptContext = ScriptContext
148147
}
149148
deriving stock (Generic, Haskell.Eq, Haskell.Show)
150149

151-
-- See Note [No PlutusTx.Eq for types with AssocMap]
152-
-- deriveEq ''ScriptContext
150+
-- No PlutusTx.Eq instance, see Note [No PlutusTx.Eq for types with AssocMap]
153151

154152
instance Pretty ScriptContext where
155153
pretty ScriptContext {scriptContextTxInfo, scriptContextPurpose} =

plutus-ledger-api/src/PlutusLedgerApi/V3/Contexts.hs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ data GovernanceAction
360360
deriving anyclass (HasBlueprintDefinition)
361361
deriving (Pretty) via (PrettyShow GovernanceAction)
362362

363-
-- See Note [No PlutusTx.Eq for types with AssocMap]
364-
-- PlutusTx.deriveEq ''GovernanceAction
363+
-- No PlutusTx.Eq instance, see Note [No PlutusTx.Eq for types with AssocMap]
365364

366365
-- | A proposal procedure. The optional anchor is omitted.
367366
data ProposalProcedure = ProposalProcedure
@@ -372,8 +371,7 @@ data ProposalProcedure = ProposalProcedure
372371
deriving stock (Generic, Haskell.Show, Haskell.Eq, Haskell.Ord)
373372
deriving anyclass (HasBlueprintDefinition)
374373

375-
-- See Note [No PlutusTx.Eq for types with AssocMap]
376-
-- PlutusTx.deriveEq ''ProposalProcedure
374+
-- No PlutusTx.Eq instance, see Note [No PlutusTx.Eq for types with AssocMap]
377375

378376
instance Pretty ProposalProcedure where
379377
pretty ProposalProcedure {..} =
@@ -459,8 +457,7 @@ data TxInfo = TxInfo
459457
deriving stock (Generic, Haskell.Show, Haskell.Eq)
460458
deriving anyclass (HasBlueprintDefinition)
461459

462-
-- See Note [No PlutusTx.Eq for types with AssocMap]
463-
-- PlutusTx.deriveEq ''TxInfo
460+
-- No PlutusTx.Eq instance, see Note [No PlutusTx.Eq for types with AssocMap]
464461

465462
instance Pretty TxInfo where
466463
pretty TxInfo {..} =
@@ -496,8 +493,7 @@ data ScriptContext = ScriptContext
496493
deriving stock (Generic, Haskell.Eq, Haskell.Show)
497494
deriving anyclass (HasBlueprintDefinition)
498495

499-
-- See Note [No PlutusTx.Eq for types with AssocMap]
500-
-- PlutusTx.deriveEq ''ScriptContext
496+
-- No PlutusTx.Eq instance, see Note [No PlutusTx.Eq for types with AssocMap]
501497

502498
instance Pretty ScriptContext where
503499
pretty ScriptContext {..} =

0 commit comments

Comments
 (0)