Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch committed Feb 20, 2024
1 parent d9dc077 commit 700b2c4
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions hydra-node/src/Hydra/Chain/Direct/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,14 @@ import Hydra.Chain.Direct.ScriptRegistry (
)
import Hydra.Chain.Direct.TimeHandle (PointInTime)
import Hydra.Chain.Direct.Tx (
AbortObservation (..),
AbortTxError (..),
CloseObservation (..),
CloseTxError (..),
ClosedThreadOutput (..),
ClosingSnapshot (..),
CollectComObservation (..),
CommitObservation (..),
ContestObservation (..),
ContestTxError (..),
FanoutObservation (..),
FanoutTxError (..),
InitObservation (..),
InitialThreadOutput (..),
Expand All @@ -97,12 +94,9 @@ import Hydra.Chain.Direct.Tx (
fanoutTx,
headIdToPolicyId,
initTx,
observeAbortTx,
observeCloseTx,
observeCollectComTx,
observeCommitTx,
observeContestTx,
observeFanoutTx,
observeInitTx,
txInToHeadSeed,
verificationKeyToOnChainId,
Expand Down Expand Up @@ -730,16 +724,6 @@ observeCollect st tx = do
, seedTxIn
} = st

-- | Observe an abort transition using a 'InitialState' and 'observeAbortTx'.
observeAbort ::
InitialState ->
Tx ->
Maybe (OnChainTx Tx)
observeAbort st tx = do
let utxo = getKnownUTxO st
AbortObservation{headId} <- observeAbortTx utxo tx
pure OnAbortTx{headId}

-- ** OpenState transitions

-- | Observe a close transition using a 'OpenState' and 'observeCloseTx'.
Expand Down Expand Up @@ -773,44 +757,6 @@ observeClose st tx = do
, seedTxIn
} = st

-- ** ClosedState transitions

-- | Observe a fanout transition using a 'ClosedState' and 'observeContestTx'.
-- This function checks the head id and ignores if not relevant.
observeContest ::
ClosedState ->
Tx ->
Maybe (OnChainTx Tx, ClosedState)
observeContest st tx = do
let utxo = getKnownUTxO st
observation <- observeContestTx utxo tx
let ContestObservation{contestedThreadOutput, headId = contestObservationHeadId, snapshotNumber, contesters} = observation
guard (closedStateHeadId == contestObservationHeadId)
let event = OnContestTx{headId = contestObservationHeadId, snapshotNumber}
let st' = st{closedThreadOutput = closedThreadOutput{closedThreadUTxO = contestedThreadOutput, closedContesters = contesters}}
pure (event, st')
where
ClosedState
{ headId = closedStateHeadId
, closedThreadOutput
} = st

-- | Observe a fanout transition using a 'ClosedState' and 'observeFanoutTx'.
observeFanout ::
ClosedState ->
Tx ->
Maybe (OnChainTx Tx)
observeFanout st tx = do
let utxo = getKnownUTxO st
observation <- observeFanoutTx utxo tx
let FanoutObservation{headId = fanoutObservationHeadId} = observation
guard (closedStateHeadId == fanoutObservationHeadId)
pure OnFanoutTx{headId = fanoutObservationHeadId}
where
ClosedState
{ headId = closedStateHeadId
} = st

-- * Generators

-- | Maximum number of parties used in the generators.
Expand Down

0 comments on commit 700b2c4

Please sign in to comment.