Skip to content

Commit

Permalink
getHeadInput: Use case split instead of fromMaybe
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Nov 30, 2023
1 parent 9ede5b2 commit 76946a2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hydra-plutus/src/Hydra/Contract/Head.hs
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,9 @@ makeContestationDeadline cperiod ScriptContext{scriptContextTxInfo} =
{-# INLINEABLE makeContestationDeadline #-}

getHeadInput :: ScriptContext -> TxInInfo
getHeadInput ctx =
fromMaybe
(traceError $(errorCode ScriptNotSpendingAHeadInput))
(findOwnInput ctx)
getHeadInput ctx = case findOwnInput ctx of
Nothing -> traceError $(errorCode ScriptNotSpendingAHeadInput)
Just x -> x
{-# INLINEABLE getHeadInput #-}

getHeadAddress :: ScriptContext -> Address
Expand Down

0 comments on commit 76946a2

Please sign in to comment.