rvv041 #82

Merged
pitmutt merged 30 commits from rvv041 into milestone2 2024-06-07 20:03:06 +00:00
2 changed files with 15 additions and 15 deletions
Showing only changes of commit 51116e8083 - Show all commits

View file

@ -1050,12 +1050,12 @@ appEvent (BT.VtyEvent e) = do
Just (_, a) -> do Just (_, a) -> do
liftIO $ liftIO $
setClipboard $ setClipboard $
T.unpack $ addressBookAddress (entityVal a) T.unpack $ addressBookAbaddress (entityVal a)
BT.modify $ BT.modify $
set msg $ set msg $
"Address copied to Clipboard from >>\n" ++ "Address copied to Clipboard from >>\n" ++
T.unpack (addressBookDescrip (entityVal a)) ++ "->\n" ++ T.unpack (addressBookDescrip (entityVal a)) ++ "->\n" ++
T.unpack (addressBookAddress (entityVal a)) ++ "!" T.unpack (addressBookAbaddress (entityVal a)) ++ "!"
BT.modify $ set displayBox MsgDisplay BT.modify $ set displayBox MsgDisplay
_ -> do _ -> do
BT.modify $ set msg "Error while copying the address!!" BT.modify $ set msg "Error while copying the address!!"
@ -1066,7 +1066,7 @@ appEvent (BT.VtyEvent e) = do
Just (_, a) -> do Just (_, a) -> do
BT.modify $ BT.modify $
set txForm $ set txForm $
mkSendForm (s ^. balance) (SendInput (addressBookAddress (entityVal a)) 0.0 "") mkSendForm (s ^. balance) (SendInput (addressBookAbaddress (entityVal a)) 0.0 "")
BT.modify $ set dialogBox SendTx BT.modify $ set dialogBox SendTx
_ -> do _ -> do
BT.modify $ set msg "No receiver address available!!" BT.modify $ set msg "No receiver address available!!"
@ -1075,10 +1075,10 @@ appEvent (BT.VtyEvent e) = do
V.EvKey (V.KChar 'e') [] -> do V.EvKey (V.KChar 'e') [] -> do
case L.listSelectedElement $ s ^. abaddresses of case L.listSelectedElement $ s ^. abaddresses of
Just (_, a) -> do Just (_, a) -> do
BT.modify $ set abCurAdrs (addressBookAddress (entityVal a)) BT.modify $ set abCurAdrs (addressBookAbaddress (entityVal a))
BT.modify $ BT.modify $
set abForm $ set abForm $
mkNewABForm (AdrBookEntry (addressBookDescrip (entityVal a)) (addressBookAddress (entityVal a))) mkNewABForm (AdrBookEntry (addressBookDescrip (entityVal a)) (addressBookAbaddress (entityVal a)))
BT.modify $ set dialogBox AdrBookUpdForm BT.modify $ set dialogBox AdrBookUpdForm
_ -> do _ -> do
BT.modify $ set dialogBox Blank BT.modify $ set dialogBox Blank
@ -1086,10 +1086,10 @@ appEvent (BT.VtyEvent e) = do
V.EvKey (V.KChar 'd') [] -> do V.EvKey (V.KChar 'd') [] -> do
case L.listSelectedElement $ s ^. abaddresses of case L.listSelectedElement $ s ^. abaddresses of
Just (_, a) -> do Just (_, a) -> do
BT.modify $ set abCurAdrs (addressBookAddress (entityVal a)) BT.modify $ set abCurAdrs (addressBookAbaddress (entityVal a))
BT.modify $ BT.modify $
set abForm $ set abForm $
mkNewABForm (AdrBookEntry (addressBookDescrip (entityVal a)) (addressBookAddress (entityVal a))) mkNewABForm (AdrBookEntry (addressBookDescrip (entityVal a)) (addressBookAbaddress (entityVal a)))
BT.modify $ set dialogBox AdrBookDelForm BT.modify $ set dialogBox AdrBookDelForm
_ -> do _ -> do
BT.modify $ set dialogBox Blank BT.modify $ set dialogBox Blank
@ -1105,7 +1105,7 @@ appEvent (BT.VtyEvent e) = do
" Descr: " ++ " Descr: " ++
T.unpack (addressBookDescrip (entityVal a)) ++ T.unpack (addressBookDescrip (entityVal a)) ++
"\n Address: " ++ "\n Address: " ++
T.unpack (addressBookAddress (entityVal a)) T.unpack (addressBookAbaddress (entityVal a))
BT.modify $ set displayBox AdrBookEntryDisplay BT.modify $ set displayBox AdrBookEntryDisplay
_ -> do _ -> do
BT.modify $ set dialogBox Blank BT.modify $ set dialogBox Blank
@ -1322,7 +1322,7 @@ runZenithCLI config = do
else Blank) else Blank)
True True
(mkInputForm $ DialogInput "Main") (mkInputForm $ DialogInput "Main")
(F.focusRing [AList, TList,ABList]) (F.focusRing [AList, TList])
(zgb_blocks chainInfo) (zgb_blocks chainInfo)
dbFilePath dbFilePath
host host

View file

@ -249,8 +249,8 @@ share
AddressBook AddressBook
network ZcashNetDB network ZcashNetDB
descrip T.Text descrip T.Text
address T.Text abaddress T.Text
UniqueABA address UniqueABA abaddress
deriving Show Eq deriving Show Eq
|] |]
@ -1500,8 +1500,8 @@ updateAdrsInAdrBook pool d a ia = do
PS.retryOnBusy $ PS.retryOnBusy $
flip PS.runSqlPool pool $ do flip PS.runSqlPool pool $ do
update $ \ab -> do update $ \ab -> do
set ab [AddressBookDescrip =. val d, AddressBookAddress =. val a] set ab [AddressBookDescrip =. val d, AddressBookAbaddress =. val a]
where_ $ ab ^. AddressBookAddress ==. val ia where_ $ ab ^. AddressBookAbaddress ==. val ia
-- | Get one AddrssBook record using the Address as a key -- | Get one AddrssBook record using the Address as a key
getABookRec :: ConnectionPool -> T.Text -> IO [Entity AddressBook] getABookRec :: ConnectionPool -> T.Text -> IO [Entity AddressBook]
@ -1511,7 +1511,7 @@ getABookRec pool a = do
flip PS.runSqlPool pool $ flip PS.runSqlPool pool $
select $ do select $ do
adrbook <- from $ table @AddressBook adrbook <- from $ table @AddressBook
where_ ((adrbook ^. AddressBookAddress) ==. val a) where_ ((adrbook ^. AddressBookAbaddress) ==. val a)
return adrbook return adrbook
-- | delete an existing address from AddressBook -- | delete an existing address from AddressBook
@ -1522,7 +1522,7 @@ deleteAdrsFromAB pool ia = do
flip PS.runSqlPool pool $ do flip PS.runSqlPool pool $ do
delete $ do delete $ do
ab <- from $ table @AddressBook ab <- from $ table @AddressBook
where_ (ab ^. AddressBookAddress ==. val ia) where_ (ab ^. AddressBookAbaddress ==. val ia)
rmdups :: Ord a => [a] -> [a] rmdups :: Ord a => [a] -> [a]
rmdups = map head . group . sort rmdups = map head . group . sort