Skip to content

Commit b5b80ef

Browse files
hydra-plutus: Remove unused functions (#1699)
These are no longer used.
2 parents 34c9916 + d45c7fe commit b5b80ef

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

hydra-plutus/src/Hydra/Contract/Head.hs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import Hydra.Data.Party (Party (vkey))
2222
import Hydra.Plutus.Extras (ValidatorType, scriptValidatorHash, wrapValidator)
2323
import PlutusLedgerApi.Common (SerialisedScript, serialiseCompiledCode)
2424
import PlutusLedgerApi.V1.Time (fromMilliSeconds)
25-
import PlutusLedgerApi.V1.Value (valueOf)
2625
import PlutusLedgerApi.V2 (
2726
Address,
2827
CurrencySymbol,
@@ -44,8 +43,6 @@ import PlutusLedgerApi.V2 (
4443
TxOutRef (..),
4544
UpperBound (..),
4645
Value (Value),
47-
adaSymbol,
48-
adaToken,
4946
)
5047
import PlutusLedgerApi.V2.Contexts (findOwnInput)
5148
import PlutusTx (CompiledCode)
@@ -542,18 +539,6 @@ checkFanout ScriptContext{scriptContextTxInfo = txInfo} closedDatum numberOfFano
542539
-- Helpers
543540
--------------------------------------------------------------------------------
544541

545-
(&) :: a -> (a -> b) -> b
546-
(&) = flip ($)
547-
{-# INLINEABLE (&) #-}
548-
549-
txOutAdaValue :: TxOut -> Integer
550-
txOutAdaValue o = valueOf (txOutValue o) adaSymbol adaToken
551-
{-# INLINEABLE txOutAdaValue #-}
552-
553-
txInfoAdaFee :: TxInfo -> Integer
554-
txInfoAdaFee tx = valueOf (txInfoFee tx) adaSymbol adaToken
555-
{-# INLINEABLE txInfoAdaFee #-}
556-
557542
makeContestationDeadline :: ContestationPeriod -> ScriptContext -> POSIXTime
558543
makeContestationDeadline cperiod ScriptContext{scriptContextTxInfo} =
559544
case ivTo (txInfoValidRange scriptContextTxInfo) of

hydra-plutus/src/Hydra/ScriptContext.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import PlutusLedgerApi.V2 (
2828
Value,
2929
)
3030
import PlutusTx (makeIsDataIndexed)
31-
import PlutusTx.AssocMap (lookup)
3231

3332
-- * Tx info
3433

@@ -99,11 +98,6 @@ findOwnInput ScriptContext{scriptContextTxInfo = TxInfo{txInfoInputs}, scriptCon
9998
findOwnInput _ = Nothing
10099
{-# INLINEABLE findOwnInput #-}
101100

102-
-- | Find the data corresponding to a data hash, if there is one
103-
findDatum :: DatumHash -> TxInfo -> Maybe Datum
104-
findDatum dsh TxInfo{txInfoData} = lookup dsh txInfoData
105-
{-# INLINEABLE findDatum #-}
106-
107101
-- | Given a UTXO reference and a transaction (`TxInfo`), resolve it to one of the transaction's inputs (`TxInInfo`).
108102
findTxInByTxOutRef :: TxOutRef -> TxInfo -> Maybe TxInInfo
109103
findTxInByTxOutRef outRef TxInfo{txInfoInputs} =

weeder.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
roots = [ "^Main.main$" ]
1+
roots = [ "^Main.main$" ,"^Spec.main$" ]
22
type-class-roots = true

0 commit comments

Comments
 (0)