-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3530: Extract cardano-wallet-api-http library r=Unisay a=Unisay In order to unlock evolution of the Wallet’s API as described in [this document](https://docs.google.com/document/d/17tM0VKFBLFRULVI2k1y67uEViEK1jtihg94IT77iH08/edit?usp=sharing), this PR separates a core wallet functionality (library) from its HTTP API (Servant) by using a separate cabal [internal] libraries. - [x] Extract `cardano-wallet-api-http` [internal] cabal library. - [x] Extract `mock-token-metadata` [internal] cabal library. - [x] Extract `mock-token-metadata` executable. - [x] Extract `wai-middleware-logging` [internal] cabal library. - [x] Rename `Cardano.Wallet.Api.XXX` to `Cardano.Wallet.Api.Http.XXX` at several occasions as we're shifting towards a "1 wallet library `N` API's" model, where `HTTP` is one point in `N`. Stake pool functionality used API-types so I had to decouple it: - [x] Replace `ApiPoolId` with the `ApiT PoolId`; - [x] Replace `ApiStakePool` with the `ApiT StakePool`; - [x] Remove `apiPool` type parameter from the API definition as it wasn't used with different types anyway; ### Issue Number ADP-2522 Co-authored-by: Yura Lazarev <[email protected]>
- Loading branch information
Showing
72 changed files
with
1,704 additions
and
1,319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Main where | ||
|
||
import Prelude | ||
|
||
import Main.Utf8 | ||
( withUtf8 ) | ||
import Test.Hspec.Extra | ||
( hspecMain ) | ||
|
||
import qualified Network.Wai.Middleware.LoggingSpec as LoggingSpec | ||
|
||
main :: IO () | ||
main = withUtf8 $ hspecMain LoggingSpec.spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
cabal-version: 2.2 | ||
name: wai-middleware-logging | ||
version: 1.0 | ||
synopsis: WAI Middleware for Logging | ||
homepage: https://github.com/input-output-hk/cardano-wallet | ||
author: IOHK Engineering Team | ||
maintainer: [email protected] | ||
copyright: 2018-2022 IOHK | ||
license: Apache-2.0 | ||
category: Web | ||
build-type: Simple | ||
|
||
flag release | ||
description: Enable optimization and `-Werror` | ||
default: False | ||
manual: True | ||
|
||
common language | ||
default-language: Haskell2010 | ||
default-extensions: | ||
NoImplicitPrelude | ||
OverloadedStrings | ||
|
||
common opts-lib | ||
ghc-options: -Wall -Wcompat -fwarn-redundant-constraints | ||
|
||
if flag(release) | ||
ghc-options: -O2 -Werror | ||
|
||
common opts-exe | ||
ghc-options: -threaded -rtsopts -Wall | ||
|
||
if flag(release) | ||
ghc-options: -O2 -Werror | ||
|
||
common deps | ||
build-depends: | ||
, aeson | ||
, base | ||
, binary | ||
, bytestring | ||
, cardano-wallet-test-utils | ||
, contra-tracer | ||
, hspec | ||
, http-client | ||
, http-types | ||
, iohk-monitoring | ||
, network | ||
, QuickCheck | ||
, servant-server | ||
, streaming-commons | ||
, text | ||
, text-class | ||
, time | ||
, unliftio | ||
, unordered-containers | ||
, wai | ||
, warp | ||
, with-utf8 | ||
|
||
library | ||
import: language, opts-lib, deps | ||
hs-source-dirs: src | ||
exposed-modules: | ||
Network.Wai.Middleware.Logging | ||
Network.Wai.Middleware.ServerError | ||
|
||
test-suite unit | ||
import: language, opts-exe, deps | ||
ghc-options: -with-rtsopts=-M2G -with-rtsopts=-N4 | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test | ||
main-is: Main.hs | ||
build-depends: wai-middleware-logging | ||
build-tool-depends: hspec-discover:hspec-discover | ||
other-modules: Network.Wai.Middleware.LoggingSpec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.