Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit fd46ef6

Browse files
committed
[CDEC-403] Remove partial field accessors from ValidationResult
1 parent 6e1f307 commit fd46ef6

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

wallet-new/test/unit/Test/Spec/Translation.hs

+21-15
Original file line numberDiff line numberDiff line change
@@ -292,17 +292,17 @@ data ValidationResult h a =
292292
ExpectedValid
293293

294294
-- | We expected the chain to be invalid; DSL and Cardano both agree
295-
| ExpectedInvalid {
296-
validationErrorDsl :: Text
297-
, validationErrorCardano :: Cardano.VerifyBlocksException
298-
}
295+
-- ExpectedInvalid
296+
-- validationErrorDsl
297+
-- validationErrorCardano
298+
| ExpectedInvalid !Text !Cardano.VerifyBlocksException
299299

300300
-- | Variation on 'ExpectedInvalid', where we cannot even /construct/
301301
-- the Cardano chain, much less validate it.
302-
| ExpectedInvalid' {
303-
validationErrorDsl :: Text
304-
, validationErrorInt :: IntException
305-
}
302+
-- ExpectedInvalid
303+
-- validationErrorDsl
304+
-- validationErrorInt
305+
| ExpectedInvalid' !Text !IntException
306306

307307
-- | Disagreement between the DSL and Cardano
308308
--
@@ -315,10 +315,10 @@ data ValidationResult h a =
315315
--
316316
-- We record the error message from Cardano, if Cardano thought the chain
317317
-- was invalid, as well as the ledger that causes the problem.
318-
| Disagreement {
319-
validationLedger :: Ledger h a
320-
, validationDisagreement :: Disagreement h a
321-
}
318+
-- Disagreement
319+
-- validationLedger
320+
-- validationDisagreement
321+
| Disagreement !(Ledger h a) !(Disagreement h a)
322322

323323
-- | Disagreement between Cardano and the DSL
324324
--
@@ -357,23 +357,29 @@ expectInvalid _otherwise = False
357357

358358
instance (Hash h a, Buildable a) => Buildable (ValidationResult h a) where
359359
build ExpectedValid = "ExpectedValid"
360-
build ExpectedInvalid{..} = bprint
360+
build (ExpectedInvalid
361+
validationErrorDsl
362+
validationErrorCardano) = bprint
361363
( "ExpectedInvalid"
362364
% ", errorDsl: " % build
363365
% ", errorCardano: " % build
364366
% "}"
365367
)
366368
validationErrorDsl
367369
validationErrorCardano
368-
build ExpectedInvalid'{..} = bprint
370+
build (ExpectedInvalid'
371+
validationErrorDsl
372+
validationErrorInt) = bprint
369373
( "ExpectedInvalid'"
370374
% ", errorDsl: " % build
371375
% ", errorInt: " % build
372376
% "}"
373377
)
374378
validationErrorDsl
375379
validationErrorInt
376-
build Disagreement{..} = bprint
380+
build (Disagreement
381+
validationLedger
382+
validationDisagreement) = bprint
377383
( "Disagreement "
378384
% "{ ledger: " % build
379385
% ", disagreement: " % build

0 commit comments

Comments
 (0)