Fix bug #2
This commit is contained in:
parent
e6720e07e1
commit
4fd2d65ced
5 changed files with 38 additions and 12 deletions
18
CHANGELOG.md
18
CHANGELOG.md
|
@ -5,9 +5,23 @@ 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).
|
||||
|
||||
## [Unreleased]
|
||||
## [0.3.4]
|
||||
|
||||
### [0.3.3]
|
||||
### Added
|
||||
|
||||
- Display of node version on splash screen
|
||||
- Display of Zenith version on splash screen
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bug [#2](https://git.vergara.tech/Vergara_Tech/zenith/issues/2) when memos were left empty
|
||||
- Extra `"` in transaction ID display
|
||||
|
||||
### Changed
|
||||
|
||||
- Display of transaction amounts now uses zats, microZEC (μZEC), miliZEC(mZEC) and ZEC as units for readability.
|
||||
|
||||
## [0.3.3]
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -158,11 +158,11 @@ parseId = return . readMaybe
|
|||
displayTx :: ZcashTx -> IO ()
|
||||
displayTx t = do
|
||||
putStr "Tx ID: "
|
||||
print $ ztxid t
|
||||
putStrLn $ (T.unpack . ztxid) t
|
||||
putStr "Block Time: "
|
||||
print $ posixSecondsToUTCTime (fromInteger (zblocktime t))
|
||||
putStr "Zats: "
|
||||
print $ zamountZat t
|
||||
putStr "Amount: "
|
||||
putStrLn $ displayZec $ zamountZat t
|
||||
putStr "Memo: "
|
||||
TIO.putStrLn $ zmemo t
|
||||
putStrLn "-----"
|
||||
|
@ -202,6 +202,6 @@ main = do
|
|||
"Zenith"
|
||||
def
|
||||
{ getBanner =
|
||||
" ______ _ _ _ \n |___ / (_) | | | \n / / ___ _ __ _| |_| |__ \n / / / _ \\ '_ \\| | __| '_ \\ \n / /_| __/ | | | | |_| | | |\n /_____\\___|_| |_|_|\\__|_| |_|\n Zcash Full Node CLI"
|
||||
" ______ _ _ _ \n |___ / (_) | | | \n / / ___ _ __ _| |_| |__ \n / / / _ \\ '_ \\| | __| '_ \\ \n / /_| __/ | | | | |_| | | |\n /_____\\___|_| |_|_|\\__|_| |_|\n Zcash Full Node CLI v0.3.3"
|
||||
}
|
||||
(root nodeUser nodePwd)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: zenith
|
||||
version: 0.3.3
|
||||
version: 0.3.4
|
||||
git: "https://git.vergara.tech/Vergara_Tech/zenith"
|
||||
license: BOSL
|
||||
author: "Rene Vergara"
|
||||
|
|
|
@ -182,6 +182,13 @@ instance FromJSON AddressGroup where
|
|||
p <- v .: "receiver_types"
|
||||
return $ ZcashAddress MnemonicSeed p a addr
|
||||
|
||||
displayZec :: Integer -> String
|
||||
displayZec s
|
||||
| s < 100 = show s ++ " zats "
|
||||
| s < 100000 = show (fromIntegral s / 100) ++ " μZEC "
|
||||
| s < 100000000 = show (fromIntegral s / 100000) ++ " mZEC "
|
||||
| otherwise = show (fromIntegral s / 100000000) ++ " ZEC "
|
||||
|
||||
-- | A type to model a Zcash transaction
|
||||
data ZcashTx =
|
||||
ZcashTx
|
||||
|
@ -313,7 +320,10 @@ encodeHexText t = mconcat (map padHex t)
|
|||
else showHex (ord x) ""
|
||||
|
||||
encodeHexText' :: T.Text -> String
|
||||
encodeHexText' t = T.unpack . toText . fromBytes $ E.encodeUtf8 t
|
||||
encodeHexText' t =
|
||||
if T.length t > 0
|
||||
then T.unpack . toText . fromBytes $ E.encodeUtf8 t
|
||||
else T.unpack . toText . fromBytes $ E.encodeUtf8 "Sent from Zenith"
|
||||
|
||||
-- | Helper function to extract addresses from AddressGroups
|
||||
getAddresses :: AddressGroup -> [ZcashAddress]
|
||||
|
@ -484,8 +494,10 @@ displayZcashAddress user pwd (idx, zaddy) = do
|
|||
zats <- getBalance user pwd zaddy
|
||||
putStr $ show idx ++ ": "
|
||||
putStr $ show zaddy
|
||||
putStr " Zats: "
|
||||
print zats
|
||||
when (source zaddy == ImportedWatchOnly) (putStr "[VK]")
|
||||
putStr " Balance: "
|
||||
mapM_ (putStr . displayZec) zats
|
||||
putStrLn ""
|
||||
|
||||
-- | Copy an address to the clipboard
|
||||
copyAddress :: ZcashAddress -> IO ()
|
||||
|
@ -581,7 +593,7 @@ checkServer user pwd = do
|
|||
Just myResp -> do
|
||||
let r = result myResp
|
||||
if isNodeValid r
|
||||
then putStrLn "Connected to Zcash Full Node :)"
|
||||
then putStrLn $ "Connected to Zcash Full Node (" <> show r <> ") :)"
|
||||
else do
|
||||
putStrLn "Deprecated Zcash Full Node version found. Exiting"
|
||||
exitFailure
|
||||
|
|
|
@ -5,7 +5,7 @@ cabal-version: 1.12
|
|||
-- see: https://github.com/sol/hpack
|
||||
|
||||
name: zenith
|
||||
version: 0.3.3
|
||||
version: 0.3.4
|
||||
synopsis: Haskell CLI for Zcash Full Node
|
||||
description: Please see the README on repo at <https://git.vergara.tech/Vergara_Tech/zenith#readme>
|
||||
author: Rene Vergara
|
||||
|
|
Loading…
Reference in a new issue