Skip to content

Commit

Permalink
Fix Menmonic vs Mnemonic typos
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Nov 15, 2024
1 parent 0a39092 commit 1509e26
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import Cardano.Wallet.Deposit.REST.Catch
( catchRunWalletResourceM
)
import Cardano.Wallet.Deposit.REST.Wallet.Create
( PostWalletViaMenmonic (..)
( PostWalletViaMnemonic (..)
, PostWalletViaXPub (..)
)
import Control.Tracer
Expand Down Expand Up @@ -83,14 +83,14 @@ createWalletViaMnemonic
-> FilePath
-> WalletBootEnv IO
-> WalletResource
-> PostWalletViaMenmonic
-> PostWalletViaMnemonic
-> Handler NoContent
createWalletViaMnemonic
tracer
dir
boot
resource
(PostWalletViaMenmonic mnemonics' passphrase' users') =
(PostWalletViaMnemonic mnemonics' passphrase' users') =
onlyOnWalletIntance resource initWallet $> NoContent
where
initWallet :: WalletResourceM ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Cardano.Wallet.Deposit.HTTP.Types.JSON
, CustomerList
)
import Cardano.Wallet.Deposit.REST.Wallet.Create
( PostWalletViaMenmonic
( PostWalletViaMnemonic
, PostWalletViaXPub
)
import Servant.API
Expand All @@ -47,7 +47,7 @@ type API =
:> Capture "customerId" (ApiT Customer)
:> Put '[JSON] (ApiT Address)
:<|> "mnemonics"
:> ReqBody '[JSON] PostWalletViaMenmonic
:> ReqBody '[JSON] PostWalletViaMnemonic
:> PutNoContent
:<|> "xpub"
:> ReqBody '[JSON] PostWalletViaXPub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Cardano.Wallet.Deposit.Read
, ChainPoint (..)
)
import Cardano.Wallet.Deposit.REST.Wallet.Create
( PostWalletViaMenmonic
( PostWalletViaMnemonic
, PostWalletViaXPub
)
import Control.Applicative
Expand Down Expand Up @@ -223,6 +223,6 @@ instance ToSchema (ApiT ChainPoint) where
(Just "ApiT ChainPoint")
chainPointSchema

instance FromJSON PostWalletViaMenmonic
instance FromJSON PostWalletViaMnemonic

instance FromJSON PostWalletViaXPub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# LANGUAGE DuplicateRecordFields #-}

module Cardano.Wallet.Deposit.REST.Wallet.Create
( PostWalletViaMenmonic (..)
( PostWalletViaMnemonic (..)
, PostWalletViaXPub (..)
)
where
Expand All @@ -17,7 +17,7 @@ import GHC.Generics
)

-- | Data for a request to create a wallet via a mnemonic.
data PostWalletViaMenmonic = PostWalletViaMenmonic
data PostWalletViaMnemonic = PostWalletViaMnemonic
{ mnemonics :: Text
, password :: Text
, trackedCustomers :: Int
Expand Down
8 changes: 4 additions & 4 deletions lib/faucet/lib/Cardano/Faucet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
module Cardano.Faucet
( initialState
, serveMnemonics
, serveMenmonic
, serveMnemonic
, serveAddresses
) where

Expand Down Expand Up @@ -100,8 +100,8 @@ serveMnemonics mnLen minIndex maxIndex = do
& NE.filter \(IndexedMnemonic index _mnemonic) ->
index >= minIndex && index <= maxIndex

serveMenmonic :: MnemonicLength -> MnemonicIndex -> FaucetM Mnemonic
serveMenmonic mnLen index =
serveMnemonic :: MnemonicLength -> MnemonicIndex -> FaucetM Mnemonic
serveMnemonic mnLen index =
serveMnemonics mnLen index index >>= \case
[IndexedMnemonic _index mnemonic] -> pure mnemonic
_ -> throwError err404
Expand All @@ -115,7 +115,7 @@ serveAddresses
-> AddressIndex
-> FaucetM [IndexedAddress]
serveAddresses mnLen mnIdx style netTag minAddrIdx maxAddrIdx = do
Mnemonic (SomeMnemonic mnemonic) <- serveMenmonic mnLen mnIdx
Mnemonic (SomeMnemonic mnemonic) <- serveMnemonic mnLen mnIdx
let stylishEncoder = case style of
AddressStyleShelley -> Addresses.shelley
AddressStyleByron -> Addresses.byron
Expand Down
4 changes: 2 additions & 2 deletions lib/faucet/lib/Cardano/Faucet/Http/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import qualified Servant

import Cardano.Faucet
( serveAddresses
, serveMenmonic
, serveMnemonic
, serveMnemonics
)
import Cardano.Faucet.FaucetM
Expand Down Expand Up @@ -60,6 +60,6 @@ server state0 =
Servant.hoistServer api (runFaucetM state0) faucetServer
where
serveMnemmonicOrAddresses len index =
serveMenmonic len index :<|> serveAddresses len index
serveMnemonic len index :<|> serveAddresses len index
faucetServer :: Servant.ServerT FaucetApi FaucetM
faucetServer len = serveMnemonics len :<|> serveMnemmonicOrAddresses len
6 changes: 3 additions & 3 deletions lib/ui/src/Cardano/Wallet/UI/Deposit/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Cardano.Wallet.Deposit.Read
( TxId
)
import Cardano.Wallet.Deposit.REST.Wallet.Create
( PostWalletViaMenmonic
( PostWalletViaMnemonic
, PostWalletViaXPub
)
import Cardano.Wallet.Read
Expand Down Expand Up @@ -69,7 +69,7 @@ import Web.FormUrlEncoded

import qualified Data.ByteString.Lazy as BL

instance FromForm PostWalletViaMenmonic
instance FromForm PostWalletViaMnemonic

instance FromForm PostWalletViaXPub

Expand Down Expand Up @@ -123,7 +123,7 @@ type Data =
:<|> "wallet" :> SessionedHtml Get
:<|> "wallet"
:> "mnemonic"
:> ReqBody '[FormUrlEncoded] PostWalletViaMenmonic
:> ReqBody '[FormUrlEncoded] PostWalletViaMnemonic
:> SessionedHtml Post
:<|> "wallet"
:> "xpub"
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/src/Cardano/Wallet/UI/Deposit/Handlers/Wallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Cardano.Wallet.Deposit.REST
, WalletResourceM
)
import Cardano.Wallet.Deposit.REST.Wallet.Create
( PostWalletViaMenmonic (..)
( PostWalletViaMnemonic (..)
, PostWalletViaXPub (..)
)
import Cardano.Wallet.UI.Common.Layer
Expand Down Expand Up @@ -64,14 +64,14 @@ postMnemonicWallet
-> (Credentials -> Customer -> WalletResourceM ())
-> (BL.ByteString -> html)
-> (() -> html)
-> PostWalletViaMenmonic
-> PostWalletViaMnemonic
-> Handler html
postMnemonicWallet
l
initWallet
alert
render
(PostWalletViaMenmonic mnemonic passphrase customers) = do
(PostWalletViaMnemonic mnemonic passphrase customers) = do
let credentials = credentialsFromMnemonics mnemonic passphrase
initWalletWithXPub l alert render
$ initWallet credentials
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/src/Cardano/Wallet/UI/Deposit/Server/Wallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import Servant
)

import Cardano.Wallet.Deposit.REST.Wallet.Create
( PostWalletViaMenmonic
( PostWalletViaMnemonic
, PostWalletViaXPub
)

Expand All @@ -96,7 +96,7 @@ servePostMnemonicWallet
-> WalletBootEnv IO
-> FilePath
-> UILayer WalletResource
-> PostWalletViaMenmonic
-> PostWalletViaMnemonic
-> Maybe RequestCookies
-> Handler (CookieResponse RawHtml)
servePostMnemonicWallet tr env dbDir ul request =
Expand Down

0 comments on commit 1509e26

Please sign in to comment.