Maintenance #106

Merged
pitmutt merged 3 commits from rav002 into milestone4 2024-12-16 16:08:51 +00:00
7 changed files with 47 additions and 90 deletions
Showing only changes of commit f9d8bc577a - Show all commits

View file

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.7.1.0-beta]
## Changed
- Removed workaround to obtain block time
## [0.7.0.0-beta] ## [0.7.0.0-beta]
### Added ### Added

View file

@ -894,29 +894,16 @@ scanZebra dbP zHost zPort b eChan znet = do
_ <- liftIO $ completeSync pool Failed _ <- liftIO $ completeSync pool Failed
liftIO $ BC.writeBChan eChan $ TickMsg e1 liftIO $ BC.writeBChan eChan $ TickMsg e1
Right blk -> do Right blk -> do
r2 <- bi <-
liftIO $ saveBlock pool $
makeZebraCall ZcashBlock
zHost (fromIntegral $ bl_height blk)
zPort (HexStringDB $ bl_hash blk)
"getblock" (fromIntegral $ bl_confirmations blk)
[Data.Aeson.String $ T.pack $ show bl, jsonNumber 0] (fromIntegral $ bl_time blk)
case r2 of (ZcashNetDB znet)
Left e2 -> do mapM_ (processTx zHost zPort bi pool) $ bl_txs blk
_ <- liftIO $ completeSync pool Failed liftIO $ BC.writeBChan eChan $ TickVal step
liftIO $ BC.writeBChan eChan $ TickMsg e2
Right hb -> do
let blockTime = getBlockTime hb
bi <-
saveBlock pool $
ZcashBlock
(fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk)
blockTime
(ZcashNetDB znet)
mapM_ (processTx zHost zPort bi pool) $ bl_txs blk
liftIO $ BC.writeBChan eChan $ TickVal step
appEvent :: BT.BrickEvent Name Tick -> BT.EventM Name State () appEvent :: BT.BrickEvent Name Tick -> BT.EventM Name State ()
appEvent (BT.AppEvent t) = do appEvent (BT.AppEvent t) = do

View file

@ -1729,29 +1729,16 @@ scanZebra dbPath zHost zPort net sendMsg = do
_ <- completeSync pool Failed _ <- completeSync pool Failed
sendMsg (ShowError $ showt e1) sendMsg (ShowError $ showt e1)
Right blk -> do Right blk -> do
r2 <- bi <-
liftIO $ saveBlock pool $
makeZebraCall ZcashBlock
zHost (fromIntegral $ bl_height blk)
zPort (HexStringDB $ bl_hash blk)
"getblock" (fromIntegral $ bl_confirmations blk)
[Data.Aeson.String $ showt bl, jsonNumber 0] (fromIntegral $ bl_time blk)
case r2 of (ZcashNetDB net)
Left e2 -> do mapM_ (processTx zHost zPort bi pool) $ bl_txs blk
_ <- completeSync pool Failed sendMsg (SyncVal step)
sendMsg (ShowError $ showt e2)
Right hb -> do
let blockTime = getBlockTime hb
bi <-
saveBlock pool $
ZcashBlock
(fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk)
blockTime
(ZcashNetDB net)
mapM_ (processTx zHost zPort bi pool) $ bl_txs blk
sendMsg (SyncVal step)
shieldTransaction :: shieldTransaction ::
Config -> ZcashNet -> ZcashAccountId -> (AppEvent -> IO ()) -> IO () Config -> ZcashNet -> ZcashAccountId -> (AppEvent -> IO ()) -> IO ()

View file

@ -932,22 +932,12 @@ scanZebra dbPath zHost zPort net = do
case r of case r of
Left _ -> completeSync pool Failed Left _ -> completeSync pool Failed
Right blk -> do Right blk -> do
r2 <- bi <-
makeZebraCall saveBlock pool $
zHost ZcashBlock
zPort (fromIntegral $ bl_height blk)
"getblock" (HexStringDB $ bl_hash blk)
[Data.Aeson.String $ T.pack (show bl), jsonNumber 0] (fromIntegral $ bl_confirmations blk)
case r2 of (fromIntegral $ bl_time blk)
Left _ -> completeSync pool Failed (ZcashNetDB net)
Right hb -> do mapM_ (processTx zHost zPort bi pool) $ bl_txs blk
let blockTime = getBlockTime hb
bi <-
saveBlock pool $
ZcashBlock
(fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk)
blockTime
(ZcashNetDB net)
mapM_ (processTx zHost zPort bi pool) $ bl_txs blk

View file

@ -133,29 +133,16 @@ processBlock host port pool pg net b = do
_ <- completeSync pool Failed _ <- completeSync pool Failed
liftIO $ throwIO $ userError e liftIO $ throwIO $ userError e
Right blk -> do Right blk -> do
r2 <- bi <-
liftIO $ saveBlock pool $
makeZebraCall ZcashBlock
host (fromIntegral $ bl_height blk)
port (HexStringDB $ bl_hash blk)
"getblock" (fromIntegral $ bl_confirmations blk)
[Data.Aeson.String $ T.pack $ show b, jsonNumber 0] (fromIntegral $ bl_time blk)
case r2 of net
Left e2 -> do mapM_ (processTx host port bi pool) $ bl_txs blk
_ <- completeSync pool Failed liftIO $ tick pg
liftIO $ throwIO $ userError e2
Right hb -> do
let blockTime = getBlockTime hb
bi <-
saveBlock pool $
ZcashBlock
(fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk)
blockTime
net
mapM_ (processTx host port bi pool) $ bl_txs blk
liftIO $ tick pg
-- | Function to process a raw transaction -- | Function to process a raw transaction
processTx :: processTx ::

@ -1 +1 @@
Subproject commit d45bd7dcf3c3cf4e893900a1774d24b14bf56591 Subproject commit 4289a9ded67ef2ca432abc412934fb5b8b59a9cf

View file

@ -1,6 +1,6 @@
cabal-version: 3.0 cabal-version: 3.0
name: zenith name: zenith
version: 0.7.0.0-beta version: 0.7.1.0-beta
license: MIT license: MIT
license-file: LICENSE license-file: LICENSE
author: Rene Vergara author: Rene Vergara