Docker image #89

Merged
pitmutt merged 45 commits from milestone2 into master 2024-06-21 18:15:53 +00:00
Showing only changes of commit e9e56453c1 - Show all commits

View file

@ -249,7 +249,7 @@ share
AddressBook
network ZcashNetDB
descrip T.Text
address HexStringDB
address T.Text
UniqueABA address
deriving Show Eq
|]
@ -1484,5 +1484,24 @@ getAdrBook pool n =
where_ (adrbook ^. AddressBookNetwork ==. val (ZcashNetDB n))
pure adrbook
-- | Save a new address into AddressBook
saveAdrsInAdrBook ::
ConnectionPool -- ^ The database path to use
-> AddressBook -- ^ The address to add to the database
-> IO (Maybe (Entity AddressBook))
saveAdrsInAdrBook pool a =
runNoLoggingT $
PS.retryOnBusy $ flip PS.runSqlPool pool $ insertUniqueEntity a
-- | Update an existing address into AddressBook
updateAdrsInAdrBook :: ConnectionPool -> T.Text -> AddressBookId -> IO ()
updateAdrsInAdrBook pool a i = do
runNoLoggingT $
PS.retryOnBusy $
flip PS.runSqlPool pool $ do
update $ \ab -> do
set ab [AddressBookAddress =. val a]
where_ $ ab ^. AddressBookId ==. val i
rmdups :: Ord a => [a] -> [a]
rmdups = map head . group . sort