content: {-# LANGUAGE DataKinds #-}
  {-# LANGUAGE FlexibleContexts #-}
  {-# LANGUAGE NoImplicitPrelude #-}
  {-# LANGUAGE ScopedTypeVariables #-}
  {-# LANGUAGE TemplateHaskell #-}
  {-# LANGUAGE TypeApplications #-}
  {-# LANGUAGE TypeFamilies #-}
  {-# LANGUAGE TypeOperators #-}
  
  -- This example is taken directly from cardano-api, written by Jordan Millar, IOHK
  
  module Cardano.PlutusExample.AlwaysFails
    ( alwaysFailsScript
    , alwaysFailsScriptShortBs
    ) where
  
  import           Prelude hiding (($))
  
  import           Cardano.Api.Shelley (PlutusScript (..), PlutusScriptV1)
  
  import           Codec.Serialise
  import qualified Data.ByteString.Lazy as LBS
  import qualified Data.ByteString.Short as SBS
  
  import qualified Plutus.V1.Ledger.Scripts as Plutus
  import qualified PlutusTx
  import           PlutusTx.Prelude hiding (Semigroup (..), unless)
  
  {-# INLINABLE mkValidator #-}
  mkValidator :: BuiltinData -> BuiltinData -> BuiltinData -> ()
  mkValidator _ _ _ = PlutusTx.Prelude.error ()
  
  validator :: Plutus.Validator
  validator = Plutus.mkValidatorScript $$(PlutusTx.compile [|| mkValidator ||])
  
  script :: Plutus.Script
  script = Plutus.unValidatorScript validator
  
  alwaysFailsScriptShortBs :: SBS.ShortByteString
  alwaysFailsScriptShortBs = SBS.toShort . LBS.toStrict $ serialise script
  
  alwaysFailsScript :: PlutusScript PlutusScriptV1
  alwaysFailsScript = PlutusScriptSerialised alwaysFailsScriptShortBs
  