@@ -31,12 +31,9 @@ module Ctl.Internal.QueryM.Ogmios.Types
3131 , SubmitTxR (SubmitTxSuccess , SubmitFail )
3232 , StakePoolsQueryArgument (StakePoolsQueryArgument )
3333 , OgmiosTxEvaluationR (OgmiosTxEvaluationR )
34- , aesonObject
3534 , submitSuccessPartialResp
3635 , parseIpv6String
3736 , rationalToSubcoin
38- , aesonNull
39- , aesonString
4037 ) where
4138
4239import Prelude
@@ -46,9 +43,6 @@ import Aeson
4643 , class EncodeAeson
4744 , Aeson
4845 , JsonDecodeError (TypeMismatch, MissingValue, AtKey)
49- , caseAesonArray
50- , caseAesonNull
51- , caseAesonObject
5246 , caseAesonString
5347 , decodeAeson
5448 , encodeAeson
@@ -141,6 +135,7 @@ import Cardano.Types.Value (Value, getMultiAsset, valueToCoin)
141135import Control.Alt ((<|>))
142136import Control.Alternative (guard )
143137import Ctl.Internal.Helpers (encodeMap , showWithParens )
138+ import Ctl.Internal.Service.Helpers (aesonArray , aesonObject , aesonString )
144139import Ctl.Internal.Types.ProtocolParameters
145140 ( ProtocolParameters (ProtocolParameters)
146141 )
@@ -990,37 +985,6 @@ instance EncodeAeson AdditionalUtxoSet where
990985 (\m' (k /\ v) -> Map .insert (f k) v m')
991986 Map .empty
992987
993- -- helper for assuming we get an object
994- aesonObject
995- :: forall (a :: Type )
996- . (Object Aeson -> Either JsonDecodeError a )
997- -> Aeson
998- -> Either JsonDecodeError a
999- aesonObject = caseAesonObject (Left (TypeMismatch " Expected Object" ))
1000-
1001- -- helper for assuming we get an array
1002- aesonArray
1003- :: forall (a :: Type )
1004- . (Array Aeson -> Either JsonDecodeError a )
1005- -> Aeson
1006- -> Either JsonDecodeError a
1007- aesonArray = caseAesonArray (Left (TypeMismatch " Expected Array" ))
1008-
1009- -- Helper that decodes a string
1010- aesonString
1011- :: forall (a :: Type )
1012- . (String -> Either JsonDecodeError a )
1013- -> Aeson
1014- -> Either JsonDecodeError a
1015- aesonString = caseAesonString (Left (TypeMismatch " Expected String" ))
1016-
1017- -- Helper that decodes a null
1018- aesonNull
1019- :: forall (a :: Type )
1020- . Aeson
1021- -> Either JsonDecodeError Unit
1022- aesonNull = caseAesonNull (Left (TypeMismatch " Expected Null" )) pure
1023-
1024988-- Decode utilities
1025989
1026990newtype OgmiosError = OgmiosError
0 commit comments