From e02551c9ffe3a1405dec58f9a34b2c85615dfcc0 Mon Sep 17 00:00:00 2001 From: "Rene Vergara A." Date: Mon, 7 Oct 2024 19:47:28 -0400 Subject: [PATCH] rvv001 - Shield / Deshield form Fields to display Total transparent funts and total Shielded Funds added. A funtion to update the latest total values has to be included --- src/Zenith/CLI.hs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Zenith/CLI.hs b/src/Zenith/CLI.hs index 8a76b5c..02b5fbe 100644 --- a/src/Zenith/CLI.hs +++ b/src/Zenith/CLI.hs @@ -135,6 +135,8 @@ data Name | PrivacyFullField | ShieldField | DeshieldField + | TotalTranspField + | TotalShieldedField deriving (Eq, Show, Ord) data DialogInput = DialogInput @@ -160,7 +162,9 @@ data AdrBookEntry = AdrBookEntry makeLenses ''AdrBookEntry data ShDshEntry = ShDshEntry - { _shieldOp :: !ShieldDeshieldOp + { _totalTransparent :: !Float + , _totalShielded :: !Float + , _shieldOp :: !ShieldDeshieldOp , _shAmt :: !Float } deriving (Show) @@ -668,7 +672,11 @@ mkSendForm bal = mkshieldDeshieldForm :: Integer -> ShDshEntry -> Form ShDshEntry e Name mkshieldDeshieldForm bal = newForm - [ label "Select :" @@= + [ label "Total Transp. : " @@= + editShowableFieldWithValidate totalTransparent TotalTranspField (isAmountValid bal) + , label "Total Shielded : " @@= + editShowableFieldWithValidate totalShielded TotalShieldedField (isAmountValid bal) + , label "Select :" @@= radioField shieldOp [ (Shield, ShieldField, "Shield") @@ -1537,7 +1545,7 @@ runZenithTUI config = do "" Nothing uBal - (mkshieldDeshieldForm 0 (ShDshEntry Shield 0.0 )) + (mkshieldDeshieldForm 0 (ShDshEntry 0 0 Shield 0.0 )) Left _e -> do print $ "No Zebra node available on port " <>