Skip to content

Commit 2c0c04d

Browse files
committed
Move DecodeOgmios to Ogmios.Types
1 parent 5c2d73f commit 2c0c04d

File tree

15 files changed

+276
-291
lines changed

15 files changed

+276
-291
lines changed

src/Contract/Backend/Ogmios/Mempool.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import Control.Monad.Reader.Trans (asks)
2222
import Ctl.Internal.Contract.Monad (wrapQueryM)
2323
import Ctl.Internal.Logging (Logger, mkLogger)
2424
import Ctl.Internal.QueryM (QueryM)
25-
import Ctl.Internal.QueryM.JsonRpc2 as JsonRpc2
2625
import Ctl.Internal.QueryM.Ogmios.JsWebSocket (JsWebSocket)
26+
import Ctl.Internal.QueryM.Ogmios.JsonRpc2 as JsonRpc2
2727
import Ctl.Internal.QueryM.Ogmios.Mempool
2828
( ListenerSet
2929
, OgmiosListeners

src/Internal/Contract/Monad.purs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import Ctl.Internal.Contract.ProviderBackend
5656
import Ctl.Internal.Helpers (filterMapWithKeyM, liftM, logWithLevel)
5757
import Ctl.Internal.Logging (Logger, mkLogger, setupLogs)
5858
import Ctl.Internal.QueryM (QueryM)
59-
import Ctl.Internal.QueryM.JsonRpc2 (OgmiosDecodeError, pprintOgmiosDecodeError)
6059
import Ctl.Internal.QueryM.Kupo (isTxConfirmedAff)
6160
import Ctl.Internal.QueryM.Ogmios
6261
( getProtocolParameters
@@ -69,6 +68,10 @@ import Ctl.Internal.QueryM.Ogmios.Mempool
6968
, underlyingWebSocket
7069
)
7170
import Ctl.Internal.QueryM.Ogmios.Queries (QueryEnv)
71+
import Ctl.Internal.QueryM.Ogmios.Types
72+
( OgmiosDecodeError
73+
, pprintOgmiosDecodeError
74+
)
7275
import Ctl.Internal.Service.Blockfrost
7376
( BlockfrostServiceM
7477
, runBlockfrostServiceM

src/Internal/QueryM.purs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
-- | CTL query layer monad.
2-
-- | This module defines an Aff interface for Ogmios Websocket Queries.
3-
-- | Since WebSockets do not define a mechanism for linking request/response.
4-
-- | Or for verifying that the connection is live, those concerns are addressed here
2+
-- | This module defines an Aff interface for backend queries.
53
module Ctl.Internal.QueryM
64
( QueryM
75
, ParQueryM

src/Internal/QueryM/CurrentEpoch.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import Prelude
77

88
import Control.Monad.Error.Class (throwError)
99
import Ctl.Internal.QueryM (QueryM)
10-
import Ctl.Internal.QueryM.JsonRpc2 (pprintOgmiosDecodeError)
1110
import Ctl.Internal.QueryM.Ogmios (currentEpoch) as Ogmios
12-
import Ctl.Internal.QueryM.Ogmios.Types (CurrentEpoch)
11+
import Ctl.Internal.QueryM.Ogmios.Types (CurrentEpoch, pprintOgmiosDecodeError)
1312
import Data.Either (Either(Right, Left))
1413
import Effect.Exception (error)
1514

src/Internal/QueryM/EraSummaries.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import Prelude
88
import Cardano.Types.EraSummaries (EraSummaries)
99
import Control.Monad.Error.Class (throwError)
1010
import Ctl.Internal.QueryM (QueryM)
11-
import Ctl.Internal.QueryM.JsonRpc2 (pprintOgmiosDecodeError)
1211
import Ctl.Internal.QueryM.Ogmios (eraSummaries) as Ogmios
12+
import Ctl.Internal.QueryM.Ogmios.Types (pprintOgmiosDecodeError)
1313
import Data.Either (Either(Right, Left))
1414
import Data.Newtype (unwrap)
1515
import Effect.Exception (error)

src/Internal/QueryM/JsonRpc2.purs

Lines changed: 0 additions & 242 deletions
This file was deleted.

src/Internal/QueryM/Ogmios.purs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,22 @@ import Control.Monad.Error.Class (class MonadThrow, throwError)
3333
import Control.Monad.Reader.Class (asks)
3434
import Ctl.Internal.Affjax (request) as Affjax
3535
import Ctl.Internal.QueryM (QueryM)
36-
import Ctl.Internal.QueryM.JsonRpc2
37-
( class DecodeOgmios
38-
, OgmiosDecodeError(ResultDecodingError, ClientErrorResponse)
39-
, decodeOgmios
40-
, pprintOgmiosDecodeError
41-
)
4236
import Ctl.Internal.QueryM.Ogmios.Types
43-
( AdditionalUtxoSet
37+
( class DecodeOgmios
38+
, AdditionalUtxoSet
4439
, ChainTipQR(CtChainPoint, CtChainOrigin)
4540
, CurrentEpoch
4641
, DelegationsAndRewardsR
42+
, OgmiosDecodeError(ResultDecodingError, ClientErrorResponse)
4743
, OgmiosEraSummaries
4844
, OgmiosProtocolParameters
4945
, OgmiosSystemStart
5046
, OgmiosTxEvaluationR
5147
, PoolParametersR
5248
, StakePoolsQueryArgument
5349
, SubmitTxR
50+
, decodeOgmios
51+
, pprintOgmiosDecodeError
5452
)
5553
import Ctl.Internal.ServerConfig (ServerConfig, mkHttpUrl)
5654
import Data.Bifunctor (lmap)

src/Internal/QueryM/Ogmios/Dispatcher.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Prelude
1616

1717
import Aeson (Aeson, JsonDecodeError, stringifyAeson)
1818
import Cardano.Types.TransactionHash (TransactionHash)
19-
import Ctl.Internal.QueryM.JsonRpc2 (parseJsonRpc2ResponseId)
19+
import Ctl.Internal.QueryM.Ogmios.JsonRpc2 (parseJsonRpc2ResponseId)
2020
import Ctl.Internal.QueryM.UniqueId (ListenerId)
2121
import Data.Either (Either(Left, Right))
2222
import Data.Map (Map)

0 commit comments

Comments
 (0)