Compare commits
No commits in common. "84265de3e2c1083e68364d553f7087033c12e90f" and "3f33295bdca397615d0df41a0dbf29b6e3f90c2c" have entirely different histories.
84265de3e2
...
3f33295bdc
4 changed files with 25 additions and 70 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -5,16 +5,6 @@ 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.5.3.0-beta]
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Improved formatting of sync progress
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Wallet sync when no new block has been detected on-chain.
|
|
||||||
|
|
||||||
## [0.5.2.0-beta]
|
## [0.5.2.0-beta]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -69,7 +69,7 @@ import Control.Monad (forever, void)
|
||||||
import Control.Monad.IO.Class (liftIO)
|
import Control.Monad.IO.Class (liftIO)
|
||||||
import Control.Monad.Logger (LoggingT, runFileLoggingT, runNoLoggingT)
|
import Control.Monad.Logger (LoggingT, runFileLoggingT, runNoLoggingT)
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.HexString (HexString(..), toText)
|
import Data.HexString (toText)
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.Encoding as E
|
import qualified Data.Text.Encoding as E
|
||||||
|
@ -83,7 +83,6 @@ import Lens.Micro ((&), (.~), (^.), set)
|
||||||
import Lens.Micro.Mtl
|
import Lens.Micro.Mtl
|
||||||
import Lens.Micro.TH
|
import Lens.Micro.TH
|
||||||
import System.Hclip
|
import System.Hclip
|
||||||
import Text.Printf
|
|
||||||
import Text.Wrap (FillScope(..), FillStrategy(..), WrapSettings(..), wrapText)
|
import Text.Wrap (FillScope(..), FillStrategy(..), WrapSettings(..), wrapText)
|
||||||
import ZcashHaskell.Keys (generateWalletSeedPhrase, getWalletSeed)
|
import ZcashHaskell.Keys (generateWalletSeedPhrase, getWalletSeed)
|
||||||
import ZcashHaskell.Orchard (getSaplingFromUA, isValidUnifiedAddress)
|
import ZcashHaskell.Orchard (getSaplingFromUA, isValidUnifiedAddress)
|
||||||
|
@ -161,7 +160,6 @@ data DisplayType
|
||||||
| MsgDisplay
|
| MsgDisplay
|
||||||
| PhraseDisplay
|
| PhraseDisplay
|
||||||
| TxDisplay
|
| TxDisplay
|
||||||
| TxIdDisplay
|
|
||||||
| SyncDisplay
|
| SyncDisplay
|
||||||
| SendDisplay
|
| SendDisplay
|
||||||
| AdrBookEntryDisplay
|
| AdrBookEntryDisplay
|
||||||
|
@ -170,7 +168,6 @@ data DisplayType
|
||||||
data Tick
|
data Tick
|
||||||
= TickVal !Float
|
= TickVal !Float
|
||||||
| TickMsg !String
|
| TickMsg !String
|
||||||
| TickTx !HexString
|
|
||||||
|
|
||||||
data State = State
|
data State = State
|
||||||
{ _network :: !ZcashNet
|
{ _network :: !ZcashNet
|
||||||
|
@ -198,7 +195,6 @@ data State = State
|
||||||
, _abAddresses :: !(L.List Name (Entity AddressBook))
|
, _abAddresses :: !(L.List Name (Entity AddressBook))
|
||||||
, _abForm :: !(Form AdrBookEntry () Name)
|
, _abForm :: !(Form AdrBookEntry () Name)
|
||||||
, _abCurAdrs :: !T.Text -- used for address book CRUD operations
|
, _abCurAdrs :: !T.Text -- used for address book CRUD operations
|
||||||
, _sentTx :: !(Maybe HexString)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
makeLenses ''State
|
makeLenses ''State
|
||||||
|
@ -215,11 +211,11 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
("Zenith - " <>
|
("Zenith - " <>
|
||||||
show (st ^. network) <>
|
show (st ^. network) <>
|
||||||
" - " <>
|
" - " <>
|
||||||
(T.unpack
|
T.unpack
|
||||||
(maybe
|
(maybe
|
||||||
"(None)"
|
"(None)"
|
||||||
(\(_, w) -> zcashWalletName $ entityVal w)
|
(\(_, w) -> zcashWalletName $ entityVal w)
|
||||||
(L.listSelectedElement (st ^. wallets)))) ++ " "))
|
(L.listSelectedElement (st ^. wallets)))))
|
||||||
(C.hCenter
|
(C.hCenter
|
||||||
(str
|
(str
|
||||||
("Account: " ++
|
("Account: " ++
|
||||||
|
@ -236,7 +232,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
else displayTaz (st ^. balance))) <=>
|
else displayTaz (st ^. balance))) <=>
|
||||||
listAddressBox "Addresses" (st ^. addresses) <+>
|
listAddressBox "Addresses" (st ^. addresses) <+>
|
||||||
B.vBorder <+>
|
B.vBorder <+>
|
||||||
(C.hCenter (str ("Last block seen: " ++ show (st ^. syncBlock) ++ "\n")) <=>
|
(C.hCenter (str ("Last block seen: " ++ show (st ^. syncBlock))) <=>
|
||||||
listTxBox "Transactions" (st ^. network) (st ^. transactions))) <=>
|
listTxBox "Transactions" (st ^. network) (st ^. transactions))) <=>
|
||||||
C.hCenter
|
C.hCenter
|
||||||
(hBox
|
(hBox
|
||||||
|
@ -285,7 +281,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
(hBox
|
(hBox
|
||||||
[ capCommand "↑↓ " "move"
|
[ capCommand "↑↓ " "move"
|
||||||
, capCommand "↲ " "select"
|
, capCommand "↲ " "select"
|
||||||
, capCommand3 "" "Tab" " ->"
|
, capCommand "Tab " "->"
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
listTxBox ::
|
listTxBox ::
|
||||||
|
@ -301,7 +297,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
(hBox
|
(hBox
|
||||||
[ capCommand "↑↓ " "move"
|
[ capCommand "↑↓ " "move"
|
||||||
, capCommand "T" "x Display"
|
, capCommand "T" "x Display"
|
||||||
, capCommand3 "" "Tab" " <-"
|
, capCommand "Tab " "<-"
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
helpDialog :: State -> Widget Name
|
helpDialog :: State -> Widget Name
|
||||||
|
@ -429,7 +425,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
(str
|
(str
|
||||||
" _____ _ _ _ \n|__ /___ _ __ (_) |_| |__\n / // _ \\ '_ \\| | __| '_ \\\n / /| __/ | | | | |_| | | |\n/____\\___|_| |_|_|\\__|_| |_|") <=>
|
" _____ _ _ _ \n|__ /___ _ __ (_) |_| |__\n / // _ \\ '_ \\| | __| '_ \\\n / /| __/ | | | | |_| | | |\n/____\\___|_| |_|_|\\__|_| |_|") <=>
|
||||||
C.hCenter
|
C.hCenter
|
||||||
(withAttr titleAttr (str "Zcash Wallet v0.5.3.0-beta")) <=>
|
(withAttr titleAttr (str "Zcash Wallet v0.5.2.0-beta")) <=>
|
||||||
C.hCenter (withAttr blinkAttr $ str "Press any key..."))
|
C.hCenter (withAttr blinkAttr $ str "Press any key..."))
|
||||||
else emptyWidget
|
else emptyWidget
|
||||||
|
|
||||||
|
@ -500,16 +496,6 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
D.renderDialog
|
D.renderDialog
|
||||||
(D.dialog (Just $ txt "Message") Nothing 50)
|
(D.dialog (Just $ txt "Message") Nothing 50)
|
||||||
(padAll 1 $ strWrap $ st ^. msg)
|
(padAll 1 $ strWrap $ st ^. msg)
|
||||||
TxIdDisplay ->
|
|
||||||
withBorderStyle unicodeBold $
|
|
||||||
D.renderDialog
|
|
||||||
(D.dialog (Just $ txt "Success") Nothing 50)
|
|
||||||
(padAll 1 $
|
|
||||||
(txt "Tx ID: " <+>
|
|
||||||
txtWrapWith
|
|
||||||
(WrapSettings False True NoFill FillAfterFirst)
|
|
||||||
(maybe "None" toText (st ^. sentTx))) <=>
|
|
||||||
C.hCenter (hBox [capCommand "C" "opy", xCommand]))
|
|
||||||
TxDisplay ->
|
TxDisplay ->
|
||||||
case L.listSelectedElement $ st ^. transactions of
|
case L.listSelectedElement $ st ^. transactions of
|
||||||
Nothing -> emptyWidget
|
Nothing -> emptyWidget
|
||||||
|
@ -551,7 +537,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
, (barToDoAttr, P.progressIncompleteAttr)
|
, (barToDoAttr, P.progressIncompleteAttr)
|
||||||
])
|
])
|
||||||
(P.progressBar
|
(P.progressBar
|
||||||
(Just $ printf "%.2f%%" (st ^. barValue * 100))
|
(Just $ show (st ^. barValue * 100))
|
||||||
(_barValue st))))
|
(_barValue st))))
|
||||||
SendDisplay ->
|
SendDisplay ->
|
||||||
withBorderStyle unicodeBold $
|
withBorderStyle unicodeBold $
|
||||||
|
@ -729,12 +715,8 @@ scanZebra dbP zHost zPort b eChan = do
|
||||||
then liftIO $ BC.writeBChan eChan $ TickMsg "Invalid starting block for scan"
|
then liftIO $ BC.writeBChan eChan $ TickMsg "Invalid starting block for scan"
|
||||||
else do
|
else do
|
||||||
let bList = [(sb + 1) .. (zgb_blocks bStatus)]
|
let bList = [(sb + 1) .. (zgb_blocks bStatus)]
|
||||||
if not (null bList)
|
let step = (1.0 :: Float) / fromIntegral (zgb_blocks bStatus - (sb + 1))
|
||||||
then do
|
|
||||||
let step =
|
|
||||||
(1.0 :: Float) / fromIntegral (zgb_blocks bStatus - (sb + 1))
|
|
||||||
mapM_ (processBlock pool step) bList
|
mapM_ (processBlock pool step) bList
|
||||||
else liftIO $ BC.writeBChan eChan $ TickVal 1.0
|
|
||||||
where
|
where
|
||||||
processBlock :: ConnectionPool -> Float -> Int -> IO ()
|
processBlock :: ConnectionPool -> Float -> Int -> IO ()
|
||||||
processBlock pool step bl = do
|
processBlock pool step bl = do
|
||||||
|
@ -781,21 +763,16 @@ appEvent (BT.AppEvent t) = do
|
||||||
MsgDisplay -> return ()
|
MsgDisplay -> return ()
|
||||||
PhraseDisplay -> return ()
|
PhraseDisplay -> return ()
|
||||||
TxDisplay -> return ()
|
TxDisplay -> return ()
|
||||||
TxIdDisplay -> return ()
|
|
||||||
SyncDisplay -> return ()
|
SyncDisplay -> return ()
|
||||||
SendDisplay -> BT.modify $ set msg m
|
SendDisplay -> BT.modify $ set msg m
|
||||||
AdrBookEntryDisplay -> return ()
|
AdrBookEntryDisplay -> return ()
|
||||||
BlankDisplay -> return ()
|
BlankDisplay -> return ()
|
||||||
TickTx txid -> do
|
|
||||||
BT.modify $ set sentTx (Just txid)
|
|
||||||
BT.modify $ set displayBox TxIdDisplay
|
|
||||||
TickVal v -> do
|
TickVal v -> do
|
||||||
case s ^. displayBox of
|
case s ^. displayBox of
|
||||||
AddrDisplay -> return ()
|
AddrDisplay -> return ()
|
||||||
MsgDisplay -> return ()
|
MsgDisplay -> return ()
|
||||||
PhraseDisplay -> return ()
|
PhraseDisplay -> return ()
|
||||||
TxDisplay -> return ()
|
TxDisplay -> return ()
|
||||||
TxIdDisplay -> return ()
|
|
||||||
SendDisplay -> return ()
|
SendDisplay -> return ()
|
||||||
AdrBookEntryDisplay -> return ()
|
AdrBookEntryDisplay -> return ()
|
||||||
SyncDisplay -> do
|
SyncDisplay -> do
|
||||||
|
@ -919,16 +896,6 @@ appEvent (BT.VtyEvent e) = do
|
||||||
MsgDisplay -> BT.modify $ set displayBox BlankDisplay
|
MsgDisplay -> BT.modify $ set displayBox BlankDisplay
|
||||||
PhraseDisplay -> BT.modify $ set displayBox BlankDisplay
|
PhraseDisplay -> BT.modify $ set displayBox BlankDisplay
|
||||||
TxDisplay -> BT.modify $ set displayBox BlankDisplay
|
TxDisplay -> BT.modify $ set displayBox BlankDisplay
|
||||||
TxIdDisplay -> do
|
|
||||||
case e of
|
|
||||||
V.EvKey (V.KChar 'x') [] ->
|
|
||||||
BT.modify $ set displayBox BlankDisplay
|
|
||||||
V.EvKey (V.KChar 'c') [] -> do
|
|
||||||
liftIO $
|
|
||||||
setClipboard $
|
|
||||||
T.unpack $ maybe "None" toText (s ^. sentTx)
|
|
||||||
BT.modify $ set msg "Copied transaction ID!"
|
|
||||||
_ev -> return ()
|
|
||||||
SendDisplay -> BT.modify $ set displayBox BlankDisplay
|
SendDisplay -> BT.modify $ set displayBox BlankDisplay
|
||||||
SyncDisplay -> BT.modify $ set displayBox BlankDisplay
|
SyncDisplay -> BT.modify $ set displayBox BlankDisplay
|
||||||
AdrBookEntryDisplay -> BT.modify $ set displayBox BlankDisplay
|
AdrBookEntryDisplay -> BT.modify $ set displayBox BlankDisplay
|
||||||
|
@ -1367,9 +1334,7 @@ runZenithCLI config = do
|
||||||
(L.list ABList (Vec.fromList abookList) 1)
|
(L.list ABList (Vec.fromList abookList) 1)
|
||||||
(mkNewABForm (AdrBookEntry "" ""))
|
(mkNewABForm (AdrBookEntry "" ""))
|
||||||
""
|
""
|
||||||
Nothing
|
Left e -> print $
|
||||||
Left e -> do
|
|
||||||
print $
|
|
||||||
"No Zebra node available on port " <>
|
"No Zebra node available on port " <>
|
||||||
show port <> ". Check your configuration."
|
show port <> ". Check your configuration."
|
||||||
|
|
||||||
|
@ -1590,7 +1555,7 @@ sendTransaction pool chan zHost zPort znet accId bl amt ua memo = do
|
||||||
[Data.Aeson.String $ toText rawTx]
|
[Data.Aeson.String $ toText rawTx]
|
||||||
case resp of
|
case resp of
|
||||||
Left e1 -> BC.writeBChan chan $ TickMsg $ "Zebra error: " ++ show e1
|
Left e1 -> BC.writeBChan chan $ TickMsg $ "Zebra error: " ++ show e1
|
||||||
Right txId -> BC.writeBChan chan $ TickTx txId
|
Right txId -> BC.writeBChan chan $ TickMsg $ "Tx ID: " ++ txId
|
||||||
where
|
where
|
||||||
parseAddress :: T.Text -> IO UnifiedAddress
|
parseAddress :: T.Text -> IO UnifiedAddress
|
||||||
parseAddress a =
|
parseAddress a =
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
cabal-version: 3.0
|
cabal-version: 3.0
|
||||||
name: zenith
|
name: zenith
|
||||||
version: 0.5.3.0-beta
|
version: 0.5.2.0-beta
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Rene Vergara
|
author: Rene Vergara
|
||||||
|
|
Loading…
Reference in a new issue