From 52d3297fae7d35ddc9aee8061eb2d31344a15f34 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Thu, 29 Feb 2024 15:02:58 -0600 Subject: [PATCH] Check for accounts during startup --- src/Zenith/CLI.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Zenith/CLI.hs b/src/Zenith/CLI.hs index 1a8f8ed..95064b4 100644 --- a/src/Zenith/CLI.hs +++ b/src/Zenith/CLI.hs @@ -60,6 +60,7 @@ import Zenith.DB data Name = WList | AList + | AcList | TList | HelpDialog | DialogInputField @@ -79,6 +80,7 @@ data DialogType data State = State { _network :: !String , _wallets :: !(L.List Name (Entity ZcashWallet)) + , _accounts :: !(L.List Name (Entity ZcashAccount)) , _addresses :: !(L.List Name String) , _transactions :: !(L.List Name String) , _msg :: !String @@ -286,11 +288,16 @@ runZenithCLI host port dbFilePath = do Just chainInfo -> do initDb dbFilePath walList <- getWallets dbFilePath $ zgb_net chainInfo + accList <- + if not (null walList) + then getAccounts dbFilePath $ entityKey $ head walList + else return [] void $ M.defaultMain theApp $ State ((show . zgb_net) chainInfo) (L.list WList (Vec.fromList walList) 1) + (L.list AcList (Vec.fromList accList) 0) (L.list AList (Vec.fromList ["addr1", "addr2"]) 1) (L.list TList (Vec.fromList ["tx1", "tx2", "tx3"]) 1) ("Start up Ok! Connected to Zebra " ++