diff --git a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx.hs b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx.hs index f6552f2ccbc..0b7b909344b 100644 --- a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx.hs +++ b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx.hs @@ -16,6 +16,11 @@ {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-} +-- remove TODO node890 +{-# OPTIONS_GHC -Wno-unused-imports #-} +{-# OPTIONS_GHC -Wno-unused-matches #-} +{-# OPTIONS_GHC -Wno-unused-local-binds #-} + -- | -- Copyright: © 2022 IOHK -- License: Apache-2.0 @@ -153,10 +158,6 @@ import Cardano.Crypto.Hash import Cardano.Ledger.Allegra.Scripts ( translateTimelock ) -import Cardano.Ledger.Alonzo.Plutus.TxInfo - ( EraPlutusContext - , ExtendedUTxO - ) import Cardano.Ledger.Alonzo.Scripts ( AlonzoScript (..) ) @@ -344,11 +345,11 @@ type RecentEraConstraints era = , Core.Tx era ~ Babbage.AlonzoTx era , Core.Value era ~ Value , Core.TxWits era ~ AlonzoTxWits era - , ExtendedUTxO era + -- , ExtendedUTxO era , Alonzo.AlonzoEraPParams era , Ledger.AlonzoEraTx era , ScriptsNeeded era ~ AlonzoScriptsNeeded era - , EraPlutusContext 'PlutusV1 era + -- , EraPlutusContext 'PlutusV1 era , Eq (TxOut era) , Ledger.Crypto (Core.EraCrypto era) , Show (TxOut era) @@ -535,7 +536,7 @@ type ScriptHash = Core.ScriptHash StandardCrypto type Value = MaryValue StandardCrypto unsafeAddressFromBytes :: ByteString -> Address -unsafeAddressFromBytes bytes = case Ledger.deserialiseAddr bytes of +unsafeAddressFromBytes bytes = case Ledger.decodeAddr bytes of Just addr -> addr Nothing -> error "unsafeAddressFromBytes: failed to deserialise" @@ -599,8 +600,8 @@ recentEraToBabbageTxOut (TxOutInRecentEra addr val datum mscript) = castScript = \case Alonzo.TimelockScript timelockEra -> Alonzo.TimelockScript (translateTimelock timelockEra) - Alonzo.PlutusScript bs -> - Alonzo.PlutusScript bs + Alonzo.PlutusScript _bs -> + Alonzo.PlutusScript (error "TODO node890") -- -- MinimumUTxO @@ -804,7 +805,8 @@ evaluateMinimumFee pp tx kwc = KeyWitnessCounts {nKeyWits, nBootstrapWits} = kwc mainFee :: Coin - mainFee = Shelley.evaluateTransactionFee pp tx nKeyWits + mainFee = error "TODO node890" + -- Shelley.evaluateTransactionFee pp tx nKeyWits FeePerByte feePerByte = getFeePerByte pp diff --git a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Redeemers.hs b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Redeemers.hs index f0c9eed36ed..b00e839d364 100644 --- a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Redeemers.hs +++ b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Redeemers.hs @@ -22,9 +22,6 @@ module Internal.Cardano.Write.Tx.Redeemers import Prelude -import Cardano.Ledger.Alonzo.Plutus.TxInfo - ( TranslationError - ) import Cardano.Ledger.Api ( Tx , bodyTxL @@ -100,10 +97,8 @@ import Internal.Cardano.Write.Tx.TimeTranslation , systemStartTime ) -import qualified Cardano.Ledger.Alonzo.PlutusScriptApi as Alonzo import qualified Cardano.Ledger.Alonzo.Scripts as Alonzo import qualified Cardano.Ledger.Alonzo.Tx as Alonzo -import qualified Cardano.Ledger.Alonzo.TxWits as Alonzo import qualified Cardano.Ledger.Api as Ledger import qualified Cardano.Ledger.Plutus.Data as Alonzo import qualified Data.ByteString.Lazy as BL @@ -111,6 +106,7 @@ import qualified Data.Map as Map import qualified Data.Map.Merge.Strict as Map import qualified Data.Set as Set import qualified Data.Text as T +import qualified Cardano.Ledger.Api as Alonzo data ErrAssignRedeemers = ErrAssignRedeemersScriptFailure Redeemer String @@ -150,7 +146,7 @@ assignScriptRedeemers pparams timeTranslation utxo redeemers tx = do assignNullRedeemers :: Tx era -> Either ErrAssignRedeemers - ( Map Alonzo.RdmrPtr Redeemer + ( Map xxx Redeemer , Tx era ) assignNullRedeemers ledgerTx = do @@ -180,10 +176,10 @@ assignScriptRedeemers pparams timeTranslation utxo redeemers tx = do -- | Evaluate execution units of each script/redeemer in the transaction. -- This may fail for each script. evaluateExecutionUnits - :: Map Alonzo.RdmrPtr Redeemer + :: Map xxx Redeemer -> Tx era -> Either ErrAssignRedeemers - (Map Alonzo.RdmrPtr (Either ErrAssignRedeemers Alonzo.ExUnits)) + (Map xxx (Either ErrAssignRedeemers Alonzo.ExUnits)) evaluateExecutionUnits indexedRedeemers ledgerTx = Ledger.evalTxExUnits pparams ledgerTx utxo epochInformation systemStart @@ -193,16 +189,16 @@ assignScriptRedeemers pparams timeTranslation utxo redeemers tx = do hoistScriptFailure :: Show scriptFailure - => Map Alonzo.RdmrPtr Redeemer - -> Map Alonzo.RdmrPtr (Either scriptFailure a) - -> Map Alonzo.RdmrPtr (Either ErrAssignRedeemers a) + => Map xxx Redeemer + -> Map xxx (Either scriptFailure a) + -> Map xxx (Either ErrAssignRedeemers a) hoistScriptFailure indexedRedeemers = Map.mapWithKey $ \ptr -> left $ \e -> ErrAssignRedeemersScriptFailure (indexedRedeemers ! ptr) (show e) -- | Change execution units for each redeemers in the transaction to what -- they ought to be. assignExecutionUnits - :: Map Alonzo.RdmrPtr (Either ErrAssignRedeemers Alonzo.ExUnits) + :: Map xxx (Either ErrAssignRedeemers Alonzo.ExUnits) -> Tx era -> Either ErrAssignRedeemers (Tx era) assignExecutionUnits exUnits ledgerTx = do @@ -273,7 +269,7 @@ redeemerData = \case toScriptPurpose :: IsRecentEra era => Redeemer - -> Alonzo.ScriptPurpose era + -> yyy era toScriptPurpose = \case RedeemerSpending _ txin -> Alonzo.Spending txin