Skip to content

Commit

Permalink
Change wording in TUI to decommit
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jul 22, 2024
1 parent cd60424 commit ca38c87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions hydra-tui/src/Hydra/TUI/Drawing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ drawFocusPanelInitializing me InitializingState{remainingParties, initializingSc
ConfirmingAbort x -> vBox [txt "Confirm Abort action:", renderForm x]

drawFocusPanelOpen :: NetworkId -> VerificationKey PaymentKey -> UTxO -> UTxO -> OpenScreen -> Widget Name
drawFocusPanelOpen networkId vk utxo pendingUTxOToDecrement = \case
drawFocusPanelOpen networkId vk utxo pendingUTxOToDecommit = \case
OpenHome ->
vBox
[ txt "Active UTxO: "
, drawUTxO (highlightOwnAddress ownAddress) utxo
, hBorder
, txt "Pending UTxO to decrement: "
, drawUTxO (highlightOwnAddress ownAddress) pendingUTxOToDecrement
, txt "Pending UTxO to decommit: "
, drawUTxO (highlightOwnAddress ownAddress) pendingUTxOToDecommit
]
SelectingUTxO x -> renderForm x
SelectingUTxOToDecrement x -> renderForm x
SelectingUTxOToDecommit x -> renderForm x
EnteringAmount _ x -> renderForm x
SelectingRecipient _ _ x -> renderForm x
ConfirmingClose x -> vBox [txt "Confirm Close action:", renderForm x]
Expand All @@ -167,9 +167,9 @@ highlightOwnAddress ownAddress a =
drawFocusPanel :: NetworkId -> VerificationKey PaymentKey -> UTCTime -> Connection -> Widget Name
drawFocusPanel networkId vk now (Connection{me, headState}) = case headState of
Idle -> emptyWidget
Active (ActiveLink{utxo, pendingUTxOToDecrement, activeHeadState}) -> case activeHeadState of
Active (ActiveLink{utxo, pendingUTxOToDecommit, activeHeadState}) -> case activeHeadState of
Initializing x -> drawFocusPanelInitializing me x
Open x -> drawFocusPanelOpen networkId vk utxo pendingUTxOToDecrement x
Open x -> drawFocusPanelOpen networkId vk utxo pendingUTxOToDecommit x
Closed x -> drawFocusPanelClosed now x
FanoutPossible -> txt "Ready to fanout!"
Final -> drawFocusPanelFinal networkId vk utxo
Expand Down
10 changes: 5 additions & 5 deletions hydra-tui/src/Hydra/TUI/Model.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ data InitializingScreen
data OpenScreen
= OpenHome
| SelectingUTxO {selectingUTxOForm :: UTxORadioFieldForm (HydraEvent Tx) Name}
| SelectingUTxOToDecrement {selectingUTxOToDecrementForm :: UTxORadioFieldForm (HydraEvent Tx) Name}
| SelectingUTxOToDecommit {selectingUTxOToDecommitForm :: UTxORadioFieldForm (HydraEvent Tx) Name}
| EnteringAmount {utxoSelected :: (TxIn, TxOut CtxUTxO), enteringAmountForm :: Form Integer (HydraEvent Tx) Name}
| SelectingRecipient {utxoSelected :: (TxIn, TxOut CtxUTxO), amountEntered :: Integer, selectingRecipientForm :: Form AddressInEra (HydraEvent Tx) Name}
| ConfirmingClose {confirmingCloseForm :: ConfirmingRadioFieldForm (HydraEvent Tx) Name}
Expand All @@ -70,7 +70,7 @@ data HeadState

data ActiveLink = ActiveLink
{ utxo :: UTxO
, pendingUTxOToDecrement :: UTxO
, pendingUTxOToDecommit :: UTxO
, parties :: [Party]
, headId :: HeadId
, activeHeadState :: ActiveHeadState
Expand All @@ -87,7 +87,7 @@ type Name = Text

makeLensesFor
[ ("selectingUTxOForm", "selectingUTxOFormL")
, ("selectingUTxOToDecrementForm", "selectingUTxOToDecrementFormL")
, ("selectingUTxOToDecommitForm", "selectingUTxOToDecommitFormL")
, ("enteringAmountForm", "enteringAmountFormL")
, ("selectingRecipientForm", "selectingRecipientFormL")
, ("confirmingCloseForm", "confirmingCloseFormL")
Expand Down Expand Up @@ -140,7 +140,7 @@ makeLensesFor

makeLensesFor
[ ("utxo", "utxoL")
, ("pendingUTxOToDecrement", "pendingUTxOToDecrementL")
, ("pendingUTxOToDecommit", "pendingUTxOToDecommitL")
, ("parties", "partiesL")
, ("activeHeadState", "activeHeadStateL")
, ("headId", "headIdL")
Expand Down Expand Up @@ -174,6 +174,6 @@ newActiveLink parties headId =
}
}
, utxo = mempty
, pendingUTxOToDecrement = mempty
, pendingUTxOToDecommit = mempty
, headId
}

0 comments on commit ca38c87

Please sign in to comment.