Skip to content
Permalink
Browse files

Make CLI check if wallet exists before attempting to update passphras…

…e (same as it is when posting tx or estimating fee or updating name)
  • Loading branch information...
piotr-iohk committed Jul 12, 2019
1 parent ae6d5e1 commit 3ceeb2f74c80714f4eeb2f02cc3c7e7a80aa0d86
Showing with 14 additions and 9 deletions.
  1. +14 −9 lib/cli/src/Cardano/CLI.hs
@@ -446,15 +446,20 @@ cmdWalletUpdatePassphrase = command "passphrase" $ info (helper <*> cmd) $
<$> portOption
<*> walletIdArgument
exec (WalletUpdatePassphraseArgs wPort wId) = do
wPassphraseOld <- getPassphrase
"Please enter your current passphrase: "
wPassphraseNew <- getPassphraseWithConfirm
"Please enter a new passphrase: "
runClient wPort (const mempty) $
putWalletPassphrase (walletClient @t) (ApiT wId) $
WalletPutPassphraseData
(ApiT wPassphraseOld)
(ApiT wPassphraseNew)
res <- sendRequest wPort $ getWallet (walletClient @t) $ ApiT wId
case res of
Right _ -> do
wPassphraseOld <- getPassphrase
"Please enter your current passphrase: "
wPassphraseNew <- getPassphraseWithConfirm
"Please enter a new passphrase: "
runClient wPort (const mempty) $
putWalletPassphrase (walletClient @t) (ApiT wId) $
WalletPutPassphraseData
(ApiT wPassphraseOld)
(ApiT wPassphraseNew)
Left _ ->
handleResponse Aeson.encodePretty res

-- | Arguments for 'wallet delete' command
data WalletDeleteArgs = WalletDeleteArgs

0 comments on commit 3ceeb2f

Please sign in to comment.
You can’t perform that action at this time.