diff --git a/plutus-chain-index-core/src/Plutus/ChainIndex/Tx.hs b/plutus-chain-index-core/src/Plutus/ChainIndex/Tx.hs index 4d43287463..283ca10a2f 100644 --- a/plutus-chain-index-core/src/Plutus/ChainIndex/Tx.hs +++ b/plutus-chain-index-core/src/Plutus/ChainIndex/Tx.hs @@ -39,6 +39,7 @@ module Plutus.ChainIndex.Tx( ) where import Cardano.Api (NetworkId) +import Data.List (sort) import Data.Map (Map) import Data.Map qualified as Map import Data.Set (Set) @@ -89,7 +90,7 @@ fromOnChainTx networkId = \case let (validatorHashes, otherDataHashes, redeemers) = validators txInputs in ChainIndexTx { _citxTxId = txId tx - , _citxInputs = Set.toList txInputs + , _citxInputs = txInputs , _citxOutputs = case traverse (toCardanoTxOut networkId toCardanoTxOutDatumHash) txOutputs of Right txs -> either (const InvalidTx) ValidTx $ traverse fromCardanoTxOut txs Left _ -> InvalidTx @@ -107,7 +108,7 @@ fromOnChainTx networkId = \case let (validatorHashes, otherDataHashes, redeemers) = validators txInputs in ChainIndexTx { _citxTxId = txId tx - , _citxInputs = Set.toList txCollateral + , _citxInputs = txCollateral , _citxOutputs = InvalidTx , _citxValidRange = txValidRange , _citxData = txData <> otherDataHashes @@ -130,12 +131,10 @@ mintingPolicies = Map.fromList . fmap withHash . Set.toList withHash mp = let (MintingPolicyHash mph) = mintingPolicyHash mp in (ScriptHash mph, getMintingPolicy mp) -validators :: Set TxIn -> (Map ScriptHash Script, Map DatumHash Datum, Redeemers) -validators txIns = foldMap (\(ix, txIn) -> maybe mempty (withHash ix) $ txInType txIn) $ zip [0..] (Set.toList txIns) +validators :: [TxIn] -> (Map ScriptHash Script, Map DatumHash Datum, Redeemers) +validators = foldMap (\(ix, txIn) -> maybe mempty (withHash ix) $ txInType txIn) . zip [0..] . sort + -- we sort the inputs to make sure that the indices match with redeemer pointers where - -- TODO: the index of the txin is probably incorrect as we take it from the set. - -- To determine the proper index we have to convert the plutus's `TxIn` to cardano-api `TxIn` and - -- sort them by using the standard `Ord` instance. withHash ix (ConsumeScriptAddress val red dat) = let (ValidatorHash vh) = validatorHash val in ( Map.singleton (ScriptHash vh) (getValidator val) diff --git a/plutus-contract/src/Plutus/Contract/Test.hs b/plutus-contract/src/Plutus/Contract/Test.hs index a4c612b42c..d34a4c1042 100644 --- a/plutus-contract/src/Plutus/Contract/Test.hs +++ b/plutus-contract/src/Plutus/Contract/Test.hs @@ -697,7 +697,7 @@ assertAccumState contract inst p nm = TracePredicate $ let result = p w unless result $ do tell @(Doc Void) $ vsep - [ "Accumulated state of of" <+> pretty inst <> colon + [ "Accumulated state of" <+> pretty inst <> colon , indent 2 (viaShow w) , "Failed" <+> squotes (fromString nm) ] diff --git a/plutus-contract/src/Plutus/Contract/Test/ContractModel/DoubleSatisfaction.hs b/plutus-contract/src/Plutus/Contract/Test/ContractModel/DoubleSatisfaction.hs index 8d04cdc396..3777659b3e 100644 --- a/plutus-contract/src/Plutus/Contract/Test/ContractModel/DoubleSatisfaction.hs +++ b/plutus-contract/src/Plutus/Contract/Test/ContractModel/DoubleSatisfaction.hs @@ -43,7 +43,6 @@ import Data.Default import Data.Either import Data.Map qualified as Map import Data.Maybe -import Data.Set qualified as Set import Ledger.Params (EmulatorEra, Params) import Ledger (unPaymentPrivateKey, unPaymentPubKeyHash) @@ -298,12 +297,12 @@ showPretty cand = show . vcat $ | let tx0 = cand ^. to dsceTargetMattersProof . dsTx tx1 = cand ^. to dsceValueStolenProof . dsTx tx2 = cand ^. to dsceOriginalTransaction . dsTx - , ref <- Set.toList $ tx0 ^. inputs - <> tx1 ^. inputs - <> tx2 ^. inputs - <> tx0 ^. collateralInputs - <> tx1 ^. collateralInputs - <> tx2 ^. collateralInputs + , ref <- tx0 ^. inputs + <> tx1 ^. inputs + <> tx2 ^. inputs + <> tx0 ^. collateralInputs + <> tx1 ^. collateralInputs + <> tx2 ^. collateralInputs ] isVulnerable :: DoubleSatisfactionCounterexample -> Bool @@ -369,7 +368,7 @@ doubleSatisfactionCounterexamples dsc = & dsTx .~ tx , let valueStolen0 = dsc & l . outAddress .~ stealerAddr & dsTx . outputs %~ (withDatumOut:) - & dsTx . inputs %~ (Set.insert newFakeTxIn) + & dsTx . inputs %~ (newFakeTxIn:) & dsUtxoIndex %~ (\ (UtxoIndex m) -> UtxoIndex $ Map.insert newFakeTxOutRef newFakeTxScriptOut m) diff --git a/plutus-contract/src/Plutus/Contract/Wallet.hs b/plutus-contract/src/Plutus/Contract/Wallet.hs index c575a7f655..d71b62b6e6 100644 --- a/plutus-contract/src/Plutus/Contract/Wallet.hs +++ b/plutus-contract/src/Plutus/Contract/Wallet.hs @@ -41,6 +41,7 @@ import Data.Map (Map) import Data.Map qualified as Map import Data.Maybe (mapMaybe) import Data.OpenApi qualified as OpenApi +import Data.Semigroup qualified as Semigroup import Data.Set qualified as Set import Data.Typeable (Typeable) import Data.Void (Void) @@ -118,7 +119,7 @@ getUnspentOutput = do let constraints = mustPayToPubKey ownPkh (Ada.lovelaceValueOf 1) utx <- either (throwing _ConstraintResolutionContractError) pure (mkTx @Void mempty constraints) tx <- Contract.adjustUnbalancedTx utx >>= Contract.balanceTx - case Set.lookupMin (getCardanoTxInputs tx) of + case fmap Semigroup.getMin $ foldMap (Just . Semigroup.Min) $ getCardanoTxInputs tx of Just inp -> pure $ txInRef inp Nothing -> throwing _OtherContractError "Balanced transaction has no inputs" @@ -282,7 +283,7 @@ mkRedeemers :: P.Tx -> Either CardanoAPI.ToCardanoError [ExportTxRedeemer] mkRedeemers tx = (++) <$> mkSpendingRedeemers tx <*> mkMintingRedeemers tx mkSpendingRedeemers :: P.Tx -> Either CardanoAPI.ToCardanoError [ExportTxRedeemer] -mkSpendingRedeemers P.Tx{P.txInputs} = fmap join (traverse extract $ Set.toList txInputs) where +mkSpendingRedeemers P.Tx{P.txInputs} = fmap join (traverse extract txInputs) where extract PV1.TxIn{PV1.txInType=Just (PV1.ConsumeScriptAddress _ redeemer _), PV1.txInRef} = pure [SpendingRedeemer{redeemer, redeemerOutRef=txInRef}] extract _ = pure [] diff --git a/plutus-contract/src/Wallet/Emulator/Wallet.hs b/plutus-contract/src/Wallet/Emulator/Wallet.hs index ab989ed4b7..9862378d51 100644 --- a/plutus-contract/src/Wallet/Emulator/Wallet.hs +++ b/plutus-contract/src/Wallet/Emulator/Wallet.hs @@ -37,6 +37,7 @@ import Data.Bifunctor (bimap, first, second) import Data.Data import Data.Default (Default (def)) import Data.Foldable (Foldable (fold), find, foldl') +import Data.List (sort) import Data.Map qualified as Map import Data.Maybe (catMaybes, fromMaybe, isNothing, listToMaybe) import Data.OpenApi.Schema qualified as OpenApi @@ -438,11 +439,11 @@ handleBalanceTx :: handleBalanceTx utxo utx = do Params { pProtocolParams } <- WAPI.getClientParams let filteredUnbalancedTxTx = removeEmptyOutputs (view U.tx utx) - let txInputs = Set.toList $ Tx.txInputs filteredUnbalancedTxTx + let txInputs = Tx.txInputs filteredUnbalancedTxTx ownPaymentPubKey <- gets ownPaymentPublicKey let ownStakePubKey = Nothing - inputValues <- traverse lookupValue (Set.toList $ Tx.txInputs filteredUnbalancedTxTx) - collateral <- traverse lookupValue (Set.toList $ Tx.txCollateral filteredUnbalancedTxTx) + inputValues <- traverse lookupValue (Tx.txInputs filteredUnbalancedTxTx) + collateral <- traverse lookupValue (Tx.txCollateral filteredUnbalancedTxTx) let fees = txFee filteredUnbalancedTxTx left = txMint filteredUnbalancedTxTx <> fold inputValues right = fees <> foldMap (view Tx.outValue) (filteredUnbalancedTxTx ^. Tx.outputs) @@ -520,8 +521,8 @@ addCollateral addCollateral mp vl tx = do (spend, _) <- selectCoin (filter (Value.isAdaOnlyValue . snd) (second (view Ledger.ciTxOutValue) <$> Map.toList mp)) vl let addTxCollateral = - let ins = Set.fromList (Tx.pubKeyTxIn . fst <$> spend) - in over Tx.collateralInputs (Set.union ins) + let ins = Tx.pubKeyTxIn . fst <$> spend + in over Tx.collateralInputs (sort . (++) ins) pure $ tx & addTxCollateral -- | @addInputs mp pk vl tx@ selects transaction outputs worth at least @@ -541,8 +542,8 @@ addInputs mp pk sk vl tx = do let addTxIns = - let ins = Set.fromList (Tx.pubKeyTxIn . fst <$> spend) - in over Tx.inputs (Set.union ins) + let ins = Tx.pubKeyTxIn . fst <$> spend + in over Tx.inputs (sort . (++) ins) addTxOut = if Value.isZero change diff --git a/plutus-contract/src/Wallet/Graph.hs b/plutus-contract/src/Wallet/Graph.hs index 0c6264540f..358be0220c 100644 --- a/plutus-contract/src/Wallet/Graph.hs +++ b/plutus-contract/src/Wallet/Graph.hs @@ -109,7 +109,7 @@ txnFlows keys bc = catMaybes (utxoLinks ++ foldMap extract bc') extract :: (UtxoLocation, OnChainTx) -> [Maybe FlowLink] extract (loc, tx) = let targetRef = mkRef $ eitherTx getCardanoTxId getCardanoTxId tx in - fmap (flow (Just loc) targetRef . txInRef) (Set.toList $ consumableInputs tx) + fmap (flow (Just loc) targetRef . txInRef) (consumableInputs tx) -- make a flow for a TxOutRef flow :: Maybe UtxoLocation -> TxRef -> TxOutRef -> Maybe FlowLink diff --git a/plutus-contract/src/Wallet/Rollup.hs b/plutus-contract/src/Wallet/Rollup.hs index b118abe0eb..6ee1ecc4dc 100644 --- a/plutus-contract/src/Wallet/Rollup.hs +++ b/plutus-contract/src/Wallet/Rollup.hs @@ -20,7 +20,6 @@ import Control.Monad.State (StateT, evalStateT, runState) import Data.List (groupBy) import Data.Map (Map) import Data.Map qualified as Map -import Data.Set qualified as Set import Ledger (Block, Blockchain, OnChainTx (..), TxIn (TxIn), TxOut (TxOut), ValidationPhase (..), Value, consumableInputs, eitherTx, outValue, txInRef, txOutRefId, txOutRefIdx, txOutValue) import Ledger.Tx qualified as Tx @@ -48,7 +47,7 @@ annotateTransaction sequenceId tx = do in case Map.lookup key cPreviousOutputs of Just txOut -> pure $ DereferencedInput txIn txOut Nothing -> pure $ InputNotFound key) - (Set.toList $ consumableInputs tx) + (consumableInputs tx) let txId = eitherTx Tx.getCardanoTxId Tx.getCardanoTxId tx txOuts = eitherTx (const []) Tx.getCardanoTxOutputs tx newOutputs = diff --git a/plutus-contract/test/Spec/Emulator.hs b/plutus-contract/test/Spec/Emulator.hs index 81c48df86f..039cf92269 100644 --- a/plutus-contract/test/Spec/Emulator.hs +++ b/plutus-contract/test/Spec/Emulator.hs @@ -21,7 +21,6 @@ import Data.ByteString.Lazy qualified as BSL import Data.ByteString.Lazy.Char8 (pack) import Data.Default (Default (def)) import Data.Foldable (fold) -import Data.Set qualified as Set import Hedgehog (Property, forAll, property) import Hedgehog qualified import Hedgehog.Gen qualified as Gen @@ -222,7 +221,7 @@ invalidScript = property $ do let totalVal = txOutValue (fst outToSpend) -- try and spend the script output - invalidTxn <- forAll $ Gen.genValidTransactionSpending (Set.fromList [scriptTxIn (snd outToSpend) failValidator unitRedeemer unitDatum]) totalVal + invalidTxn <- forAll $ Gen.genValidTransactionSpending [scriptTxIn (snd outToSpend) failValidator unitRedeemer unitDatum] totalVal Hedgehog.annotateShow invalidTxn let options = defaultCheckOptions & emulatorConfig . Trace.initialChainState .~ Right m diff --git a/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions.txt b/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions.txt index cc4d03c674..2e95bb602f 100644 --- a/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions.txt +++ b/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions.txt @@ -10,45 +10,45 @@ Slot 00001: W[10]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83 Slot 00001: W[9]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83ccc2b595233a03d8c7f3050edcde40fb1d27565412b4653a8510, BlockNumber 0). UTxO state was added to the end. Slot 00001: W[3]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83ccc2b595233a03d8c7f3050edcde40fb1d27565412b4653a8510, BlockNumber 0). UTxO state was added to the end. Slot 00001: W[5]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83ccc2b595233a03d8c7f3050edcde40fb1d27565412b4653a8510, BlockNumber 0). UTxO state was added to the end. -Slot 00001: W[1]: TxSubmit: 610351dd823226aa802cbcb93ac89734ed6f420d1e70b62dceaac7c8f2b3f14f -Slot 00001: TxnValidate 610351dd823226aa802cbcb93ac89734ed6f420d1e70b62dceaac7c8f2b3f14f +Slot 00001: W[1]: TxSubmit: b91e02d63ba2ed728309a102ed4190234653b4063fd1906b94db34ae44a97e48 +Slot 00001: TxnValidate b91e02d63ba2ed728309a102ed4190234653b4063fd1906b94db34ae44a97e48 Slot 00001: SlotAdd Slot 2 -Slot 00002: W[7]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[8]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[6]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[4]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[2]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[1]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[10]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[9]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[3]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[5]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 659b01c443f845981b0b970cd2494b8f6247063b4ee3dd54ab76b0b3c7efef2a, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[2]: TxSubmit: 00b163087f3b4135768514c09917bbc76f80bef200448d0de0b15f6d83b94c99 -Slot 00002: TxnValidate 00b163087f3b4135768514c09917bbc76f80bef200448d0de0b15f6d83b94c99 +Slot 00002: W[7]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[8]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[6]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[4]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[2]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[1]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[10]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[9]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[3]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[5]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 229627c5ab15c412b0f5e43c8a98f66dc2525dd9641d8cf220b7dd7f3a4b718d, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[2]: TxSubmit: 91e7aa04cc4f59696b02fd93448b3bd2d4dc976c562c4b3fbcffaa8f43fe2777 +Slot 00002: TxnValidate 91e7aa04cc4f59696b02fd93448b3bd2d4dc976c562c4b3fbcffaa8f43fe2777 Slot 00002: SlotAdd Slot 3 -Slot 00003: W[7]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[8]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[6]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[4]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[2]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[1]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[10]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[9]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[3]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[5]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2c0ac0c0b6a7085f872d92f096b184a99abfaa91d945de72a40583bbe80fdc6a, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[3]: TxSubmit: 919833072f506be9089ddd66c42879a19f5eb685de7a1ac2572fd698f96dae7b -Slot 00003: TxnValidate 919833072f506be9089ddd66c42879a19f5eb685de7a1ac2572fd698f96dae7b +Slot 00003: W[7]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[8]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[6]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[4]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[2]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[1]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[10]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[9]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[3]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[5]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 2d20f68f1fb63efe16c74d8684ee1f51a52c01b770a03ddb55d2a8eeadcc91d9, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[3]: TxSubmit: b33c5125227f61375189d600c649414a307cadc28c83e1453c91b6cbc8d21c3b +Slot 00003: TxnValidate b33c5125227f61375189d600c649414a307cadc28c83e1453c91b6cbc8d21c3b Slot 00003: SlotAdd Slot 4 -Slot 00004: W[7]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[8]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[6]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[4]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[2]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[1]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[10]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[9]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[3]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[5]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 738dfaf6c5834bfb87f57f4373b12045c21f49f5a6e6c1313b2bd198c240b558, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[7]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[8]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[6]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[4]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[2]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[1]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[10]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[9]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[3]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[5]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 5a5865b2264dcc829d41d931eec3da78e23dd98b0fcd9df2660688b5ba9c31c0, BlockNumber 3). UTxO state was added to the end. Slot 00004: SlotAdd Slot 5 Final balances Wallet 7: diff --git a/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions2.txt b/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions2.txt index 021bf918ed..d60babe19f 100644 --- a/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions2.txt +++ b/plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions2.txt @@ -10,58 +10,58 @@ Slot 00001: W[10]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83 Slot 00001: W[9]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83ccc2b595233a03d8c7f3050edcde40fb1d27565412b4653a8510, BlockNumber 0). UTxO state was added to the end. Slot 00001: W[3]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83ccc2b595233a03d8c7f3050edcde40fb1d27565412b4653a8510, BlockNumber 0). UTxO state was added to the end. Slot 00001: W[5]: InsertionSuccess: New tip is Tip(Slot 1, BlockId 226f7395cf83ccc2b595233a03d8c7f3050edcde40fb1d27565412b4653a8510, BlockNumber 0). UTxO state was added to the end. -Slot 00001: W[1]: TxSubmit: 625887dc6718ba047cdb76de761668e6abe72f9146b2a30d5a79f3e9ecedd203 -Slot 00001: TxnValidate 625887dc6718ba047cdb76de761668e6abe72f9146b2a30d5a79f3e9ecedd203 +Slot 00001: W[1]: TxSubmit: 29794539596b3da0c417c61609f64698c4b7eda3d0691089378593690273d828 +Slot 00001: TxnValidate 29794539596b3da0c417c61609f64698c4b7eda3d0691089378593690273d828 Slot 00001: SlotAdd Slot 2 -Slot 00002: W[7]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[8]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[6]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[4]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[2]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[1]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[10]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[9]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[3]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[5]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 24d9b0513d4177d21412ce1350d3c64177b5ccfc8a3c1429d23e5624438cb4b8, BlockNumber 1). UTxO state was added to the end. -Slot 00002: W[2]: TxSubmit: 76029c073a309db47e261b28d43c83cc250f838ff9e2e221668ba84391d5fb02 -Slot 00002: TxnValidate 76029c073a309db47e261b28d43c83cc250f838ff9e2e221668ba84391d5fb02 +Slot 00002: W[7]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[8]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[6]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[4]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[2]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[1]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[10]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[9]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[3]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[5]: InsertionSuccess: New tip is Tip(Slot 2, BlockId 922239e5d5c2f870ad299964f898cfda3c8a79132d7b573f8986015dc0555139, BlockNumber 1). UTxO state was added to the end. +Slot 00002: W[2]: TxSubmit: 6c2277119c733ab2f5376faaa5ea755665bb1caa972ff2b40bb9f28be50cc6b6 +Slot 00002: TxnValidate 6c2277119c733ab2f5376faaa5ea755665bb1caa972ff2b40bb9f28be50cc6b6 Slot 00002: SlotAdd Slot 3 -Slot 00003: W[7]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[8]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[6]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[4]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[2]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[1]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[10]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[9]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[3]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[5]: InsertionSuccess: New tip is Tip(Slot 3, BlockId bbb440cae7ccaa62924822c4f445cea242a14d8aa27bf5bf1422890a5dedfb41, BlockNumber 2). UTxO state was added to the end. -Slot 00003: W[3]: TxSubmit: 9af0dae6017a51285ea235fb6a469a2a0b479189aec91a8c308e3545bb30bd16 -Slot 00003: TxnValidate 9af0dae6017a51285ea235fb6a469a2a0b479189aec91a8c308e3545bb30bd16 +Slot 00003: W[7]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[8]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[6]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[4]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[2]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[1]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[10]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[9]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[3]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[5]: InsertionSuccess: New tip is Tip(Slot 3, BlockId 98322473e7174156e583632513bbcac85c994e37f09f87da0d69fad329ba8c5d, BlockNumber 2). UTxO state was added to the end. +Slot 00003: W[3]: TxSubmit: 233d4e97daad97ecb44ae90bcfd84477748416917ce403c695e42c56cec84abc +Slot 00003: TxnValidate 233d4e97daad97ecb44ae90bcfd84477748416917ce403c695e42c56cec84abc Slot 00003: SlotAdd Slot 4 -Slot 00004: W[7]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[8]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[6]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[4]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[2]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[1]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[10]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[9]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[3]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[5]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 035f1f17b93cb4fead9160995ea68e6a6ee6708d0115ebd04e21d2cffba9ea32, BlockNumber 3). UTxO state was added to the end. -Slot 00004: W[1]: TxSubmit: 60667f77d037e84e3b23213754cb3288c5c4ffacc44f58428ec3d40cf5cb5c16 -Slot 00004: TxnValidate 60667f77d037e84e3b23213754cb3288c5c4ffacc44f58428ec3d40cf5cb5c16 +Slot 00004: W[7]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[8]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[6]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[4]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[2]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[1]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[10]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[9]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[3]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[5]: InsertionSuccess: New tip is Tip(Slot 4, BlockId 1394dce22c33dc5748ad75381cde43f0b8f1b010d1860aa40e2d85770227bbd7, BlockNumber 3). UTxO state was added to the end. +Slot 00004: W[1]: TxSubmit: ce161e5a2f92aad24477a59ed780fcca988b050189500bc172c0c0a995162a2e +Slot 00004: TxnValidate ce161e5a2f92aad24477a59ed780fcca988b050189500bc172c0c0a995162a2e Slot 00004: SlotAdd Slot 5 -Slot 00005: W[7]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[8]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[6]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[4]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[2]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[1]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[10]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[9]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[3]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. -Slot 00005: W[5]: InsertionSuccess: New tip is Tip(Slot 5, BlockId 3cf66d20f4514d1260a116dc6f067441c822f72da20df453507f590f81b4f6c8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[7]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[8]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[6]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[4]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[2]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[1]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[10]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[9]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[3]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. +Slot 00005: W[5]: InsertionSuccess: New tip is Tip(Slot 5, BlockId e907e1343967ab666604c7f8ceeb18f877f02f4cb2e91900dc658b1a02db62e8, BlockNumber 4). UTxO state was added to the end. Slot 00005: SlotAdd Slot 6 Final balances Wallet 7: @@ -75,7 +75,7 @@ Wallet 4: Wallet 2: {, ""}: 99810255 Wallet 1: - {, ""}: 99595914 + {, ""}: 99601942 Wallet 10: {, ""}: 100000000 Wallet 9: diff --git a/plutus-ledger-constraints/src/Ledger/Constraints/OffChain.hs b/plutus-ledger-constraints/src/Ledger/Constraints/OffChain.hs index 28c0ba990f..e1e8710393 100644 --- a/plutus-ledger-constraints/src/Ledger/Constraints/OffChain.hs +++ b/plutus-ledger-constraints/src/Ledger/Constraints/OffChain.hs @@ -506,7 +506,7 @@ addOwnInput ScriptInputConstraint{icRedeemer, icTxOutRef} = do Typed.typeScriptTxOutRef inst icTxOutRef txOut datum let txIn = Typed.makeTypedScriptTxIn inst icRedeemer typedOutRef vl = Tx.txOutValue $ Typed.tyTxOutTxOut $ Typed.tyTxOutRefOut typedOutRef - unbalancedTx . tx . Tx.inputs %= Set.insert (Typed.tyTxInTxIn txIn) + unbalancedTx . tx . Tx.inputs %= (Typed.tyTxInTxIn txIn :) valueSpentInputs <>= provided vl -- | Add a typed output and return its value. @@ -624,7 +624,7 @@ processConstraint = \case case txout of Tx.PublicKeyChainIndexTxOut { Tx._ciTxOutValue } -> do -- TODO: Add the optional datum in the witness set for the pub key output - unbalancedTx . tx . Tx.inputs %= Set.insert (Tx.pubKeyTxIn txo) + unbalancedTx . tx . Tx.inputs %= (Tx.pubKeyTxIn txo :) valueSpentInputs <>= provided _ciTxOutValue _ -> throwError (TxOutRefWrongType txo) MustSpendScriptOutput txo red -> do @@ -637,7 +637,7 @@ processConstraint = \case -- probably get rid of the 'slOtherData' map and of -- 'lookupDatum' let input = Tx.scriptTxIn txo validator red datum - unbalancedTx . tx . Tx.inputs %= Set.insert input + unbalancedTx . tx . Tx.inputs %= (input :) unbalancedTx . tx . Tx.datumWitnesses . at dvh .= Just datum valueSpentInputs <>= provided value _ -> throwError (TxOutRefWrongType txo) @@ -703,7 +703,7 @@ processConstraintFun = \case [(ref, Just (validator, datum, value))] -> do let dvh = datumHash datum let input = Tx.scriptTxIn ref validator red datum - unbalancedTx . tx . Tx.inputs %= Set.insert input + unbalancedTx . tx . Tx.inputs %= (input :) unbalancedTx . tx . Tx.datumWitnesses . at dvh .= Just datum valueSpentInputs <>= provided value _ -> throwError $ MultipleMatchingOutputsFound vh diff --git a/plutus-ledger-constraints/test/Spec.hs b/plutus-ledger-constraints/test/Spec.hs index 4ca8251635..ffd3a8763b 100644 --- a/plutus-ledger-constraints/test/Spec.hs +++ b/plutus-ledger-constraints/test/Spec.hs @@ -30,6 +30,7 @@ import Ledger.Constraints.OnChain.V1 as Constraints import Ledger.Credential (Credential (PubKeyCredential, ScriptCredential), StakingCredential (StakingHash)) import Ledger.Crypto (PubKeyHash (PubKeyHash)) import Ledger.Generators qualified as Gen +import Ledger.Index qualified as Ledger import Ledger.Params () import Ledger.Tx (Tx (txOutputs), TxOut (TxOut, txOutAddress)) import Ledger.Typed.Scripts qualified as Scripts diff --git a/plutus-ledger/plutus-ledger.cabal b/plutus-ledger/plutus-ledger.cabal index 6a2f205459..697071f175 100644 --- a/plutus-ledger/plutus-ledger.cabal +++ b/plutus-ledger/plutus-ledger.cabal @@ -201,6 +201,7 @@ test-suite plutus-ledger-test -------------------------- build-depends: , cardano-api:{cardano-api, gen} >=1.35 + , cardano-crypto-class >=2.0.0 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 diff --git a/plutus-ledger/src/Ledger.hs b/plutus-ledger/src/Ledger.hs index 2cf3738987..47d0527e9e 100644 --- a/plutus-ledger/src/Ledger.hs +++ b/plutus-ledger/src/Ledger.hs @@ -16,7 +16,7 @@ import Ledger.Orphans () import Ledger.Params as Export import Ledger.Scripts as Export import Ledger.Slot as Export -import Ledger.Tx as Export +import Ledger.Tx as Export hiding (pubKeyTxIns, scriptTxIns) import Ledger.Value as Export (noAdaValue) import Plutus.V1.Ledger.Contexts as Export import Plutus.V1.Ledger.Interval as Export diff --git a/plutus-ledger/src/Ledger/AddressMap.hs b/plutus-ledger/src/Ledger/AddressMap.hs index c218644cd4..1fc75ddfac 100644 --- a/plutus-ledger/src/Ledger/AddressMap.hs +++ b/plutus-ledger/src/Ledger/AddressMap.hs @@ -183,7 +183,6 @@ inputs :: inputs addrs = Map.fromListWith Set.union . fmap (fmap Set.singleton . swap) . mapMaybe ((\a -> sequence (a, Map.lookup a addrs)) . txInRef) - . Set.toList . consumableInputs -- | Restrict an 'AddressMap' to a set of addresses. diff --git a/plutus-ledger/src/Ledger/Blockchain.hs b/plutus-ledger/src/Ledger/Blockchain.hs index 7f52d90773..27fe26c4e0 100644 --- a/plutus-ledger/src/Ledger/Blockchain.hs +++ b/plutus-ledger/src/Ledger/Blockchain.hs @@ -42,7 +42,6 @@ import Data.Map (Map) import Data.Map qualified as Map import Data.Monoid (First (..)) import Data.Proxy (Proxy (..)) -import Data.Set qualified as Set import Data.Text qualified as Text import Data.Text.Encoding (decodeUtf8') import GHC.Generics (Generic) @@ -99,7 +98,7 @@ eitherTx :: (CardanoTx -> r) -> (CardanoTx -> r) -> OnChainTx -> r eitherTx ifInvalid _ (Invalid tx) = ifInvalid tx eitherTx _ ifValid (Valid tx) = ifValid tx -consumableInputs :: OnChainTx -> Set.Set TxIn +consumableInputs :: OnChainTx -> [TxIn] consumableInputs = eitherTx getCardanoTxCollateralInputs getCardanoTxInputs -- | Outputs added to the UTXO set by the 'OnChainTx' diff --git a/plutus-ledger/src/Ledger/Generators.hs b/plutus-ledger/src/Ledger/Generators.hs index 35017338da..036e0d1c86 100644 --- a/plutus-ledger/src/Ledger/Generators.hs +++ b/plutus-ledger/src/Ledger/Generators.hs @@ -191,20 +191,20 @@ genValidTransaction' g (Mockchain _ ops _) = do nUtxo <- if Map.null ops then Gen.discard else Gen.int (Range.linear 1 (Map.size ops)) - let ins = Set.fromList $ pubKeyTxIn . fst <$> inUTXO + let ins = pubKeyTxIn . fst <$> inUTXO inUTXO = take nUtxo $ Map.toList ops totalVal = foldl' (<>) mempty $ map (txOutValue . snd) inUTXO genValidTransactionSpending' g ins totalVal genValidTransactionSpending :: MonadGen m - => Set.Set TxIn + => [TxIn] -> Value -> m Tx genValidTransactionSpending = genValidTransactionSpending' generatorModel genValidTransactionSpending' :: MonadGen m => GeneratorModel - -> Set.Set TxIn + -> [TxIn] -> Value -> m Tx genValidTransactionSpending' g ins totalVal = do diff --git a/plutus-ledger/src/Ledger/Index.hs b/plutus-ledger/src/Ledger/Index.hs index 0ec0648f87..dd550ffbf4 100644 --- a/plutus-ledger/src/Ledger/Index.hs +++ b/plutus-ledger/src/Ledger/Index.hs @@ -35,6 +35,8 @@ module Ledger.Index( minAdaTxOut, minLovelaceTxOut, mkTxInfo, + pubKeyTxIns, + scriptTxIns, -- * Actual validation validateTransaction, validateTransactionOffChain, @@ -53,7 +55,7 @@ module Ledger.Index( import Cardano.Api (Lovelace (..)) import Prelude hiding (lookup) -import Control.Lens (toListOf, view, (^.)) +import Control.Lens (Fold, folding, toListOf, view, (^.)) import Control.Lens.Indexed (iforM_) import Control.Monad import Control.Monad.Except (ExceptT, MonadError (..), runExcept, runExceptT) @@ -76,7 +78,7 @@ import Ledger.Orphans () import Ledger.Params (Params (pSlotConfig)) import Ledger.Slot qualified as Slot import Ledger.TimeSlot qualified as TimeSlot -import Ledger.Tx +import Ledger.Tx hiding (pubKeyTxIns, scriptTxIns) import Ledger.Validation (evaluateMinLovelaceOutput, fromPlutusTxOutUnsafe) import Plutus.Script.Utils.Scripts (datumHash) import Plutus.Script.Utils.V1.Scripts qualified as PV1 @@ -138,6 +140,17 @@ lkpValue = fmap txOutValue . lkpTxOut lkpTxOut :: ValidationMonad m => TxOutRef -> m TxOut lkpTxOut t = lookup t . vctxIndex =<< ask +-- | Filter to get only the script inputs. +scriptTxIns :: Fold ([TxIn]) TxIn +scriptTxIns = (\x -> folding x) . filter $ \case + TxIn{ txInType = Just ConsumeScriptAddress{} } -> True + _ -> False + +-- | Filter to get only the pubkey inputs. +pubKeyTxIns :: Fold ([TxIn]) TxIn +pubKeyTxIns = folding (filter (\TxIn{ txInType = t } -> t == Just ConsumePublicKeyAddress)) + + -- | Validate a transaction in a 'ValidationMonad' context. validateTransaction :: ValidationMonad m => Slot.Slot @@ -168,7 +181,7 @@ validateTransactionOffChain t = do unless emptyUtxoSet (checkMintingAuthorised t) checkValidInputs (toListOf (inputs . pubKeyTxIns)) t - checkValidInputs (Set.toList . view collateralInputs) t + checkValidInputs (view collateralInputs) t (do -- Phase 2 validation @@ -308,7 +321,7 @@ checkMatch txinfo = \case -- | Check if the value produced by a transaction equals the value consumed by it. checkValuePreserved :: ValidationMonad m => Tx -> m () checkValuePreserved t = do - inVal <- (P.+) (txMint t) <$> fmap fold (traverse (lkpValue . txInRef) (Set.toList $ view inputs t)) + inVal <- (P.+) (txMint t) <$> fmap fold (traverse (lkpValue . txInRef) (view inputs t)) let outVal = txFee t P.+ foldMap txOutValue (txOutputs t) if outVal == inVal then pure () @@ -377,7 +390,7 @@ checkTransactionFee tx = mkTxInfo :: ValidationMonad m => Tx -> m TxInfo mkTxInfo tx = do slotCfg <- pSlotConfig . vctxParams <$> ask - txins <- traverse mkIn $ Set.toList $ view inputs tx + txins <- traverse mkIn $ view inputs tx let ptx = TxInfo { txInfoInputs = txins , txInfoOutputs = txOutputs tx diff --git a/plutus-ledger/src/Ledger/Tx.hs b/plutus-ledger/src/Ledger/Tx.hs index 7b2b5ce328..6b33fe5e7c 100644 --- a/plutus-ledger/src/Ledger/Tx.hs +++ b/plutus-ledger/src/Ledger/Tx.hs @@ -204,8 +204,8 @@ pattern CardanoApiEmulatorEraTx tx <- (getEmulatorEraTx -> tx) where instance Pretty CardanoTx where pretty tx = let lines' = - [ hang 2 (vsep ("inputs:" : fmap pretty (Set.toList (getCardanoTxInputs tx)))) - , hang 2 (vsep ("collateral inputs:" : fmap pretty (Set.toList (getCardanoTxCollateralInputs tx)))) + [ hang 2 (vsep ("inputs:" : fmap pretty (getCardanoTxInputs tx))) + , hang 2 (vsep ("collateral inputs:" : fmap pretty (getCardanoTxCollateralInputs tx))) , hang 2 (vsep ("outputs:" : fmap pretty (getCardanoTxOutputs tx))) , "mint:" <+> pretty (getCardanoTxMint tx) , "fee:" <+> pretty (getCardanoTxFee tx) @@ -237,12 +237,12 @@ getCardanoTxId = onCardanoTx txId getCardanoApiTxId getCardanoApiTxId :: SomeCardanoApiTx -> V1.Tx.TxId getCardanoApiTxId (SomeTx (C.Tx body _) _) = CardanoAPI.fromCardanoTxId $ C.getTxId body -getCardanoTxInputs :: CardanoTx -> Set V1.Tx.TxIn +getCardanoTxInputs :: CardanoTx -> [V1.Tx.TxIn] getCardanoTxInputs = onCardanoTx txInputs (\(SomeTx (C.Tx (C.TxBody C.TxBodyContent {..}) _) _) -> - Set.fromList $ fmap ((`V1.Tx.TxIn` Nothing) . CardanoAPI.fromCardanoTxIn . fst) txIns) + fmap ((`V1.Tx.TxIn` Nothing) . CardanoAPI.fromCardanoTxIn . fst) txIns) -getCardanoTxCollateralInputs :: CardanoTx -> Set V1.Tx.TxIn +getCardanoTxCollateralInputs :: CardanoTx -> [V1.Tx.TxIn] getCardanoTxCollateralInputs = onCardanoTx txCollateral (\(SomeTx (C.Tx (C.TxBody C.TxBodyContent {..}) _) _) -> CardanoAPI.fromCardanoTxInsCollateral txInsCollateral) @@ -257,7 +257,7 @@ getCardanoTxUnspentOutputsTx :: CardanoTx -> Map V1.Tx.TxOutRef V1.Tx.TxOut getCardanoTxUnspentOutputsTx = onCardanoTx unspentOutputsTx CardanoAPI.unspentOutputsTx getCardanoTxSpentOutputs :: CardanoTx -> Set V1.Tx.TxOutRef -getCardanoTxSpentOutputs = Set.map V1.Tx.txInRef . getCardanoTxInputs +getCardanoTxSpentOutputs = Set.fromList . map V1.Tx.txInRef . getCardanoTxInputs getCardanoTxFee :: CardanoTx -> V1.Value getCardanoTxFee = onCardanoTx txFee (\(SomeTx (C.Tx (C.TxBody C.TxBodyContent {..}) _) _) -> CardanoAPI.fromCardanoFee txFee) @@ -286,8 +286,8 @@ getCardanoTxData = onCardanoTx txData instance Pretty Tx where pretty t@Tx{txInputs, txCollateral, txOutputs, txMint, txFee, txValidRange, txSignatures, txMintScripts, txData} = let lines' = - [ hang 2 (vsep ("inputs:" : fmap pretty (Set.toList txInputs))) - , hang 2 (vsep ("collateral inputs:" : fmap pretty (Set.toList txCollateral))) + [ hang 2 (vsep ("inputs:" : fmap pretty txInputs)) + , hang 2 (vsep ("collateral inputs:" : fmap pretty txCollateral)) , hang 2 (vsep ("outputs:" : fmap pretty txOutputs)) , "mint:" <+> pretty txMint , "fee:" <+> pretty txFee @@ -315,7 +315,7 @@ updateUtxo tx unspent = (unspent `Map.withoutKeys` getCardanoTxSpentOutputs tx) -- | Update a map of unspent transaction outputs and signatures based -- on the collateral inputs of a transaction (for when it is invalid). updateUtxoCollateral :: CardanoTx -> Map V1.Tx.TxOutRef V1.Tx.TxOut -> Map V1.Tx.TxOutRef V1.Tx.TxOut -updateUtxoCollateral tx unspent = unspent `Map.withoutKeys` (Set.map V1.Tx.txInRef $ getCardanoTxCollateralInputs tx) +updateUtxoCollateral tx unspent = unspent `Map.withoutKeys` (Set.fromList . map V1.Tx.txInRef $ getCardanoTxCollateralInputs tx) -- | A list of a transaction's outputs paired with a 'TxOutRef's referring to them. txOutRefs :: Tx -> [(V1.Tx.TxOut, V1.Tx.TxOutRef)] diff --git a/plutus-ledger/src/Ledger/Tx/CardanoAPI.hs b/plutus-ledger/src/Ledger/Tx/CardanoAPI.hs index b7c032efb7..fe1d8894d0 100644 --- a/plutus-ledger/src/Ledger/Tx/CardanoAPI.hs +++ b/plutus-ledger/src/Ledger/Tx/CardanoAPI.hs @@ -395,7 +395,7 @@ toCardanoTxBodyContent -> P.Tx -> Either ToCardanoError CardanoBuildTx toCardanoTxBodyContent P.Params{P.pProtocolParams, P.pNetworkId} sigs P.Tx{..} = do - txIns <- traverse toCardanoTxInBuild $ Set.toList txInputs + txIns <- traverse toCardanoTxInBuild txInputs txInsCollateral <- toCardanoTxInsCollateral txCollateral txOuts <- traverse (toCardanoTxOut pNetworkId (lookupDatum txData)) txOutputs txFee' <- toCardanoFee txFee @@ -457,12 +457,12 @@ toCardanoTxId (PV1.TxId bs) = tag "toCardanoTxId" $ deserialiseFromRawBytes C.AsTxId $ PlutusTx.fromBuiltin bs -fromCardanoTxInsCollateral :: C.TxInsCollateral era -> Set.Set PV1.TxIn -fromCardanoTxInsCollateral C.TxInsCollateralNone = mempty -fromCardanoTxInsCollateral (C.TxInsCollateral _ txIns) = Set.fromList $ fmap (PV1.pubKeyTxIn . fromCardanoTxIn) txIns +fromCardanoTxInsCollateral :: C.TxInsCollateral era -> [PV1.TxIn] +fromCardanoTxInsCollateral C.TxInsCollateralNone = [] +fromCardanoTxInsCollateral (C.TxInsCollateral _ txIns) = map (PV1.pubKeyTxIn . fromCardanoTxIn) txIns -toCardanoTxInsCollateral :: Set.Set PV1.TxIn -> Either ToCardanoError (C.TxInsCollateral C.BabbageEra) -toCardanoTxInsCollateral = fmap (C.TxInsCollateral C.CollateralInBabbageEra) . traverse (toCardanoTxIn . PV1.txInRef) . Set.toList +toCardanoTxInsCollateral :: [PV1.TxIn] -> Either ToCardanoError (C.TxInsCollateral C.BabbageEra) +toCardanoTxInsCollateral = fmap (C.TxInsCollateral C.CollateralInBabbageEra) . traverse (toCardanoTxIn . PV1.txInRef) toCardanoTxInWitness :: PV1.TxInType -> Either ToCardanoError (C.Witness C.WitCtxTxIn C.BabbageEra) toCardanoTxInWitness PV1.ConsumePublicKeyAddress = pure (C.KeyWitness C.KeyWitnessForSpending) diff --git a/plutus-ledger/src/Ledger/Tx/Internal.hs b/plutus-ledger/src/Ledger/Tx/Internal.hs index 8bc848d5db..4361a2b291 100644 --- a/plutus-ledger/src/Ledger/Tx/Internal.hs +++ b/plutus-ledger/src/Ledger/Tx/Internal.hs @@ -32,9 +32,9 @@ import PlutusTx.Lattice -- | A transaction, including witnesses for its inputs. data Tx = Tx { - txInputs :: Set.Set TxIn, + txInputs :: [TxIn], -- ^ The inputs to this transaction. - txCollateral :: Set.Set TxIn, + txCollateral :: [TxIn], -- ^ The collateral inputs to cover the fees in case validation of the transaction fails. txOutputs :: [TxOut], -- ^ The outputs of this transaction, ordered so they can be referenced by index. @@ -78,13 +78,13 @@ instance BA.ByteArrayAccess Tx where withByteArray = BA.withByteArray . Write.toStrictByteString . encode -- | The inputs of a transaction. -inputs :: Lens' Tx (Set.Set TxIn) +inputs :: Lens' Tx [TxIn] inputs = lens g s where g = txInputs s tx i = tx { txInputs = i } -- | The collateral inputs of a transaction for paying fees when validating the transaction fails. -collateralInputs :: Lens' Tx (Set.Set TxIn) +collateralInputs :: Lens' Tx [TxIn] collateralInputs = lens g s where g = txCollateral s tx i = tx { txCollateral = i } @@ -149,7 +149,7 @@ validValuesTx Tx{..} -- | A transaction without witnesses for its inputs. data TxStripped = TxStripped { - txStrippedInputs :: Set.Set TxOutRef, + txStrippedInputs :: [TxOutRef], -- ^ The inputs to this transaction, as transaction output references only. txStrippedOutputs :: [TxOut], -- ^ The outputs of this transation. @@ -161,7 +161,7 @@ data TxStripped = TxStripped { strip :: Tx -> TxStripped strip Tx{..} = TxStripped i txOutputs txMint txFee where - i = Set.map txInRef txInputs + i = map txInRef txInputs -- | A 'TxOut' along with the 'Tx' it comes from, which may have additional information e.g. -- the full data script that goes with the 'TxOut'. @@ -173,11 +173,11 @@ txOutTxDatum :: TxOutTx -> Maybe Datum txOutTxDatum (TxOutTx tx out) = txOutDatum out >>= lookupDatum tx -- | The transaction output references consumed by a transaction. -spentOutputs :: Tx -> Set.Set TxOutRef -spentOutputs = Set.map txInRef . txInputs +spentOutputs :: Tx -> [TxOutRef] +spentOutputs = map txInRef . txInputs -- | Update a map of unspent transaction outputs and signatures -- for a failed transaction using its collateral inputs. updateUtxoCollateral :: Tx -> Map TxOutRef TxOut -> Map TxOutRef TxOut -updateUtxoCollateral tx unspent = unspent `Map.withoutKeys` (Set.map txInRef . txCollateral $ tx) +updateUtxoCollateral tx unspent = unspent `Map.withoutKeys` (Set.fromList . map txInRef . txCollateral $ tx) diff --git a/plutus-ledger/test/Spec.hs b/plutus-ledger/test/Spec.hs index 0186a826da..6f5a71573d 100644 --- a/plutus-ledger/test/Spec.hs +++ b/plutus-ledger/test/Spec.hs @@ -5,6 +5,8 @@ {-# LANGUAGE NumericUnderscores #-} module Main(main) where +import Cardano.Api qualified as Api +import Cardano.Crypto.Hash qualified as Crypto import Control.Monad (forM_) import Data.Aeson qualified as JSON import Data.Aeson.Extras qualified as JSON @@ -28,6 +30,7 @@ import Ledger.Interval qualified as Interval import Ledger.TimeSlot (SlotConfig (..)) import Ledger.TimeSlot qualified as TimeSlot import Ledger.Tx qualified as Tx +import Ledger.Tx.CardanoAPI qualified as CardanoAPI import Ledger.Tx.CardanoAPISpec qualified import Ledger.Value qualified as Value import PlutusTx.AssocMap qualified as AMap @@ -85,6 +88,9 @@ tests = testGroup "all tests" [ testGroup "TxInfo" [ testPropertyNamed "TxInfo has non empty ada txMint and txFee" "txInfoNonEmptyAda" txInfoNonEmptyAda ], + testGroup "TxIn" [ + testPropertyNamed "Check that Ord instances of TxIn match" "txInOrdInstanceEquivalenceTest" txInOrdInstanceEquivalenceTest + ], testGroup "TimeSlot" [ testPropertyNamed "time range of starting slot" "initialSlotToTimeProp," initialSlotToTimeProp, testPropertyNamed "slot of starting time range" "initialTimeToSlotProp," initialTimeToSlotProp, @@ -336,3 +342,17 @@ txInfoNonEmptyAda = property $ do txInfo <- forAll $ Gen.genTxInfo mockChain Hedgehog.assert $ (AMap.member Ada.adaSymbol . Value.getValue) $ Ledger.txInfoMint txInfo Hedgehog.assert $ (AMap.member Ada.adaSymbol . Value.getValue) $ Ledger.txInfoFee txInfo + +-- | Check that Ord instances of cardano-api's 'TxIn' and plutus-ledger-api's 'TxIn' match. +txInOrdInstanceEquivalenceTest :: Property +txInOrdInstanceEquivalenceTest = property $ do + txIns <- sort <$> forAll (Gen.list (Range.singleton 10) genTxIn) + let toPlutus = map ((`Tx.TxIn` Nothing) . CardanoAPI.fromCardanoTxIn) + let plutusTxIns = sort $ toPlutus txIns + Hedgehog.assert $ (toPlutus txIns) == plutusTxIns + +genTxIn :: Hedgehog.MonadGen m => m Api.TxIn +genTxIn = do + txId <- (\t -> Api.TxId $ Crypto.castHash $ Crypto.hashWith (const t) ()) <$> (Gen.utf8 (Range.singleton 5) Gen.unicode) + txIx <- Api.TxIx <$> (Gen.integral (Range.linear 0 maxBound)) + return $ Api.TxIn txId txIx diff --git a/plutus-pab-executables/tx-inject/TxInject/RandomTx.hs b/plutus-pab-executables/tx-inject/TxInject/RandomTx.hs index a11c344d59..aa9a589e7f 100644 --- a/plutus-pab-executables/tx-inject/TxInject/RandomTx.hs +++ b/plutus-pab-executables/tx-inject/TxInject/RandomTx.hs @@ -14,7 +14,6 @@ import Data.Default (def) import Data.List.NonEmpty (NonEmpty (..)) import Data.Map qualified as Map import Data.Maybe (fromMaybe) -import Data.Set qualified as Set import Hedgehog.Gen qualified as Gen import System.Random.MWC as MWC @@ -85,7 +84,7 @@ generateTx gen slot (UtxoIndex utxo) = do (txOutValue . snd) inputs -- inputs of the transaction - sourceTxIns = Set.fromList $ fmap (Tx.pubKeyTxIn . fst) inputs + sourceTxIns = map (Tx.pubKeyTxIn . fst) inputs tx <- Gen.sample $ Generators.genValidTransactionSpending sourceTxIns sourceAda slotCfg <- Gen.sample Generators.genSlotConfig diff --git a/plutus-playground-client/src/Chain/Types.purs b/plutus-playground-client/src/Chain/Types.purs index 68aed3c989..a93d0b9934 100644 --- a/plutus-playground-client/src/Chain/Types.purs +++ b/plutus-playground-client/src/Chain/Types.purs @@ -11,7 +11,6 @@ import Data.Lens.Record (prop) import Data.Map (Map) import Data.Newtype (class Newtype) import Type.Proxy (Proxy(..)) -import Data.Set (Set) import Ledger.Address (PaymentPubKeyHash(..)) import Plutus.V1.Ledger.Address (Address(..)) import Plutus.V1.Ledger.Credential (Credential(..)) @@ -103,7 +102,7 @@ _txValidRange = _Newtype <<< prop (Proxy :: _ "txValidRange") _txSignatures :: Lens' Tx (Map PubKey Signature) _txSignatures = _Newtype <<< prop (Proxy :: _ "txSignatures") -_txInputs :: Lens' Tx (Set TxIn) +_txInputs :: Lens' Tx (Array TxIn) _txInputs = _Newtype <<< prop (Proxy :: _ "txInputs") _txOutputs :: Lens' Tx (Array TxOut) diff --git a/plutus-use-cases/test/Spec/crowdfundingEmulatorTestOutput.txt b/plutus-use-cases/test/Spec/crowdfundingEmulatorTestOutput.txt index 5d79183a21..523b176295 100644 --- a/plutus-use-cases/test/Spec/crowdfundingEmulatorTestOutput.txt +++ b/plutus-use-cases/test/Spec/crowdfundingEmulatorTestOutput.txt @@ -39,7 +39,7 @@ Slot 1: W[2]: Balancing an unbalanced transaction: Validity range: (-∞ , POSIXTime 1596059111000 ] Slot 1: W[2]: Finished balancing: - Tx cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356: + Tx 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5: {inputs: - ef0ca0fb043642529818003be5a6cac88aac499e4f8f1cbc3bdb35db2b7f6958!20 @@ -64,9 +64,9 @@ Slot 1: 00000000-0000-4000-8000-000000000003 {Wallet W[4]}: Receive endpoint call on 'contribute' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "contribute")]),Object (fromList [("unEndpointValue",Object (fromList [("contribValue",Object (fromList [("getValue",Array [Array [Object (fromList [("unCurrencySymbol",String "")]),Array [Array [Object (fromList [("unTokenName",String "")]),Number 2500000.0]]]])]))]))])]),("tag",String "ExposeEndpointResp")]) Slot 1: 00000000-0000-4000-8000-000000000003 {Wallet W[4]}: Contract log: String "Contributing Value (Map [(,Map [(\"\",2500000)])])" -Slot 1: W[2]: Signing tx: cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356 -Slot 1: W[2]: Submitting tx: cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356 -Slot 1: W[2]: TxSubmit: cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356 +Slot 1: W[2]: Signing tx: 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5 +Slot 1: W[2]: Submitting tx: 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5 +Slot 1: W[2]: TxSubmit: 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5 Slot 1: W[3]: Balancing an unbalanced transaction: Tx: Tx 2b5f70647d0b1910f61caaeafad09179eb32040ea5c1c3fe9ac3ff43d481ae0b: @@ -87,7 +87,7 @@ Slot 1: W[3]: Balancing an unbalanced transaction: Validity range: (-∞ , POSIXTime 1596059111000 ] Slot 1: W[3]: Finished balancing: - Tx 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b: + Tx 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7: {inputs: - ef0ca0fb043642529818003be5a6cac88aac499e4f8f1cbc3bdb35db2b7f6958!0 @@ -108,9 +108,9 @@ Slot 1: W[3]: Finished balancing: validity range: Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound (Finite (Slot {getSlot = 20})) False} data: ".\n\214\f2\a$\140\236\212}\189\227\215R\224\170\209A\214\184\248\SUB\194\198\236\162|"} -Slot 1: W[3]: Signing tx: 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b -Slot 1: W[3]: Submitting tx: 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b -Slot 1: W[3]: TxSubmit: 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b +Slot 1: W[3]: Signing tx: 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7 +Slot 1: W[3]: Submitting tx: 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7 +Slot 1: W[3]: TxSubmit: 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7 Slot 1: W[4]: Balancing an unbalanced transaction: Tx: Tx 57494bfede118bff4fbb34bec315193f7f015575da6c848ece77b89f05db7e8b: @@ -131,7 +131,7 @@ Slot 1: W[4]: Balancing an unbalanced transaction: Validity range: (-∞ , POSIXTime 1596059111000 ] Slot 1: W[4]: Finished balancing: - Tx 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b: + Tx 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61: {inputs: - ef0ca0fb043642529818003be5a6cac88aac499e4f8f1cbc3bdb35db2b7f6958!10 @@ -150,23 +150,23 @@ Slot 1: W[4]: Finished balancing: validity range: Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound (Finite (Slot {getSlot = 20})) False} data: "U}#\192\165\&3\180\210\149\172-\193Kx:~\252);\194>\222\136\166\254\253 ="} -Slot 1: W[4]: Signing tx: 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b -Slot 1: W[4]: Submitting tx: 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b -Slot 1: W[4]: TxSubmit: 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b -Slot 1: TxnValidate 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b -Slot 1: TxnValidate 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b -Slot 1: TxnValidate cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356 +Slot 1: W[4]: Signing tx: 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61 +Slot 1: W[4]: Submitting tx: 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61 +Slot 1: W[4]: TxSubmit: 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61 +Slot 1: TxnValidate 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61 +Slot 1: TxnValidate 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7 +Slot 1: TxnValidate 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5 Slot 20: 00000000-0000-4000-8000-000000000000 {Wallet W[1]}: Contract log: String "Collecting funds" Slot 20: W[1]: Balancing an unbalanced transaction: Tx: - Tx 2d12c647105a184d31349ad80da50a26b3334724dd74da961e4fa51722819e73: + Tx ab9b2eef2061a6227afc327d5aef4a6f2ef7616d4785b1202f076f9b3deb150b: {inputs: - - 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b!0 + - 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7!0 <> - - 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b!0 + - 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5!0 <> - - cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356!0 + - 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61!0 <> collateral inputs: outputs: @@ -178,25 +178,25 @@ Slot 20: W[1]: Balancing an unbalanced transaction: data:} Requires signatures: Utxo index: - ( 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b!0 + ( 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61!0 , - Value (Map [(,Map [("",2500000)])]) addressed to ScriptCredential: 8ff252c8c5423de7925e0c556871c90ed904ec3beb3dab519e9bfd9f (no staking credential) ) - ( 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b!0 + ( 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5!0 , - Value (Map [(,Map [("",10000000)])]) addressed to ScriptCredential: 8ff252c8c5423de7925e0c556871c90ed904ec3beb3dab519e9bfd9f (no staking credential) ) - ( cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356!0 + ( 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7!0 , - Value (Map [(,Map [("",10000000)])]) addressed to ScriptCredential: 8ff252c8c5423de7925e0c556871c90ed904ec3beb3dab519e9bfd9f (no staking credential) ) Validity range: [ POSIXTime 1596059111000 , POSIXTime 1596059120999 ] Slot 20: W[1]: Finished balancing: - Tx 9ff8103ea1aca95261d8fe4d6fb3bb9034e0bc99a426773351c1e2efed1469f6: + Tx f55ad35996ec77873395eb352797d2de6a37c00f311ee91800b63e7917ab20ad: {inputs: - - 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b!0 + - 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7!0 <> - - 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b!0 + - 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5!0 <> - - cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356!0 + - 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61!0 <> collateral inputs: - ef0ca0fb043642529818003be5a6cac88aac499e4f8f1cbc3bdb35db2b7f6958!50 @@ -210,9 +210,9 @@ Slot 20: W[1]: Finished balancing: signatures: validity range: Interval {ivFrom = LowerBound (Finite (Slot {getSlot = 20})) True, ivTo = UpperBound (Finite (Slot {getSlot = 29})) True} data:} -Slot 20: W[1]: Signing tx: 9ff8103ea1aca95261d8fe4d6fb3bb9034e0bc99a426773351c1e2efed1469f6 -Slot 20: W[1]: Submitting tx: 9ff8103ea1aca95261d8fe4d6fb3bb9034e0bc99a426773351c1e2efed1469f6 -Slot 20: W[1]: TxSubmit: 9ff8103ea1aca95261d8fe4d6fb3bb9034e0bc99a426773351c1e2efed1469f6 +Slot 20: W[1]: Signing tx: f55ad35996ec77873395eb352797d2de6a37c00f311ee91800b63e7917ab20ad +Slot 20: W[1]: Submitting tx: f55ad35996ec77873395eb352797d2de6a37c00f311ee91800b63e7917ab20ad +Slot 20: W[1]: TxSubmit: f55ad35996ec77873395eb352797d2de6a37c00f311ee91800b63e7917ab20ad Slot 20: 00000000-0000-4000-8000-000000000000 {Wallet W[1]}: Contract instance stopped (no errors) -Slot 20: TxnValidate 9ff8103ea1aca95261d8fe4d6fb3bb9034e0bc99a426773351c1e2efed1469f6 \ No newline at end of file +Slot 20: TxnValidate f55ad35996ec77873395eb352797d2de6a37c00f311ee91800b63e7917ab20ad \ No newline at end of file diff --git a/plutus-use-cases/test/Spec/renderCrowdfunding.txt b/plutus-use-cases/test/Spec/renderCrowdfunding.txt index b2ac243564..8ee724eca9 100644 --- a/plutus-use-cases/test/Spec/renderCrowdfunding.txt +++ b/plutus-use-cases/test/Spec/renderCrowdfunding.txt @@ -551,11 +551,11 @@ Balances Carried Forward: Ada: Lovelace: 100000000 ==== Slot #1, Tx #0 ==== -TxId: 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b +TxId: 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61 Fee: Ada: Lovelace: 176325 Mint: - Signatures PubKey: c0a4b02f44c212ba6c1197df5a5cf8bd1a3dceef... - Signature: 5840a353dc3679bd9421cc1909bf9c2d8cf57af4... + Signature: 5840560977271931f0b78973a1d0ef0173857a91... Inputs: ---- Input 0 ---- Destination: PaymentPubKeyHash: 557d23c0a533b4d295ac2dc14b783a7efc293bc2... (Wallet 5f5a4f5f465580a5500b9a9cede7f4e014a37ea8) @@ -625,11 +625,11 @@ Balances Carried Forward: Ada: Lovelace: 2500000 ==== Slot #1, Tx #1 ==== -TxId: 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b +TxId: 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7 Fee: Ada: Lovelace: 182353 Mint: - Signatures PubKey: 4cdc632449cde98d811f78ad2e2d15a278731bc5... - Signature: 584054f29203dd0cd715694c192fa88ffc05a3e6... + Signature: 58408774becc27ac26c5b8ce8bdfa36627911eb0... Inputs: ---- Input 0 ---- Destination: PaymentPubKeyHash: 2e0ad60c3207248cecd47dbde3d752e0aad141d6... (Wallet c30efb78b4e272685c1f9f0c93787fd4b6743154) @@ -708,11 +708,11 @@ Balances Carried Forward: Ada: Lovelace: 12500000 ==== Slot #1, Tx #2 ==== -TxId: cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356 +TxId: 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5 Fee: Ada: Lovelace: 182353 Mint: - Signatures PubKey: 98c77c40ccc536e0d433874dae97d4a0787b10b3... - Signature: 58406128e3bbffc525e459cf6bfaacf2431496d8... + Signature: 5840f1a3afd23ae95e55ac37f939fd4f0d7a376f... Inputs: ---- Input 0 ---- Destination: PaymentPubKeyHash: 80a4f45b56b88d1139da23bc4c3c75ec6d32943c... (Wallet 7ce812d7a4770bbf58004067665c3a48f28ddd58) @@ -791,18 +791,18 @@ Balances Carried Forward: Ada: Lovelace: 22500000 ==== Slot #2, Tx #0 ==== -TxId: 9ff8103ea1aca95261d8fe4d6fb3bb9034e0bc99a426773351c1e2efed1469f6 +TxId: f55ad35996ec77873395eb352797d2de6a37c00f311ee91800b63e7917ab20ad Fee: Ada: Lovelace: 300581 Mint: - Signatures PubKey: 8d9de88fbf445b7f6c3875a14daba94caee2ffcb... - Signature: 5840850048031b412e26ac9b5c531c05c1f797a1... + Signature: 5840aae37c4a1cff0d6323d08e45ea14f19cb176... Inputs: ---- Input 0 ---- Destination: Script: 8ff252c8c5423de7925e0c556871c90ed904ec3beb3dab519e9bfd9f Value: - Ada: Lovelace: 2500000 + Ada: Lovelace: 10000000 Source: - Tx: 52d2af1a75f8a9869d50b7dbb9778788405fb790a87a883c2ff9f7ad0c22866b + Tx: 9ce8c5f2fa784bf293a75246fbb31783da4102dca9cbae5a76f1047eff32b8f7 Output #0 Script: 590b0c0100003323232323232323232323232323... @@ -811,16 +811,16 @@ Inputs: Value: Ada: Lovelace: 10000000 Source: - Tx: 9002f9851794958ca59f5bbd0f804c1f34b74e500b1c52faa890d4d4d8eadf5b + Tx: 8ac0c6334fa9ab6aa9cb46d5d41f85f8b6269460233986795a64ae44ee4145e5 Output #0 Script: 590b0c0100003323232323232323232323232323... ---- Input 2 ---- Destination: Script: 8ff252c8c5423de7925e0c556871c90ed904ec3beb3dab519e9bfd9f Value: - Ada: Lovelace: 10000000 + Ada: Lovelace: 2500000 Source: - Tx: cbea387b80cd455b99fcc31adf18509c02220ab8d4688757ab39ad8cc88ba356 + Tx: 4d976cc235423fba98f3c9f43b386db8a1a63f4925c6ebc8fac7dd7862e2fa61 Output #0 Script: 590b0c0100003323232323232323232323232323... diff --git a/plutus-use-cases/test/Spec/renderGuess.txt b/plutus-use-cases/test/Spec/renderGuess.txt index 07f318d051..1230bada8f 100644 --- a/plutus-use-cases/test/Spec/renderGuess.txt +++ b/plutus-use-cases/test/Spec/renderGuess.txt @@ -551,11 +551,11 @@ Balances Carried Forward: Ada: Lovelace: 100000000 ==== Slot #1, Tx #0 ==== -TxId: d131f6e9c71b1ae0aac96503d8b441443261b3e95b872e736b90ae100c6d9396 +TxId: cbf77550ec54db803b63d391e0a05b6616b1557c0ea0c1d8b4509f4ea54c6e0b Fee: Ada: Lovelace: 184333 Mint: - Signatures PubKey: 8d9de88fbf445b7f6c3875a14daba94caee2ffcb... - Signature: 58402e110c395c10684225c05c3afe8188cf848e... + Signature: 58402636007f6e8b22f8355ef8f963db3f660ba6... Inputs: ---- Input 0 ---- Destination: PaymentPubKeyHash: a2c20c77887ace1cd986193e4e75babd8993cfd5... (Wallet 872cb83b5ee40eb23bfdab1772660c822a48d491) diff --git a/plutus-use-cases/test/Spec/renderVesting.txt b/plutus-use-cases/test/Spec/renderVesting.txt index 95c1fa3f28..5c7f136ebf 100644 --- a/plutus-use-cases/test/Spec/renderVesting.txt +++ b/plutus-use-cases/test/Spec/renderVesting.txt @@ -551,11 +551,11 @@ Balances Carried Forward: Ada: Lovelace: 100000000 ==== Slot #1, Tx #0 ==== -TxId: 3cc431166a412ec845eb6d97a9c9d13d48de2188e6b9d718e185ea18b65b42c7 +TxId: 99b27be2459868f35365f87d8f3c270478b3a4c634719ad9843ae202eaf343e3 Fee: Ada: Lovelace: 211349 Mint: - Signatures PubKey: 98c77c40ccc536e0d433874dae97d4a0787b10b3... - Signature: 5840a0e0f2b8ec267c12a4fad359fbef235c8923... + Signature: 584039c7980c1846787c0e775b205f54752076fa... Inputs: ---- Input 0 ---- Destination: PaymentPubKeyHash: 80a4f45b56b88d1139da23bc4c3c75ec6d32943c... (Wallet 7ce812d7a4770bbf58004067665c3a48f28ddd58) @@ -679,18 +679,18 @@ Balances Carried Forward: Ada: Lovelace: 60000000 ==== Slot #2, Tx #0 ==== -TxId: ffabb66ec8f720ee197585b034771d5d43ce32637e442909a2ce61d62e4547d0 +TxId: 4b2652c4222b578617c629985a71282ee8540b91159846e887fb7399fe575320 Fee: Ada: Lovelace: 443713 Mint: - Signatures PubKey: 8d9de88fbf445b7f6c3875a14daba94caee2ffcb... - Signature: 584040536ca16cb72bf58b57e25a04013ce22885... + Signature: 58404a252a3b75090285da0b388f499210e89358... Inputs: ---- Input 0 ---- Destination: Script: 40cfe3534a528c1b067dcea891c23024caa3cba0a080e327b9173366 Value: Ada: Lovelace: 60000000 Source: - Tx: 3cc431166a412ec845eb6d97a9c9d13d48de2188e6b9d718e185ea18b65b42c7 + Tx: 99b27be2459868f35365f87d8f3c270478b3a4c634719ad9843ae202eaf343e3 Output #0 Script: 590e820100003323232323232323232323232323...