Skip to content

Commit e85dbae

Browse files
committed
build: update fourmolu checks to reflect multi-project state
1 parent 48bac3e commit e85dbae

File tree

16 files changed

+48
-45
lines changed

16 files changed

+48
-45
lines changed

.github/workflows/haskell.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ jobs:
9696
- name: Install fourmolu
9797
run: cabal install fourmolu --overwrite-policy=always
9898
- name: Run checks (fourmolu)
99-
run: fourmolu --mode check src
99+
run: |
100+
fourmolu --mode check geniusyield-dex-api
101+
fourmolu --mode check geniusyield-orderbot
102+
fourmolu --mode check geniusyield-server-lib
100103
- name: Build dependencies (cabal)
101104
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
102105
- name: Build all targets (cabal)

geniusyield-orderbot/src/GeniusYield/OrderBot/Adapter/Maestro.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ instance Domain.HasMarkets MaestroProvider where
5252
then pure GYLovelace
5353
else case parseAssetClassWithSep '.' (polId <> "." <> tkName) of
5454
Left e throwIO $ MpeDeserializationException (pack e)
55-
Right ac pure ac
55+
Right ac pure ac

geniusyield-orderbot/src/GeniusYield/OrderBot/Types.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ instance Swagger.ToParamSchema OrderAssetPair where
7878
toParamSchema _ =
7979
mempty
8080
& Swagger.type_
81-
?~ Swagger.SwaggerString
81+
?~ Swagger.SwaggerString
8282

8383
instance Swagger.ToSchema OrderAssetPair where
8484
declareNamedSchema p =
8585
pure $
8686
Swagger.named "OrderAssetPair" $
8787
Swagger.paramSchemaToSchema p
8888
& Swagger.example
89-
?~ toJSON ("f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc535.41474958_dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53" String)
90-
& Swagger.description
91-
?~ "Market pair identifier. It's an underscore delimited concatenation of offered and asked asset's \"token detail\". A token detail is given by dot delimited concatenation of policy id and token name."
89+
?~ toJSON ("f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc535.41474958_dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53" String)
90+
& Swagger.description
91+
?~ "Market pair identifier. It's an underscore delimited concatenation of offered and asked asset's \"token detail\". A token detail is given by dot delimited concatenation of policy id and token name."
9292

9393
{- | Two order asset pairs are considered "equivalent" (but not strictly equal, as in 'Eq'),
9494
if they contain the same 2 assets irrespective of order.
@@ -115,4 +115,4 @@ mkOrderAssetPair curAsset comAsset =
115115
OAssetPair
116116
{ currencyAsset = curAsset,
117117
commodityAsset = comAsset
118-
}
118+
}

geniusyield-server-lib/app/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ main = runCommand =<< execParser opts
1111
( fullDesc
1212
<> progDesc "GeniusYield DEX helpful operations"
1313
<> header "GeniusYield DEX"
14-
)
14+
)

geniusyield-server-lib/src/GeniusYield/Server/Api.hs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ instance HasSwagger api ⇒ HasSwagger (APIKeyAuthProtect :> api) where
202202
toSwagger _ =
203203
toSwagger (Proxy Proxy api)
204204
& securityDefinitions
205-
.~ SecurityDefinitions (IOHM.fromList [(apiKeyHeaderText, apiKeySecurityScheme)])
205+
.~ SecurityDefinitions (IOHM.fromList [(apiKeyHeaderText, apiKeySecurityScheme)])
206206
& allOperations
207-
. security
208-
.~ [SecurityRequirement (IOHM.singleton apiKeyHeaderText [])]
207+
. security
208+
.~ [SecurityRequirement (IOHM.singleton apiKeyHeaderText [])]
209209
& allOperations
210-
. responses
211-
%~ addCommonResponses
210+
. responses
211+
%~ addCommonResponses
212212

213213
addCommonResponses Responses Responses
214214
addCommonResponses resps = resps & at 401 ?~ Inline response401 & at 403 ?~ Inline response403
@@ -223,26 +223,26 @@ geniusYieldAPISwagger ∷ Swagger
223223
geniusYieldAPISwagger =
224224
toSwagger geniusYieldAPI
225225
& info
226-
. title
227-
.~ "Genius Yield DEX Server API"
226+
. title
227+
.~ "Genius Yield DEX Server API"
228228
& info
229-
. version
230-
.~ "1.0"
229+
. version
230+
.~ "1.0"
231+
& info
232+
. license
233+
?~ ("Apache-2.0" & url ?~ URL "https://opensource.org/licenses/apache-2-0")
231234
& info
232-
. license
233-
?~ ("Apache-2.0" & url ?~ URL "https://opensource.org/licenses/apache-2-0")
234-
& info
235235
. description
236-
?~ "API to interact with GeniusYield DEX."
237-
& applyTagsFor (subOperations (Proxy Proxy ("tx" +> TxAPI)) (Proxy Proxy GeniusYieldAPI)) ["Transaction" & description ?~ "Endpoints related to transaction hex such as submitting a transaction"]
238-
& applyTagsFor (subOperations (Proxy Proxy ("markets" +> MarketsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Markets" & description ?~ "Endpoints related to accessing markets information"]
239-
& applyTagsFor (subOperations (Proxy Proxy ("orders" +> OrdersAPI)) (Proxy Proxy GeniusYieldAPI)) ["Orders" & description ?~ "Endpoints related to interacting with orders"]
240-
& applyTagsFor (subOperations (Proxy Proxy ("settings" +> SettingsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Settings" & description ?~ "Endpoint to get server settings such as network, version, and revision"]
241-
& applyTagsFor (subOperations (Proxy Proxy ("trading-fees" +> TradingFeesAPI)) (Proxy Proxy GeniusYieldAPI)) ["Trading Fees" & description ?~ "Endpoint to get trading fees of DEX."]
242-
& applyTagsFor (subOperations (Proxy Proxy ("assets" +> AssetsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Assets" & description ?~ "Endpoint to fetch asset details."]
243-
& applyTagsFor (subOperations (Proxy Proxy ("order-book" +> OrderBookAPI)) (Proxy Proxy GeniusYieldAPI)) ["Order Book" & description ?~ "Endpoint to fetch order book."]
244-
& applyTagsFor (subOperations (Proxy Proxy ("historical-prices" +> "maestro" :> MaestroPriceHistoryAPI)) (Proxy Proxy GeniusYieldAPI)) ["Historical Prices" & description ?~ "Endpoints to fetch historical prices."]
245-
& applyTagsFor (subOperations (Proxy Proxy ("balances" +> BalancesAPI)) (Proxy Proxy GeniusYieldAPI)) ["Balances" & description ?~ "Endpoint to fetch token balances."]
236+
?~ "API to interact with GeniusYield DEX."
237+
& applyTagsFor (subOperations (Proxy Proxy ("tx" +> TxAPI)) (Proxy Proxy GeniusYieldAPI)) ["Transaction" & description ?~ "Endpoints related to transaction hex such as submitting a transaction"]
238+
& applyTagsFor (subOperations (Proxy Proxy ("markets" +> MarketsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Markets" & description ?~ "Endpoints related to accessing markets information"]
239+
& applyTagsFor (subOperations (Proxy Proxy ("orders" +> OrdersAPI)) (Proxy Proxy GeniusYieldAPI)) ["Orders" & description ?~ "Endpoints related to interacting with orders"]
240+
& applyTagsFor (subOperations (Proxy Proxy ("settings" +> SettingsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Settings" & description ?~ "Endpoint to get server settings such as network, version, and revision"]
241+
& applyTagsFor (subOperations (Proxy Proxy ("trading-fees" +> TradingFeesAPI)) (Proxy Proxy GeniusYieldAPI)) ["Trading Fees" & description ?~ "Endpoint to get trading fees of DEX."]
242+
& applyTagsFor (subOperations (Proxy Proxy ("assets" +> AssetsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Assets" & description ?~ "Endpoint to fetch asset details."]
243+
& applyTagsFor (subOperations (Proxy Proxy ("order-book" +> OrderBookAPI)) (Proxy Proxy GeniusYieldAPI)) ["Order Book" & description ?~ "Endpoint to fetch order book."]
244+
& applyTagsFor (subOperations (Proxy Proxy ("historical-prices" +> "maestro" :> MaestroPriceHistoryAPI)) (Proxy Proxy GeniusYieldAPI)) ["Historical Prices" & description ?~ "Endpoints to fetch historical prices."]
245+
& applyTagsFor (subOperations (Proxy Proxy ("balances" +> BalancesAPI)) (Proxy Proxy GeniusYieldAPI)) ["Balances" & description ?~ "Endpoint to fetch token balances."]
246246

247247
geniusYieldServer Ctx ServerT GeniusYieldAPI IO
248248
geniusYieldServer ctx =
@@ -357,4 +357,4 @@ handleBalancesApi ctx addr = do
357357
logInfo ctx $ "Fetching balance of address: " +|| addr ||+ ""
358358
runQuery ctx $ do
359359
utxos utxosAtAddress (addressFromBech32 addr) Nothing
360-
pure $ foldMapUTxOs utxoValue utxos
360+
pure $ foldMapUTxOs utxoValue utxos

geniusyield-server-lib/src/GeniusYield/Server/Assets.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ type AssetsAPI = Summary "Get assets information" :> Description "Get informatio
1616
handleAssetsApi Ctx GYAssetClass IO AssetDetails
1717
handleAssetsApi ctx@Ctx {..} ac = do
1818
logInfo ctx $ "Fetching details of asset: " +|| ac ||+ ""
19-
getAssetDetails ctxMaestroProvider ac
19+
getAssetDetails ctxMaestroProvider ac

geniusyield-server-lib/src/GeniusYield/Server/Auth.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ apiKeyAuthHandler (ApiKey key) = mkAuthHandler handler
3333
Just key'
3434
if key' == key
3535
then pure ()
36-
else throwError err403 {errBody = "Invalid API key"}
36+
else throwError err403 {errBody = "Invalid API key"}

geniusyield-server-lib/src/GeniusYield/Server/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ optionalSigningKeyFromServerConfig ServerConfig {..} = do
8989
let wk' = walletKeysFromMnemonicIndexed mnemonic (fromMaybe 0 accIx) (fromMaybe 0 addrIx)
9090
in case wk' of
9191
Left _ Nothing
92-
Right wk Just $ AGYExtendedPaymentSigningKey $ walletKeysToExtendedPaymentSigningKey wk
92+
Right wk Just $ AGYExtendedPaymentSigningKey $ walletKeysToExtendedPaymentSigningKey wk

geniusyield-server-lib/src/GeniusYield/Server/Constants.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ poConfigAddrPreprod = unsafeAddressFromText "addr_test1wrgvy8fermjrruaf7fnndtmpu
3535

3636
-- | The git hash of the current commit.
3737
gitHash String
38-
gitHash = $$tGitInfoCwd & giHash
38+
gitHash = $$tGitInfoCwd & giHash

geniusyield-server-lib/src/GeniusYield/Server/Dex/HistoricalPrices/Maestro.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ handleMaestroPriceHistory ctx marketId dex mresolution mfrom mto mlimit msort =
138138
marketOHLCTargetVolume = ohlcCandleInfoCoinBVolume,
139139
marketOHLCCount = ohlcCandleInfoCount,
140140
marketOHLCTimestamp = ohlcCandleInfoTimestamp & utcTimeToPOSIXSeconds & timeFromPOSIX
141-
}
141+
}

0 commit comments

Comments
 (0)