Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

[CO-403] Remove wallet dependency from Cardano/Wallet/Server/Plugins.hs #3686

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions wallet-new/src/Cardano/Wallet/Server/Plugins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
a particular monad, at some point in time.
-}

-- Orphan instance for Buildable Servant.NoContent
{-# OPTIONS_GHC -fno-warn-orphans #-}

module Cardano.Wallet.Server.Plugins
( Plugin
, apiServer
Expand All @@ -19,6 +22,7 @@ import Data.Aeson (encode)
import qualified Data.ByteString.Char8 as BS8
import qualified Data.Text as T
import Data.Typeable (typeOf)
import Formatting.Buildable (build)
import qualified Servant

import Network.HTTP.Types.Status (badRequest400)
Expand Down Expand Up @@ -58,14 +62,9 @@ import Pos.Util.Wlog (logInfo, modifyLoggerName, usingLoggerName)
import Pos.Web (serveDocImpl, serveImpl)
import qualified Pos.Web.Server

-- Needed for Orphan Instance 'Buildable Servant.NoContent' :|
import Pos.Wallet.Web ()


-- A @Plugin@ running in the monad @m@.
type Plugin m = Diffusion m -> m ()


-- | A @Plugin@ to start the wallet REST server
apiServer
:: ProtocolMagic
Expand Down Expand Up @@ -182,3 +181,6 @@ updateWatcher = const $ do
newUpdate <- WalletLayer.waitForUpdate w
logInfo "A new update was found!"
WalletLayer.addUpdate w . cpsSoftwareVersion $ newUpdate

instance Buildable Servant.NoContent where
build Servant.NoContent = build ()