@@ -4,10 +4,9 @@ import Prelude
44
55import Cardano.Kupmios.Ogmios.Types
66 ( OgmiosDecodeError (InvalidRpcResponse)
7- , OgmiosTxEvaluationR
87 , decodeOgmios
98 )
10- import Cardano.Provider.TxEvaluation
9+ import Cardano.Provider
1110 ( ExecutionUnits
1211 , RedeemerPointer
1312 , TxEvaluationFailure (UnparsedError, ScriptFailures)
@@ -21,7 +20,6 @@ import Data.Argonaut.Decode.Error (JsonDecodeError(TypeMismatch))
2120import Data.Either (Either (Left, Right))
2221import Data.Map as Map
2322import Data.Maybe (fromJust )
24- import Data.Newtype (unwrap )
2523import Data.Tuple.Nested (type (/\), (/\))
2624import Effect.Aff (Aff )
2725import Effect.Class (liftEffect )
@@ -42,7 +40,7 @@ suite = do
4240 group " Decoding EvaluateTx response" do
4341 test " Successfully decodes a valid response" do
4442 txEvalR :: Either OgmiosDecodeError TxEvaluationR <-
45- (map (\(r :: OgmiosTxEvaluationR ) -> unwrap r) <<< decodeOgmios) <$>
43+ decodeOgmios <$>
4644 liftEffect
4745 ogmiosEvaluateTxValidRespFixture
4846 txEvalR `shouldSatisfy` case _ of
@@ -55,8 +53,7 @@ suite = do
5553 body <- liftEffect ogmiosEvaluateTxInvalidPointerFormatFixture
5654 let
5755 (txEvalR :: Either OgmiosDecodeError TxEvaluationR ) =
58- (map (\(r :: OgmiosTxEvaluationR ) -> unwrap r) <<< decodeOgmios)
59- body
56+ decodeOgmios body
6057 txEvalR `shouldSatisfy` case _ of
6158 Left (InvalidRpcResponse (TypeMismatch errMsg)) -> errMsg ==
6259 " Expected redeemer to be one of: (spend|mint|publish|withdraw|vote|propose)"
@@ -65,7 +62,7 @@ suite = do
6562 test " Successfully decodes a failed execution response (Incompatible era)"
6663 do
6764 txEvalR :: Either OgmiosDecodeError TxEvaluationR <-
68- (map (\(r :: OgmiosTxEvaluationR ) -> unwrap r) <<< decodeOgmios) <$>
65+ decodeOgmios <$>
6966 liftEffect
7067 ogmiosEvaluateTxFailIncompatibleEraFixture
7168 txEvalR `shouldSatisfy` case _ of
@@ -74,7 +71,7 @@ suite = do
7471
7572 test " Successfully decodes a failed execution response (Script errors)" do
7673 txEvalR :: Either OgmiosDecodeError TxEvaluationR <-
77- (map (\(r :: OgmiosTxEvaluationR ) -> unwrap r) <<< decodeOgmios) <$>
74+ decodeOgmios <$>
7875 liftEffect
7976 ogmiosEvaluateTxFailScriptErrorsFixture
8077 txEvalR `shouldSatisfy` case _ of
0 commit comments