Skip to content

Commit

Permalink
hydra-plutus: Remove unused functions (#1699)
Browse files Browse the repository at this point in the history
These are no longer used.
  • Loading branch information
locallycompact authored Oct 15, 2024
2 parents 34c9916 + d45c7fe commit b5b80ef
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
15 changes: 0 additions & 15 deletions hydra-plutus/src/Hydra/Contract/Head.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import Hydra.Data.Party (Party (vkey))
import Hydra.Plutus.Extras (ValidatorType, scriptValidatorHash, wrapValidator)
import PlutusLedgerApi.Common (SerialisedScript, serialiseCompiledCode)
import PlutusLedgerApi.V1.Time (fromMilliSeconds)
import PlutusLedgerApi.V1.Value (valueOf)
import PlutusLedgerApi.V2 (
Address,
CurrencySymbol,
Expand All @@ -44,8 +43,6 @@ import PlutusLedgerApi.V2 (
TxOutRef (..),
UpperBound (..),
Value (Value),
adaSymbol,
adaToken,
)
import PlutusLedgerApi.V2.Contexts (findOwnInput)
import PlutusTx (CompiledCode)
Expand Down Expand Up @@ -542,18 +539,6 @@ checkFanout ScriptContext{scriptContextTxInfo = txInfo} closedDatum numberOfFano
-- Helpers
--------------------------------------------------------------------------------

(&) :: a -> (a -> b) -> b
(&) = flip ($)
{-# INLINEABLE (&) #-}

txOutAdaValue :: TxOut -> Integer
txOutAdaValue o = valueOf (txOutValue o) adaSymbol adaToken
{-# INLINEABLE txOutAdaValue #-}

txInfoAdaFee :: TxInfo -> Integer
txInfoAdaFee tx = valueOf (txInfoFee tx) adaSymbol adaToken
{-# INLINEABLE txInfoAdaFee #-}

makeContestationDeadline :: ContestationPeriod -> ScriptContext -> POSIXTime
makeContestationDeadline cperiod ScriptContext{scriptContextTxInfo} =
case ivTo (txInfoValidRange scriptContextTxInfo) of
Expand Down
6 changes: 0 additions & 6 deletions hydra-plutus/src/Hydra/ScriptContext.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import PlutusLedgerApi.V2 (
Value,
)
import PlutusTx (makeIsDataIndexed)
import PlutusTx.AssocMap (lookup)

-- * Tx info

Expand Down Expand Up @@ -99,11 +98,6 @@ findOwnInput ScriptContext{scriptContextTxInfo = TxInfo{txInfoInputs}, scriptCon
findOwnInput _ = Nothing
{-# INLINEABLE findOwnInput #-}

-- | Find the data corresponding to a data hash, if there is one
findDatum :: DatumHash -> TxInfo -> Maybe Datum
findDatum dsh TxInfo{txInfoData} = lookup dsh txInfoData
{-# INLINEABLE findDatum #-}

-- | Given a UTXO reference and a transaction (`TxInfo`), resolve it to one of the transaction's inputs (`TxInInfo`).
findTxInByTxOutRef :: TxOutRef -> TxInfo -> Maybe TxInInfo
findTxInByTxOutRef outRef TxInfo{txInfoInputs} =
Expand Down
2 changes: 1 addition & 1 deletion weeder.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
roots = [ "^Main.main$" ]
roots = [ "^Main.main$" ,"^Spec.main$" ]
type-class-roots = true

0 comments on commit b5b80ef

Please sign in to comment.