Compare commits
No commits in common. "eb82f250eac750bf915ab5eceee01570d9087d0d" and "4e8c01c8d97c9d383d62686bde992b549788ee70" have entirely different histories.
eb82f250ea
...
4e8c01c8d9
1 changed files with 2 additions and 31 deletions
|
@ -62,7 +62,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
|
||||||
|
@ -139,7 +139,6 @@ data DisplayType
|
||||||
| MsgDisplay
|
| MsgDisplay
|
||||||
| PhraseDisplay
|
| PhraseDisplay
|
||||||
| TxDisplay
|
| TxDisplay
|
||||||
| TxIdDisplay
|
|
||||||
| SyncDisplay
|
| SyncDisplay
|
||||||
| SendDisplay
|
| SendDisplay
|
||||||
| BlankDisplay
|
| BlankDisplay
|
||||||
|
@ -147,7 +146,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
|
||||||
|
@ -172,7 +170,6 @@ data State = State
|
||||||
, _eventDispatch :: !(BC.BChan Tick)
|
, _eventDispatch :: !(BC.BChan Tick)
|
||||||
, _timer :: !Int
|
, _timer :: !Int
|
||||||
, _txForm :: !(Form SendInput () Name)
|
, _txForm :: !(Form SendInput () Name)
|
||||||
, _sentTx :: !(Maybe HexString)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
makeLenses ''State
|
makeLenses ''State
|
||||||
|
@ -416,16 +413,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
|
||||||
|
@ -658,21 +645,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 -> do
|
SendDisplay -> do
|
||||||
BT.modify $ set msg m
|
BT.modify $ set msg m
|
||||||
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 ()
|
||||||
SyncDisplay -> do
|
SyncDisplay -> do
|
||||||
if s ^. barValue == 1.0
|
if s ^. barValue == 1.0
|
||||||
|
@ -793,16 +775,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
|
||||||
BlankDisplay -> do
|
BlankDisplay -> do
|
||||||
|
@ -1091,7 +1063,6 @@ runZenithCLI config = do
|
||||||
eventChan
|
eventChan
|
||||||
0
|
0
|
||||||
(mkSendForm 0 $ SendInput "" 0.0 "")
|
(mkSendForm 0 $ SendInput "" 0.0 "")
|
||||||
Nothing
|
|
||||||
Left e -> do
|
Left e -> do
|
||||||
print $
|
print $
|
||||||
"No Zebra node available on port " <>
|
"No Zebra node available on port " <>
|
||||||
|
@ -1301,7 +1272,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 =
|
||||||
|
|
Loading…
Reference in a new issue