utxorpc-server 0.0.2.0 → 0.0.3.0
raw patch · 3 files changed
+14/−14 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Utxorpc.Server: UtxorpcHandlers :: QueryHandlers m a -> SubmitHandlers m b c -> SyncHandlers m d -> WatchHandlers m e -> UtxorpcHandlers m a b c d e
+ Utxorpc.Server: UtxorpcHandlers :: Maybe (QueryHandlers m a) -> Maybe (SubmitHandlers m b c) -> Maybe (SyncHandlers m d) -> Maybe (WatchHandlers m e) -> UtxorpcHandlers m a b c d e
- Utxorpc.Server: [queryHandlers] :: UtxorpcHandlers m a b c d e -> QueryHandlers m a
+ Utxorpc.Server: [queryHandlers] :: UtxorpcHandlers m a b c d e -> Maybe (QueryHandlers m a)
- Utxorpc.Server: [submitHandlers] :: UtxorpcHandlers m a b c d e -> SubmitHandlers m b c
+ Utxorpc.Server: [submitHandlers] :: UtxorpcHandlers m a b c d e -> Maybe (SubmitHandlers m b c)
- Utxorpc.Server: [syncHandlers] :: UtxorpcHandlers m a b c d e -> SyncHandlers m d
+ Utxorpc.Server: [syncHandlers] :: UtxorpcHandlers m a b c d e -> Maybe (SyncHandlers m d)
- Utxorpc.Server: [watchHandlers] :: UtxorpcHandlers m a b c d e -> WatchHandlers m e
+ Utxorpc.Server: [watchHandlers] :: UtxorpcHandlers m a b c d e -> Maybe (WatchHandlers m e)
Files
- example/Main.hs +4/−4
- src/Utxorpc/Server.hs +9/−9
- utxorpc-server.cabal +1/−1
example/Main.hs view
@@ -60,7 +60,7 @@ handlersImpl :: (MonadIO m) => (String -> m ()) -> UtxorpcHandlers m Int Int Int Int Int handlersImpl logF = UtxorpcHandlers- (QueryImpl.handlerImpls logF)- (SubmitImpl.handlerImpls logF)- (SyncImpl.handlerImpls logF)- (WatchImpl.handlerImpls logF)+ (Just $ QueryImpl.handlerImpls logF)+ (Just $ SubmitImpl.handlerImpls logF)+ (Just $ SyncImpl.handlerImpls logF)+ (Just $ WatchImpl.handlerImpls logF)
src/Utxorpc/Server.hs view
@@ -100,13 +100,13 @@ e -- Stream state of `watchTx` = UtxorpcHandlers { -- | Handlers for the Query module.- queryHandlers :: QueryHandlers m a,+ queryHandlers :: Maybe (QueryHandlers m a), -- | Handlers for the Submit module.- submitHandlers :: SubmitHandlers m b c,+ submitHandlers :: Maybe (SubmitHandlers m b c), -- | Handlers for the Sync module.- syncHandlers :: SyncHandlers m d,+ syncHandlers :: Maybe (SyncHandlers m d), -- | Handlers for the Watch module.- watchHandlers :: WatchHandlers m e+ watchHandlers :: Maybe (WatchHandlers m e) } serviceHandlers ::@@ -119,15 +119,15 @@ logger unlift UtxorpcHandlers {queryHandlers, submitHandlers, syncHandlers, watchHandlers} =- Query.serviceHandlers logger unlift queryHandlers- <> Submit.serviceHandlers logger unlift submitHandlers- <> Sync.serviceHandlers logger unlift syncHandlers- <> Watch.serviceHandlers logger unlift watchHandlers+ maybe [] (Query.serviceHandlers logger unlift) queryHandlers+ <> maybe [] (Submit.serviceHandlers logger unlift) submitHandlers+ <> maybe [] (Sync.serviceHandlers logger unlift) syncHandlers+ <> maybe [] (Watch.serviceHandlers logger unlift) watchHandlers -- $use -- To run a UTxO RPC service: ----- 1. Create a `UtxorpcHandlers` record, containing a handler for each method in the specification.+-- 1. Create a `UtxorpcHandlers` record, containing handler for each method in one or more modules in the specification. -- -- 2. Create a `ServiceConfig` record, containing server settings (e.g., TLS settings), the handlers, and (optionally), a logger. --
utxorpc-server.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.0 name: utxorpc-server-version: 0.0.2.0+version: 0.0.3.0 synopsis: An SDK for UTxO RPC services. description: An SDK to reduce boilerplate, improve ease-of-use, and support logging for `utxorpc`. To get started, see the documentation for `Utxorpc.Server` below.