{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-specialize #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:conservative-optimisation #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:defer-errors #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:target-version=1.0.0 #-}
module Hydra.Contract.Deposit where
import PlutusTx.Prelude
import Hydra.Contract.Commit (Commit)
import PlutusLedgerApi.V3 (
CurrencySymbol,
Datum (Datum),
POSIXTime,
Redeemer (Redeemer),
)
import PlutusLedgerApi.V3 qualified as PlutusV3
import PlutusTx (toBuiltinData)
import PlutusTx qualified
data DepositRedeemer
=
Claim CurrencySymbol
|
Recover Integer
PlutusTx.unstableMakeIsData ''DepositRedeemer
type DepositDatum = (CurrencySymbol, POSIXTime, [Commit])
datum :: DepositDatum -> PlutusV3.Datum
datum :: DepositDatum -> Datum
datum DepositDatum
a = BuiltinData -> Datum
Datum (DepositDatum -> BuiltinData
forall a. ToData a => a -> BuiltinData
toBuiltinData DepositDatum
a)
redeemer :: DepositRedeemer -> Redeemer
redeemer :: DepositRedeemer -> Redeemer
redeemer DepositRedeemer
a = BuiltinData -> Redeemer
Redeemer (DepositRedeemer -> BuiltinData
forall a. ToData a => a -> BuiltinData
toBuiltinData DepositRedeemer
a)