Implement Account creation #68

Merged
pitmutt merged 5 commits from rav001 into dev041 2024-03-01 20:59:58 +00:00
Showing only changes of commit 642908a0e0 - Show all commits

View file

@ -215,7 +215,12 @@ appEvent (BT.VtyEvent e) = do
fs <- BT.zoom inputForm $ BT.gets formState
nw <- liftIO $ addNewWallet (fs ^. dialogInput) s
BT.put nw
BT.modify $ set dialogBox Blank
aL <- use accounts
BT.modify $
set dialogBox $
if not (null $ L.listElements aL)
then Blank
else AName
ev -> BT.zoom inputForm $ handleFormEvent (BT.VtyEvent ev)
AName -> do
case e of
@ -224,7 +229,7 @@ appEvent (BT.VtyEvent e) = do
BT.modify $ set dialogBox Blank
fs <- BT.zoom inputForm $ BT.gets formState
printMsg $
"Creating new address " <> T.unpack (fs ^. dialogInput)
"Creating new account " <> T.unpack (fs ^. dialogInput)
ev -> BT.zoom inputForm $ handleFormEvent (BT.VtyEvent ev)
Blank -> do
case e of
@ -332,8 +337,10 @@ addNewWallet n s = do
T.unpack n
Just _ -> do
wL <- getWallets (s ^. dbPath) netName
return $
(s & wallets .~ L.listReplace (Vec.fromList wL) (Just 0) (s ^. wallets)) &
msg .~
"Created new wallet: " ++
T.unpack n
let aL =
L.listFindBy (\x -> zcashWalletName (entityVal x) == n) $
L.listReplace (Vec.fromList wL) (Just 0) (s ^. wallets)
return $ (s & wallets .~ aL) & msg .~ "Created new wallet: " ++ T.unpack n
addNewAccount :: T.Text -> State -> IO State
addNewAccount n s = undefined