File tree 4 files changed +4
-10
lines changed
4 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -351,7 +351,6 @@ library
351
351
build-depends :
352
352
, Decimal >= 0.4.2
353
353
, aeson >= 2.2
354
- , aeson-pretty >= 0.8
355
354
, asn1-encoding >= 0.9
356
355
, asn1-types >= 0.3
357
356
, async >= 2.2
Original file line number Diff line number Diff line change @@ -812,7 +812,7 @@ execReadOnlyReplay lowerBound maybeUpperBound = pactLabel "execReadOnlyReplay" $
812
812
let
813
813
printValidationError (BlockValidationFailure (BlockValidationFailureMsg m)) = do
814
814
writeIORef validationFailedRef True
815
- logFunctionText logger Error m
815
+ logFunctionText logger Error ( J. getJsonText m)
816
816
printValidationError e = throwM e
817
817
handleMissingBlock NoHistory = throwM $ BlockHeaderLookupFailure $
818
818
" execReadOnlyReplay: missing block: " <> sshow bh
@@ -831,7 +831,7 @@ execReadOnlyReplay lowerBound maybeUpperBound = pactLabel "execReadOnlyReplay" $
831
831
)
832
832
validationFailed <- readIORef validationFailedRef
833
833
when validationFailed $
834
- throwM $ BlockValidationFailure $ BlockValidationFailureMsg " Prior block validation errors"
834
+ throwM $ BlockValidationFailure $ BlockValidationFailureMsg $ J. encodeJsonText ( " Prior block validation errors" :: Text )
835
835
return r
836
836
837
837
heightProgress :: BlockHeight -> BlockHeight -> IORef BlockHeight -> (Text -> IO () ) -> IO ()
Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ import Control.Monad.Reader
44
44
import Control.Monad.State.Strict
45
45
46
46
import qualified Data.Aeson as A
47
- import qualified Data.Aeson.Encode.Pretty as A
48
47
import qualified Data.ByteString.Short as SB
49
48
import qualified Data.ByteString.Lazy as BL
50
49
import Data.Decimal
@@ -565,16 +564,12 @@ validateHashes bHeader payload miner transactions =
565
564
if newHash == prevHash
566
565
then Right actualPwo
567
566
else Left $ BlockValidationFailure $ BlockValidationFailureMsg $
568
- prettyJson $ J. encodeText $ J. object
567
+ J. encodeJsonText $ J. object
569
568
[ " header" J. .= J. encodeWithAeson (ObjectEncoded bHeader)
570
569
, " mismatch" J. .= errorMsg " Payload hash" prevHash newHash
571
570
, " details" J. .= difference
572
571
]
573
572
where
574
- prettyJson txt = case A. eitherDecodeStrict @ A. Value (T. encodeUtf8 txt) of
575
- Right obj -> T. cons ' \n ' $ T. decodeUtf8 $ BL. toStrict $ A. encodePretty obj
576
- Left err -> error $ " validateHashes: impossible JSON decode failure: " <> show err
577
-
578
573
actualPwo = toPayloadWithOutputs miner transactions
579
574
580
575
newHash = _payloadWithOutputsPayloadHash actualPwo
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ data LocalPreflightSimulation
213
213
| LegacySimulation
214
214
deriving stock (Eq , Show , Generic )
215
215
216
- newtype BlockValidationFailureMsg = BlockValidationFailureMsg Text
216
+ newtype BlockValidationFailureMsg = BlockValidationFailureMsg J. JsonText
217
217
deriving (Eq , Ord , Generic )
218
218
deriving newtype (J.Encode )
219
219
You can’t perform that action at this time.
0 commit comments