@@ -40,8 +40,8 @@ import Network.Connection (TLSSettings (..))
4040import Network.HTTP.Client (Manager , newManager )
4141import Network.HTTP.Client.TLS (mkManagerSettings )
4242import Network.TLS (ClientParams (.. ), credentialLoadX509FromMemory ,
43- defaultParamsClient , onCertificateRequest ,
44- onServerCertificate , supportedCiphers )
43+ defaultParamsClient , onCertificateRequest ,
44+ onServerCertificate , supportedCiphers )
4545import Network.TLS.Extra.Cipher (ciphersuite_strong )
4646import Servant.Client.Core (BaseUrl (.. ), Scheme (.. ))
4747import System.Directory (createDirectoryIfMissing )
@@ -50,23 +50,27 @@ import System.IO.Error (isDoesNotExistError)
5050import System.Metrics (Store , createCounter , createGauge )
5151import qualified System.Metrics.Gauge as Gauge
5252import System.Wlog (CanLog , HasLoggerName , LoggerNameBox (.. ),
53- liftLogIO , logError , logInfo , withSublogger )
53+ liftLogIO , logError , logInfo , withSublogger )
5454
5555import Cardano.Wallet.API.V1.Types (Account (.. ), Address ,
56- AssuranceLevel (NormalAssurance ), NewWallet (.. ),
57- NodeInfo (.. ), Payment (.. ), PaymentDistribution (.. ),
58- PaymentSource (.. ), SyncPercentage , V1 (.. ), Wallet (.. ),
59- WalletAddress (.. ), WalletId ,
60- WalletOperation (CreateWallet ), mkSyncPercentage ,
61- txAmount , unV1 )
56+ AssuranceLevel (NormalAssurance ),
57+ NewWallet (.. ), NodeInfo (.. ),
58+ Payment (.. ),
59+ PaymentDistribution (.. ),
60+ PaymentSource (.. ),
61+ SyncPercentage , V1 (.. ),
62+ Wallet (.. ), WalletAddress (.. ),
63+ WalletId ,
64+ WalletOperation (CreateWallet ),
65+ mkSyncPercentage , txAmount , unV1 )
6266import Cardano.Wallet.Client (ClientError (.. ), WalletClient (.. ),
63- WalletResponse (.. ), liftClient )
67+ WalletResponse (.. ), liftClient )
6468import Cardano.Wallet.Client.Http (mkHttpClient )
6569import Pos.Core (Coin (.. ))
6670import Pos.Util.Mnemonic (Mnemonic , entropyToMnemonic , genEntropy )
6771
6872import Cardano.Faucet.Types
69-
73+ import Cardano.Faucet.Types.Recaptcha
7074
7175--------------------------------------------------------------------------------
7276-- | Parses a 'SourceWalletConfig' from a file containing JSON
@@ -217,7 +221,7 @@ monitorWalletBalance
217221monitorWalletBalance fEnv = do
218222 let wc = fEnv ^. feWalletClient . to liftClient
219223 paymentSource = fEnv ^. (feSourceWallet . to cfgToPaymentSource)
220- balGauge = fEnv ^. feWalletBalance
224+ -- balGauge = fEnv ^. feWalletBalance
221225 forever $ do
222226 liftIO $ threadDelay 5000000
223227 eBal <- runExceptT $ readWalletBalance wc paymentSource
@@ -226,7 +230,7 @@ monitorWalletBalance fEnv = do
226230 logError (" Error reading balance: " <> (Text. pack $ show err))
227231 Right bal -> do
228232 logInfo (" Read wallet balance: " <> (Text. pack $ show bal))
229- liftIO $ Gauge. set balGauge bal
233+ -- liftIO $ Gauge.set balGauge bal
230234
231235--------------------------------------------------------------------------------
232236-- | Gets an address out of an existing wallet
@@ -362,6 +366,7 @@ initEnv fc store = do
362366 logInfo " Initializing wallet"
363367 initialWallet <- makeInitializedWallet fc (liftClient client)
364368 pmtQ <- liftIO $ TBQ. newTBQueueIO 10
369+ mRecaptchaSecret <- liftIO $ traverse readCaptchaSecret (fc ^. fcRecaptchaSecretFile)
365370 case initialWallet of
366371 Left err -> do
367372 logError ( " Error initializing wallet. Exiting: "
@@ -378,6 +383,7 @@ initEnv fc store = do
378383 fc
379384 client
380385 pmtQ
386+ mRecaptchaSecret
381387
382388
383389-- | Makes a http client 'Manager' for communicating with the wallet node
0 commit comments