diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f041b4..41eb5e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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] ### Added diff --git a/src/Zenith/CLI.hs b/src/Zenith/CLI.hs index c2fa1a7..75f5b85 100644 --- a/src/Zenith/CLI.hs +++ b/src/Zenith/CLI.hs @@ -894,29 +894,16 @@ scanZebra dbP zHost zPort b eChan znet = do _ <- liftIO $ completeSync pool Failed liftIO $ BC.writeBChan eChan $ TickMsg e1 Right blk -> do - r2 <- - liftIO $ - makeZebraCall - zHost - zPort - "getblock" - [Data.Aeson.String $ T.pack $ show bl, jsonNumber 0] - case r2 of - Left e2 -> do - _ <- liftIO $ completeSync pool Failed - 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 + bi <- + saveBlock pool $ + ZcashBlock + (fromIntegral $ bl_height blk) + (HexStringDB $ bl_hash blk) + (fromIntegral $ bl_confirmations blk) + (fromIntegral $ bl_time blk) + (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.AppEvent t) = do diff --git a/src/Zenith/GUI.hs b/src/Zenith/GUI.hs index 304d960..0f1c451 100644 --- a/src/Zenith/GUI.hs +++ b/src/Zenith/GUI.hs @@ -1729,29 +1729,16 @@ scanZebra dbPath zHost zPort net sendMsg = do _ <- completeSync pool Failed sendMsg (ShowError $ showt e1) Right blk -> do - r2 <- - liftIO $ - makeZebraCall - zHost - zPort - "getblock" - [Data.Aeson.String $ showt bl, jsonNumber 0] - case r2 of - Left e2 -> do - _ <- completeSync pool Failed - 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) + bi <- + saveBlock pool $ + ZcashBlock + (fromIntegral $ bl_height blk) + (HexStringDB $ bl_hash blk) + (fromIntegral $ bl_confirmations blk) + (fromIntegral $ bl_time blk) + (ZcashNetDB net) + mapM_ (processTx zHost zPort bi pool) $ bl_txs blk + sendMsg (SyncVal step) shieldTransaction :: Config -> ZcashNet -> ZcashAccountId -> (AppEvent -> IO ()) -> IO () diff --git a/src/Zenith/RPC.hs b/src/Zenith/RPC.hs index a32fb8f..6dbf72f 100644 --- a/src/Zenith/RPC.hs +++ b/src/Zenith/RPC.hs @@ -932,22 +932,12 @@ scanZebra dbPath zHost zPort net = do case r of Left _ -> completeSync pool Failed Right blk -> do - r2 <- - makeZebraCall - zHost - zPort - "getblock" - [Data.Aeson.String $ T.pack (show bl), jsonNumber 0] - case r2 of - Left _ -> completeSync pool Failed - 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 + bi <- + saveBlock pool $ + ZcashBlock + (fromIntegral $ bl_height blk) + (HexStringDB $ bl_hash blk) + (fromIntegral $ bl_confirmations blk) + (fromIntegral $ bl_time blk) + (ZcashNetDB net) + mapM_ (processTx zHost zPort bi pool) $ bl_txs blk diff --git a/src/Zenith/Scanner.hs b/src/Zenith/Scanner.hs index 50d6235..8bef9f6 100644 --- a/src/Zenith/Scanner.hs +++ b/src/Zenith/Scanner.hs @@ -133,29 +133,16 @@ processBlock host port pool pg net b = do _ <- completeSync pool Failed liftIO $ throwIO $ userError e Right blk -> do - r2 <- - liftIO $ - makeZebraCall - host - port - "getblock" - [Data.Aeson.String $ T.pack $ show b, jsonNumber 0] - case r2 of - Left e2 -> do - _ <- completeSync pool Failed - 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 + bi <- + saveBlock pool $ + ZcashBlock + (fromIntegral $ bl_height blk) + (HexStringDB $ bl_hash blk) + (fromIntegral $ bl_confirmations blk) + (fromIntegral $ bl_time blk) + net + mapM_ (processTx host port bi pool) $ bl_txs blk + liftIO $ tick pg -- | Function to process a raw transaction processTx :: diff --git a/zcash-haskell b/zcash-haskell index d45bd7d..4289a9d 160000 --- a/zcash-haskell +++ b/zcash-haskell @@ -1 +1 @@ -Subproject commit d45bd7dcf3c3cf4e893900a1774d24b14bf56591 +Subproject commit 4289a9ded67ef2ca432abc412934fb5b8b59a9cf diff --git a/zenith.cabal b/zenith.cabal index 5ee487b..8691137 100644 --- a/zenith.cabal +++ b/zenith.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: zenith -version: 0.7.0.0-beta +version: 0.7.1.0-beta license: MIT license-file: LICENSE author: Rene Vergara