Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hydra-plutus: Remove unused functions #1699

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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