Skip to content

Commit

Permalink
Merge pull request #725 from input-output-hk/ch1bo/head-logic-refactor
Browse files Browse the repository at this point in the history
Refactor HeadLogic with types for each state
  • Loading branch information
ch1bo authored Feb 22, 2023
2 parents 62384c9 + 237fd61 commit 056da80
Show file tree
Hide file tree
Showing 9 changed files with 1,655 additions and 3,061 deletions.
4 changes: 2 additions & 2 deletions hydra-node/exe/hydra-node/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Hydra.Chain.Direct (initialChainState, loadChainContext, mkTinyWallet, wi
import Hydra.Chain.Direct.ScriptRegistry (publishHydraScripts)
import Hydra.Chain.Direct.State (ChainStateAt (..))
import Hydra.Chain.Direct.Util (readKeyPair)
import Hydra.HeadLogic (Environment (..), Event (..), HeadState (..), defaultTTL, getChainState)
import Hydra.HeadLogic (Environment (..), Event (..), HeadState (..), IdleState (..), defaultTTL, getChainState)
import qualified Hydra.Ledger.Cardano as Ledger
import Hydra.Ledger.Cardano.Configuration (
newGlobals,
Expand Down Expand Up @@ -69,7 +69,7 @@ main = do
load persistence >>= \case
Nothing -> do
traceWith tracer CreatedState
pure IdleState{chainState = initialChainState}
pure $ Idle IdleState{chainState = initialChainState}
Just a -> do
traceWith tracer LoadedState
pure a
Expand Down
Loading

0 comments on commit 056da80

Please sign in to comment.