Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mueller committed Jan 13, 2025
1 parent 69559e3 commit 6f53e3c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
10 changes: 3 additions & 7 deletions src/lib/Wst/Cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ module Wst.Cli(runMain) where
import Blammo.Logging.Simple (Message ((:#)), MonadLogger, logDebug, logError,
logInfo, runLoggerLoggingT, (.=))
import Cardano.Api qualified as C
import Control.Monad.Except (ExceptT (..), MonadError, liftEither, throwError)
import Control.Monad.Except (MonadError, liftEither)
import Control.Monad.IO.Class (MonadIO (..))
import Control.Monad.Reader (MonadReader, ask, asks)
import Convex.Blockfrost (evalBlockfrostT, runBlockfrostT)
import Convex.Blockfrost.MonadBlockchain (sendTxBlockfrost)
import Control.Monad.Reader (MonadReader, asks)
import Convex.Class (MonadBlockchain (sendTx), MonadUtxoQuery)
import Convex.Wallet.Operator (Operator (Operator, oPaymentKey),
OperatorConfigSigning,
PaymentExtendedKey (PESigningEx),
operatorPaymentCredential, signTxOperator,
PaymentExtendedKey (PESigningEx), signTxOperator,
verificationKey)
import Convex.Wallet.Operator qualified as Operator
import Data.Functor.Identity (Identity)
Expand All @@ -31,7 +28,6 @@ import Wst.AppError (AppError)
import Wst.Cli.Command (Command (..), ManageCommand (StartServer, Status),
parseCommand)
import Wst.Offchain.Endpoints.Deployment qualified as Endpoints
import Wst.Offchain.Env (addOperatorEnv)
import Wst.Offchain.Env qualified as Env
import Wst.Server (ServerArgs (..))
import Wst.Server qualified as Server
Expand Down
5 changes: 5 additions & 0 deletions src/lib/Wst/Orphans.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ instance ToSchema C.Quantity where
$ mempty
& L.type_ ?~ OpenApiInteger

instance ToSchema C.TxId where
declareNamedSchema _ = pure
$ NamedSchema (Just "TxId")
$ mempty
& L.type_ ?~ OpenApiString
1 change: 0 additions & 1 deletion src/lib/Wst/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module Wst.Server(
import Cardano.Api.Shelley qualified as C
import Control.Lens qualified as L
import Control.Monad.Error.Class (MonadError (throwError))
import Control.Monad.Except (MonadError)
import Control.Monad.Reader (MonadReader, asks)
import Convex.CardanoApi.Lenses qualified as L
import Convex.Class (MonadBlockchain (sendTx), MonadUtxoQuery)
Expand Down
9 changes: 6 additions & 3 deletions src/test/lib/Wst/Test/MockServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import Control.Monad.IO.Class (MonadIO (..))
import Data.Proxy (Proxy (..))
import Network.Wai.Handler.Warp qualified as Warp
import Network.Wai.Middleware.Cors
import Servant (Server)
import Servant (Server, throwError)
import Servant.API (NoContent (..), (:<|>) (..))
import Servant.Server (serve)
import Servant.Server qualified as Server
import Test.Gen.Cardano.Api.Typed qualified as Gen
import Test.QuickCheck qualified as QC
import Test.QuickCheck.Gen qualified as Gen
Expand All @@ -39,10 +40,12 @@ genTx = liftIO $ fmap TextEnvelopeJSON $ QC.generate $ hedgehog $ Gen.genTx C.sh

mockTxApi :: Server (BuildTxAPI C.ConwayEra)
mockTxApi =
const genTx
:<|> const genTx
(const genTx
:<|> const genTx
:<|> const genTx
:<|> const genTx)
:<|> const (throwError Server.err501)
:<|> const (throwError Server.err501)

-- | Start the mock server
runMockServer :: IO ()
Expand Down
4 changes: 1 addition & 3 deletions src/test/unit/Wst/Test/UnitTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import Cardano.Api qualified as C
import Cardano.Api.Shelley qualified as C
import Cardano.Ledger.Api qualified as Ledger
import Cardano.Ledger.Plutus.ExUnits (ExUnits (..))
import Cardano.Ledger.Shelley.TxCert qualified as TxCert
import Control.Lens ((%~), (&), (^.))
import Control.Monad (void)
import Control.Monad.Reader (MonadReader (ask), ReaderT (runReaderT), asks)
import Convex.BuildTx (MonadBuildTx, addCertificate)
import Convex.BuildTx qualified as BuildTx
import Convex.Class (MonadBlockchain (queryProtocolParameters, sendTx),
MonadMockchain, MonadUtxoQuery)
Expand Down Expand Up @@ -265,7 +263,7 @@ registerAlwaysSucceedsStakingCert = failOnError $ do
void (tryBalanceAndSubmit mempty Wallet.w1 txBody TrailingChange [])

-- TODO: registration to be moved to the endpoints
registerTransferScripts :: (MonadFail m, MonadReader env m, Env.HasDirectoryEnv env, Env.HasTransferLogicEnv env, MonadMockchain C.ConwayEra m) => C.Hash C.PaymentKey -> m C.TxId
registerTransferScripts :: (MonadFail m, MonadReader env m, Env.HasTransferLogicEnv env, MonadMockchain C.ConwayEra m) => C.Hash C.PaymentKey -> m C.TxId
registerTransferScripts pkh = failOnError $ do
transferMintingScript <- asks (Env.tleMintingScript . Env.transferLogicEnv)
transferSpendingScript <- asks (Env.tleTransferScript . Env.transferLogicEnv)
Expand Down
3 changes: 1 addition & 2 deletions src/wst-poc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,10 @@ test-suite wst-poc-test
Wst.Test.UnitTest

build-depends:
, base >=4.14.0
, base >=4.14.0
, cardano-api
, cardano-ledger-api
, cardano-ledger-core
, cardano-ledger-shelley
, convex-base
, convex-coin-selection
, convex-mockchain
Expand Down

0 comments on commit 6f53e3c

Please sign in to comment.