Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Increase the delay of awaiting in plutus-pab-executables tests #565

Merged
4 commits merged into from
Jul 21, 2022

Conversation

ghost
Copy link

@ghost ghost commented Jul 6, 2022

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reference the ADR in the PR and reference the PR in the ADR (if revelant)
    • Reviewer requested

@koslambrou
Copy link
Contributor

BTW, I've also noticed this problem with waitForTxStatusChange. So it will probably be a similar change.

@@ -262,7 +262,8 @@ waitForTxOutStatusChangeTest = runScenario $ do
void $ Simulator.payToPaymentPublicKeyHash w1 pk1 (Ada.toValue Ledger.minAdaTxOut)
Simulator.waitNSlots 1

txOutStatus1'' <- Simulator.waitForTxOutStatusChange txOutRef1
let oldStatus = (TentativelyConfirmed 8 TxValid (Spent $ getCardanoTxId tx2))
txOutStatus1'' <- Simulator.waitForTxOutStatusChange' oldStatus txOutRef1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intuition is that it doesn't solve the hidden problem. Considering the fact the following testcase works

  assertEqual "tx output 1 should be tentatively confirmed of depth 1"
              (TentativelyConfirmed 1 TxValid (Spent $ getCardanoTxId tx2))
txOutStatus1'

and that a depth of > 8 means confirmed, and that we wait for at least 8 slots => this should mean that the transaction is definitely confirmed. Maybe there's a slot discrepancy between waitForTxOutStatusChange and waitNSlots.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My hypothesis, based on the hydra error message, was that we don't wait enough and waitForTxOutStatusChange returns one of the status changes but not the latest. TentativelyConfirmed 7 ~> TentativelyConfirmed 8 instead of TentativelyConfirmed 8 ~> Confirmed. That's why I tried to specify the status that we want to be changed from.

Now, I think, maybe we should instead wait for the specified status? Like waitForTxOutStatusChangeTo status and it will wait until the status will be changed to the given status. And we can provide a timeout 10s for example to throw an exception if the desired status wasn't reached. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the solution you're proposing and it makes sense. However, I still feel like the current test should work. We're calling Simulator.waitNSlots 1 9 times, and a transaction should be confirmed once the transaction is 8 blocks deep. So it doesn't make sense for the test to fail unless there's a problem with the Simulator. I'll also take a look and see what the problem might be.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added one more waitNSlots 1 to waitForTxOutStatusChangeTest but waitForTxStatusChangeTest also failed with the similar error as on hydra. Maybe the tests in this test-suite are not isolated and they depend on each other? Maybe the simulator runs things and accumulates the delay?

@ghost ghost force-pushed the kll/update-version-cabal-2 branch from 5f3cedc to 3bf2d32 Compare July 7, 2022 12:10
@ghost ghost changed the title Exploring the fix of the flaky test Specify the status for awaiting in plutus-example tests Jul 7, 2022
@ghost ghost linked an issue Jul 7, 2022 that may be closed by this pull request
@ghost
Copy link
Author

ghost commented Jul 7, 2022

Now it fails with a plutus-example test's error, nice

@ghost ghost changed the title Specify the status for awaiting in plutus-example tests Specify the status for awaiting in plutus-pab-executables tests Jul 8, 2022
@ghost ghost force-pushed the kll/update-version-cabal-2 branch from 55fb790 to afd1104 Compare July 8, 2022 13:14
@ghost ghost changed the title Specify the status for awaiting in plutus-pab-executables tests Increase the delay of awaiting in plutus-pab-executables tests Jul 8, 2022
@koslambrou
Copy link
Contributor

Just noticed something. When running: cabal test plutus-pab-executables:test:plutus-pab-test-full --test-options="-p \"can wait for tx status change\"" I wouldn't get any test fail (ran it 20 times).

Then, I tried: cabal test plutus-pab-executables:test:plutus-pab-test-full --test-options="-p \"can wait for tx\"" which would match both test cases we're interested in. Then, the can wait for tx status change failed, but not the other one.

So, like you said, the test don't seem isolated.

@ghost
Copy link
Author

ghost commented Jul 11, 2022

Hmmm, have you managed to get these results with the latest commit? I have tried many times but seems the adding more slots to await fixed it for me. But it's hard to tell anything with delays...

@koslambrou
Copy link
Contributor

Oh sorry, I tried this on main directly. Adding delays simply hides the underneath problem, no?

@koslambrou
Copy link
Contributor

koslambrou commented Jul 11, 2022

Running on main with the bash script:

#!/usr/bin/env sh
until ! LANG=C.UTF-8 cabal test plutus-pab-executables:test:plutus-pab-test-full --test-options="-p \"can wait for tx\""; do
echo ...;
done

I'm even getting errors like:

  Plutus.PAB.Core
    Executing contracts.
      can wait for tx status change:        [INFO] W05a87dc: Balancing an unbalanced transaction:
                   Tx:
                     Tx 047d0b8f72d7fa4e91e1092c93509f2347098f948f942226f3ed6a0887120468:
                       {inputs:
                       collateral inputs:
                       outputs:
                         - Value (Map [(,Map [("",100000000)])]) addressed to
                           PubKeyCredential: f6c178746fb2c96caa40f9c1202e11a6f20b261b823bca280425d748 (no staking credential)
                       mint: Value (Map [])
                       fee: Value (Map [])
                       mps:
                       signatures:
                       validity range: Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound PosInf True}
                       data:}
                   Requires signatures:
                   Utxo index:
                   Validity range:
                     (-∞ , +∞)
FAIL
        Exception: WalletError (InsufficientFunds "Total: Value (Map []) expected: Value (Map [(,Map [(\"\",100300000)])])")
        CallStack (from HasCallStack):
          error, called at test/full/Plutus/PAB/CoreSpec.hs:104:21 in main:Plutus.PAB.CoreSpec
        Use -p '/can wait for tx/&&/can wait for tx status change/' to rerun this test only.

I'm sometimes getting the same thing in next-node branch.

@koslambrou
Copy link
Contributor

Ok, I think I found the problem concerning the error:

[INFO] W79f9602: Signing tx: 9056fcfce1f248c624d91e6e135c293545375dbe5b0936be0f910be243f96786
[INFO] W79f9602: Submitting tx: 9056fcfce1f248c624d91e6e135c293545375dbe5b0936be0f910be243f96786
FAIL
        Exception: OtherError "tx output 1 should be tentatively confirmed of depth 1 Expected: TentativelyConfirmed (Depth {unDepth = 1}) TxValid (Spent 9056fcfce1f248c624d91e6e135c293545375dbe5b0936be0f910be243f96786) Actual: TentativelyConfirmed (Depth {unDepth = 1}) TxValid Unspent"
        CallStack (from HasCallStack):
          error, called at test/full/Plutus/PAB/CoreSpec.hs:103:21 in main:Plutus.PAB.CoreSpec

I noticed that when beLastSyncedBlockNumber is 11, then everything works in the test case. However, sometimes, the value is < 11 (like 10), then the test case fails. After looking at the processMockBlock function, I noticed that then there is no transactions in the block, we don't increment beLastSyncedBlockNumber. So in the call transactionStatus of waitForTxStatusChange, we use beLastSyncedBlockNumber which wasn't updated to the latest slot, so we incorrectly calculate the transaction status. Solution would be to use beCurrentSlot instead and we would need to modify the signature of transactionStatus in order to use Slot instead of BlockNumber, since we can just as well calculate the transaction status using the current slot instead of the current block number.

@koslambrou
Copy link
Contributor

Also, I don't understand why the printed slots in the logging are going until Slot 54 in the next-node branch when in main branch the tests stops (as expected) at Slot 14. 😭

I'm going to look at the error in the main branch: why does the wallet say Insufficient funds

@ghost
Copy link
Author

ghost commented Jul 12, 2022

I'm going to look at the error in the main branch: why does the wallet say Insufficient funds

Oh, I had this error but it occurred only once without any idea how to reproduce it.

I noticed that when beLastSyncedBlockNumber is 11, then everything works in the test case. However, sometimes, the value is < 11 (like 10), then the test case fails. After looking at the processMockBlock function, I noticed that then there is no transactions in the block, we don't increment beLastSyncedBlockNumber. So in the call transactionStatus of waitForTxStatusChange, we use beLastSyncedBlockNumber which wasn't updated to the latest slot, so we incorrectly calculate the transaction status. Solution would be to use beCurrentSlot instead and we would need to modify the signature of transactionStatus in order to use Slot instead of BlockNumber, since we can just as well calculate the transaction status using the current slot instead of the current block number.

Wow, nice catch! I guess I'm not that familiar with the simulator yet and haven't looked there. I will take a look!

@ghost
Copy link
Author

ghost commented Jul 12, 2022

So in the call transactionStatus of waitForTxStatusChange, we use beLastSyncedBlockNumber which wasn't updated to the latest slot, so we incorrectly calculate the transaction status.

Or just increment the beLastSyncedBlockNumber if null transactions? :) or it's incorrect and that's the point, that the last synced block is a non-empty block?

UPD. Interesting, by incrementing the beLastSyncedBlockNumber the failure of the test became consistent.

FAIL
        Exception: OtherError "tx output 2 should be tentatively confirmed of depth 2 Expected: TentativelyConfirmed (Depth {unDepth = 2}) TxValid Unspent Actual: Committed TxValid Unspent"
        CallStack (from HasCallStack):
          error, called at test/full/Plutus/PAB/CoreSpec.hs:104:21 in main:Plutus.PAB.CoreSpec
        Use -p '/can wait for tx/&&/can wait for tx output status change/' to rerun this test only.

@koslambrou
Copy link
Contributor

Right! That's probably because of the fact that slots go by too fast (see comment above)

@ghost
Copy link
Author

ghost commented Jul 12, 2022

@koslambrou hmmm, I have changed waitForTxStatusChange and waitForTxOutStatusChange to use the beCurrentSlot instead of beLastSyncedBlockNumber, and pass it to transactionOutputStatus which resulted in an another stable error:

        Exception: OtherError "tx output 1 should be tentatively confirmed of depth 1 Expected: TentativelyConfirmed (Depth {unDepth = 1}) TxValid Unspent Actual: Committed TxValid Unspent"
        CallStack (from HasCallStack):
          error, called at test/full/Plutus/PAB/CoreSpec.hs:104:21 in main:Plutus.PAB.CoreSpec
        Use -p '/can wait for tx/&&/can wait for tx output status change/' to rerun this test only.

Please note, that this time the error happens a bit earlier, on tx output 1 should be tentatively confirmed of depth 1 check.

Is it correct to compare currentSlot with an added block number in transactionStatus?

UPD. Looking at transactionStatus I see

      isCommitted addedInBlock = currentBlock > addedInBlock + fromIntegral chainConstant

Does it mean that by using currentSlot here we go too fast and get the confirmation status right away? Skipping the TentativelyConfirmed step.

Maybe, if we try to rely on the counter from another thread, it's hard to predict if it will be good enough in sync with our expectation in the test? We can rely on it only if it happens locally in the same thread with test.

@koslambrou
Copy link
Contributor

Does it mean that by using currentSlot here we go too fast and get the confirmation status right away? Skipping the TentativelyConfirmed step.

That's exactly what I was going to say. Maybe try to fix this? beCurrentSlot should not go that fast. It only does this on next-node, not on main.

Maybe, if we try to rely on the counter from another thread, it's hard to predict if it will be good enough in sync with our expectation in the test? We can rely on it only if it happens locally in the same thread with test.

What do you mean exactly by "counter from another thread".

@ghost
Copy link
Author

ghost commented Jul 14, 2022

What do you mean exactly by "counter from another thread".

Sorry, bad wording I suppose. I meant the interaction with the states between threads in general.

That's exactly what I was going to say. Maybe try to fix this? beCurrentSlot should not go that fast. It only does this on next-node, not on main.

That's interesting, I will take a look.

@ghost ghost force-pushed the kll/update-version-cabal-2 branch from afd1104 to 40a08ec Compare July 14, 2022 09:54
@ghost ghost requested a review from koslambrou July 14, 2022 09:55
@ghost
Copy link
Author

ghost commented Jul 14, 2022

@koslambrou Yeah, beCurrentSlot was too fast.

I checked how we use the processMockBlock in the Simulator. Turned out we use it in makeBlock via handleChainControl where wait with delayThread using scSlotLength which is in Millisecond. Setting the default option 1000 makes the slot behave normally.

UPD. I suppose we want the scSlotLength to be 1 here to have fast tests (added in c5083fc and worked fine)? Maybe something is unsynced? And doesn't use the scSlotLength. Or the delay is too little for STM to communicate between threads. And one of threads just goes too fast. Then the question why it worked fine before. 🤔

@koslambrou
Copy link
Contributor

Still failing locally when running the tests in a loop. The slots still advance too quickly.

@ghost
Copy link
Author

ghost commented Jul 14, 2022

@koslambrou could you check please that the branch is up to date? I force-pushed again, so maybe the local branch was not updated. I had the script running for 20 mins without failures...

@koslambrou
Copy link
Contributor

@ak3n You're right :| Forgot to git pull.

Yep the slots work. However, each new slot logs every 1 second. Can you make this so faster? Like 1 slot every 1 ms so that tests can go faster?

@ghost
Copy link
Author

ghost commented Jul 15, 2022

Yeah, figuring out why it's so slow now.

Also I think I found how to reproduce the Insufficient funds error. Removing (commenting) the Core.waitUntilSlot 1 line in mkSimulatorHandlers's onStartup helps to make it fail on regular basis.

@koslambrou
Copy link
Contributor

Also I think I found how to reproduce the Insufficient funds error. Removing (commenting) the Core.waitUntilSlot 1 line in mkSimulatorHandlers's onStartup helps to make it fail on regular basis.

Nice find!

@ghost ghost force-pushed the kll/update-version-cabal-2 branch from 40a08ec to 42299fb Compare July 20, 2022 12:57
@@ -787,6 +786,7 @@ payToWallet source target = payToPaymentPublicKeyHash source (Emulator.mockWalle
payToPaymentPublicKeyHash :: forall t. Wallet -> PaymentPubKeyHash -> Value -> Simulation t CardanoTx
payToPaymentPublicKeyHash source target amount = do
Instances.BlockchainEnv{beParams} <- Core.askBlockchainEnv @t @(SimulatorState t)
-- handleDelayEffect $ delayThread (250 :: Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove?

run.sh Outdated
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete

@koslambrou
Copy link
Contributor

RTD is broken in next-node, but fixed in main. I'm getting the fix in next-node in #609

@ghost
Copy link
Author

ghost commented Jul 20, 2022

Yep, saw your PR, thanks for this!

@ghost ghost force-pushed the kll/update-version-cabal-2 branch from 8182fd8 to 7d2c5fa Compare July 20, 2022 15:04
@ghost ghost merged commit 434e36d into next-node Jul 21, 2022
@ghost ghost deleted the kll/update-version-cabal-2 branch July 21, 2022 05:25
berewt added a commit that referenced this pull request Oct 11, 2022
* SCP-3855: update node dep (#449)

* Update Cardano node et al. dependencies for the Vasil HF

* The Cardano node version will only work on a network with the Vasil release.

* Solve some compile issues

* wip: recovering instances for types from plutus-ledger-api

* wip

* plutus-ledger compiles

* plutus-ledger-constraints compiles

* Fixed warnings in Ledger.Tx.CardanoAPI for fields introduced by the Babbage era. Also adapted hashing functions for PlutusV1 scripts to work on PlutusV2

* Fixed warnings in Ledger.Tx.CardanoAPITemp and added implementation to undefined value

* plutus-contract compiles

* Added alonzoGenesisDefaults implementation (copied from cardano-node because it was deleted over there) to Ledger.Validation

* plutus-chain-index-core compiles

* Fixed compilation errors in playground-common and plutus-contract

* Fix compile errors in plutus-example

* Fix compile errors in plutus-pab

* Fix compile errors in plutus-playground-server

* WIP on plutus-use-cases

* Split Tx.Orphans into multiple Orphans

* Fix compilation errors on plutus-use-cases

* fix compilation issues

* Update nix

* fix formatting

* Remove wrongly commited files

* Update purescript modules

* Commented test on plutus-ledger temporarely until cardano-node is updated

* Update cardano-wallet with fixes for haddock

* Fix plutus-playground-client purescript imports

* Fix warnings in plutus-example

* Fix plutus-uniswap cabal

* Try to turn-off haddock for cardano-wallet

* [plutus-contract]: fix golden tests and commented test until cardano-node is updated

* Add cardano-cli/.../genesis.alonzo.spec.json to fix plutus-example

* Fix comment link to PR

* Comment out the test properly

* Update scripts/protocol-parameters with fresh plutusV1 cost parameters

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* [chain-index]: export all servant client functions (#492)

* Fix playground client

* Fix streaming

* Fix purescript

* Create separate directories for v1 and v2 plutus scripts (#486)

* Reorganize the plutus-example library to distinguish clearly between V1
and V2 scripts.

* plutus-example reorganization
create v2 example script

* Modify the ScriptContextChecker module to be more generic

* Propagate the changes to the plutus-example apps and tests

* Update required-redeemer.plutus to also check for an inline datum of 42
and to check for an inline datum of 42 in the reference inputs

* Add PlutusV2 minting and staking scripts (#528)

* [chain-index]: add inline datums support and update cardano-node (#488)

* PLT-484 Upgraded cardano-node version to the official 1.35.0 release. (#551)

* Also upgraded cardano-wallet, plutus et al. versions that work with v1.35.0 of the node.

* Updated golden tests in plutus-use-cases and plutus-contract

* Updated version of components to 1.0.0 with cardano-node (#560)

* Updated the cardano-node bundled with plutus-apps to v1.35.0

* Updated version of all components in their respective cabal files to 1.0.0

* Update cardano-node dependency to 1.35.1

* Updated cardano-wallet, plutus and cardano-ledger to match the node
  version.

* Add script equivalence context test for the V2 context. (#588)

* Remove withIsCardanoEra workaround. (#607)

* BlockInMode now carries a IsCardanoEra constraint

* Increase the delay of awaiting in plutus-pab-executables tests (#565)

Set slot's length to 1s for awaiting tx/out status tests to make them stable

* [PLT-81] plutus-chain-index: support inline scripts when querying TxOut of a TxOutRef (#613)

* Make plutus-ledger-api version explicit in Ledger.Tx

* Make pattern match explicit

* Reorder ScriptChainIndexTxOut fields

To highlight they are the same as PublicKeyChainIndexTxOut.

* Add datum to both branches of ChainIndexTxOut

- Unfortunately we need to rename the fields because they have now
  different types.
- In the PublicKeyChainIndexTxOut case, the output datum is optional and
  we can use plutus-ledger-api OutputDatum type.
- In the ScriptChainIndexTxOut case, the output datum is required,
  nothing changes here but the name.

* Add ReferenceScript to ChainIndexTxOut

* Remove old comment

* Rename _ciTxOutDatumPublicKey and _ciTxOutDatumScript into _ciTxOutPublicKeyDatum and _ciTxOutScriptDatum

* Introduce fromReferenceScript

* Add comments to ChainIndexTxOut

* Add minting context equivalent test plutus script (#631)

* Add missing record field `localTxMonitoringClient` (#617)

* PLT-568: Switch to Babbage era (#614)

* Make Babbage the default era for the emulator

* Clean up

* Accept changes in test output

* Workaround for parseBabbageEraInCardanoModeTx

* Fix minAda calculation

* [next-node]: Bump wallet, plutus, ledger, node (#616)

* Bump cardano-node to 1.35.2 and rest of dependencies based on cardano-wallet

* Use '[TxIn]' instead of 'Set TxIn' in 'data Tx' (#623)

* [plutus-ledger]: Use '[TxIn]' instead of 'Set TxIn' in 'data Tx'.
* Add a property test to check Ord instances of TxIn.
* Sort the inputs in fromOnChainTx
* Sort the inputs in `Emulator.Wallet`
* Fix the review notes and the problem with getInput in StateMachine tests

* PLT-445 Add `mustReferencePubKeyOutput` in constraints library (#640)

* PLT-445 Add mustReferencePubKeyOutput in constraints library

* Added the mustReferencePubKeyOutput constraint in
  plutus-ledger-constraints

* Added a test case for the mustReferencePubKeyOutput

* Refactored Ledger.Tx.CardanoAPI to work with PlutusV2 alongside PlutusV1 scripts in the tx inputs.

* Use existing unitRedeemer

* Move TxIn and TxInType to Ledger.Tx

* Add plutus version to ConsumeScriptAddress constructor

* Add costModelParams for PlutusScriptV2

* Fix error codes.

* Renamed mkTxInfo to mkPV1TxInfo, added test for plutus-tx-constraints without implementation and commented for now the off-chain validation in Ledger.Index

* Implement reference inputs in makeTransactionBody'

* Fixed failing test cases for Ledger.Constraints.mustReferencePubKeyOutput

* Add MustUseOutputAsCollateral

* Fix V2 tests. But issues with V1 tests.

* Disable tests

* WIP

* Remove unused code

* PR feedback

* Remove unused code.

* Clean up

* Added additional info in TODO

* Add Arbitrary instances

* Convert plutus-ledger-constraint tests to PV2

* Fixed test in plutus-ledger-constraints

* Fixed PS generator error in playground

* Fix build

* Fix PS

* Fix PS

* More support of plutus version in constraints libs

* Default to PlutusV1 for now

Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>

* Update cardano-node to 1.35.3-rc1 with deps (#647)

* Upgraded to a cardano-wallet compatible with node 1.35.3-rc1 (#657)

* Reorganized dependencies based on cardano-wallet's cabal.project

* Added the new 'protocolParamUTxOCostPerByte' in 'Ledger.Params' which replaces 'protocolParamUTxOCostPerWord'

* Fixed the `Plutus.Contract.Wallet.mkMintingRedeemers` which triggered an error if the redeemers in the tx contained spending redeemers.

* Simplify MustReferencePubKeyOutput to MustReferenceOutput (#661)

* Replace LedgerPlutusVersion with Language type (#662)

* PLT-494: PlutusV2 TypedValidators (#666)

* Move common code to Plutus.Script.Utils.Typed

* Enable V2 TypedValidators

* Enable and fix reference output tests

* Update cardano-node 1.35.3-rc1 -> 1.35.3 (#669)

* PLT-448: inline scripts in constraint libraries (#678)

* Add inline script support to plutus-tx-constraints.

* Add mustOutputInlineValidator and mustOutputInlineMintingPolicy

* Add documentation

* Check there's no inline script in V1

* Fix wrong minAdaTxOut use

* Update renderGuess.txt

* Naming

* PLT-738: Include plutus language versions with scripts (#681)

* Store Plutus language versions in chain-index

* Introduce Versioned scripts

Remove openapi3 as a dependency of plutus-script-utils

* Add hashing for versioned scripts

* PLT-454: mustUseOutputAsCollateral (#690)

* Finish mustUseOutputAsCollateral implementation

* Add testcase

* Add documentation

* Add missing fields to Ledger.Tx.Internal.Tx (#468)

Add missing fields to Ledger.Tx.Internal.Tx.

  * Add certificates and withdrawals to Tx.

  * Move script witnesses to txScripts.

  * Modify TxIn type, rename to TxInput.

  * Put redeemers together with minting scripts.

  * Translate withdrawals in toCardanoTxBody.

  * Export redeemers for signing with wallet.

* Add tests for mustIncludeDatum tx constraint (#700)

* Add tests for mustIncludeDatum tx constraint (3 failing tests need fix)

* run checks

* Add tests for MustPayToPubKeyAddress tx constraint (#701)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints (#706)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints

* Fixed the 'Ledger.Constraints.OffChain.typedValidatorLookups' lookup
function so that it adds the validator inside the 'TypedValidator' in
the 'slOtherScripts' lookup value.

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* plutus-contract emulator: Change the tx output representation of EmulatorTx to use Cardano.Api.TxOut (#698)

* First draft done for plutus-ledger

* plutus-ledger-constraints use Cardano.Tx

* use C.Tx in plutus-tx-constraints

* plutus-chain-index uses C.TxOut

* Forgot to add file

* Fixing my mess with CardanoAPI

* encoding via plutus.TxOut (can't work, no NetworkId)

* Fix code for the use cases

* Fix a bug in balanceTx

* Fix 0 ada outputs error

* Dirty fix for the uniswap check

* Use Cardano.Tx txId

* fix uniswap test

* Fix double satisfaction

* Fix Marconi

* Add TxOut typeclasses

* Remove unused imports

* Fix failing tests

* Clean import

* Fix pab

* Fix golden values

* Fix golden test

* Fix more plutus packages

* Rmove useless param from ChainIndex.Lib

* Fik playground

* Remove commented code

* Include several fixes following Konstantinos' review

* Add a Pretty TxOut and clean uniswap

* Remove useless stuff in playground

* error in generators display the original cause

* Fix imports

* prettier pretty

* Fix golden tests

* Fix uniswap

* Fix golden tests

* Restore deleted constraints

* Integrate more Sjoerd's comments

* Add tests for mustPayToOtherScript tx constraint (#710)

* Add tests for mustPayToOtherScript tx constraint and 2 more for mustPayToPubKeyAddress

* Fix failing test and reference two PLT tickets

* Refactored MustMint tests to use minting policies and added tests for token burning (#719)

* MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue check the redeemer's presence (#723)

* Add inline datum supports for mustPayToPubKey and mustPayToOtherScript (#721)

* Incremental change for datum

* Work but no inlining

* First working inline datum with V2

* Add tests for inline datum

* add smart constructors for inline datum

* fix PAB

* fixing tx-constraints

* clean up tests

* Address some of Konstantinos' comments

* Separate test group for plutus v2

* Refactor tests in MustPayToPubKeyAddress to ease version handling

* Code clean up

* Code clean up

* Fix unused imports

* Add a way to switch to cardano constraints in MustPayToOtherAddress tests

* more clean up

* PR feedbacks

* Remove dead code

* Add refactoring for MustPayToOtherScript tests

* typo

* clean test suites

* Clean up imports

* Fix some false-positives MustSpendScriptOutput tests using versioned minting policies (#725)

* Fix some false-positives MustSpendScriptOutput tests and refactor to use minting policies

* Use Versioned MintingPolicy and add tests for V2 scripts for MustSpendScriptOutput

* Further refactoring

* Improve onchain check for MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue constraints

* tidy up onchain check

* PLT-448: must spend script output with reference (#716)

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* PR feedback

* More PR feedback

* Fix merge issues

* PLT-807 Change behavior of MustPayToPubKeyAddress and MustPayToOtherScript w.r.t datum in transaction body (#705)

* Changed `MustPayToPubKeyAddress` and `MustPayToOtherScript` so that
  the user needs to explicitly specify if he wants:
    * the datum to only be included as a hash in the transaction
      output
    * the datum to be included as a hash in the transaction output
      as well as in the transaction body
    * the datum to be inlined in the transaction output

* Changed the name of the constraint `MustIncludeDatum` to
  `MustIncludeDatumInTx` and `MustHashDatum` to
  `MustIncludeDatumInTxWithHash`. These constraint don't modify the
  transaction anymore, but simply check that the datum is part of the
  transaction body.

* Added a note on the 'Plutus.Contract.Oracle' module explaining why it
  doesn't work in it's current form.

* Commented out failing test cases in `plutus-use-cases` that use the
  'Plutus.Contract.Oracle' module.

* PLT-511: collateral output in chain index (#730)

* Add collateral output support to chain index

* Generate invalid transactions in tests too

* PR feedback

* PLT-990 Removed Plutus.Contract.Wallet.finalize as we instead set the validity range of a transaction directly in `plutus-ledger-constraints` (since we now have access to the `SlotConfig`) (#741)

* Update the contributing guide (#729)

Co-authored-by: Evgenii Akentev <[email protected]>
Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>
Co-authored-by: Jordan Millar <[email protected]>
Co-authored-by: Andrea Bedini <[email protected]>
Co-authored-by: Markus Läll <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Jamie Bertram <[email protected]>
Co-authored-by: Karol Ochman-Milarski <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: Ziyang Liu <[email protected]>
sjoerdvisscher added a commit that referenced this pull request Oct 13, 2022
* Update the contributing guide (#729)

* next-node is the new merge (ends PLT-558) (#745)

* SCP-3855: update node dep (#449)

* Update Cardano node et al. dependencies for the Vasil HF

* The Cardano node version will only work on a network with the Vasil release.

* Solve some compile issues

* wip: recovering instances for types from plutus-ledger-api

* wip

* plutus-ledger compiles

* plutus-ledger-constraints compiles

* Fixed warnings in Ledger.Tx.CardanoAPI for fields introduced by the Babbage era. Also adapted hashing functions for PlutusV1 scripts to work on PlutusV2

* Fixed warnings in Ledger.Tx.CardanoAPITemp and added implementation to undefined value

* plutus-contract compiles

* Added alonzoGenesisDefaults implementation (copied from cardano-node because it was deleted over there) to Ledger.Validation

* plutus-chain-index-core compiles

* Fixed compilation errors in playground-common and plutus-contract

* Fix compile errors in plutus-example

* Fix compile errors in plutus-pab

* Fix compile errors in plutus-playground-server

* WIP on plutus-use-cases

* Split Tx.Orphans into multiple Orphans

* Fix compilation errors on plutus-use-cases

* fix compilation issues

* Update nix

* fix formatting

* Remove wrongly commited files

* Update purescript modules

* Commented test on plutus-ledger temporarely until cardano-node is updated

* Update cardano-wallet with fixes for haddock

* Fix plutus-playground-client purescript imports

* Fix warnings in plutus-example

* Fix plutus-uniswap cabal

* Try to turn-off haddock for cardano-wallet

* [plutus-contract]: fix golden tests and commented test until cardano-node is updated

* Add cardano-cli/.../genesis.alonzo.spec.json to fix plutus-example

* Fix comment link to PR

* Comment out the test properly

* Update scripts/protocol-parameters with fresh plutusV1 cost parameters

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* [chain-index]: export all servant client functions (#492)

* Fix playground client

* Fix streaming

* Fix purescript

* Create separate directories for v1 and v2 plutus scripts (#486)

* Reorganize the plutus-example library to distinguish clearly between V1
and V2 scripts.

* plutus-example reorganization
create v2 example script

* Modify the ScriptContextChecker module to be more generic

* Propagate the changes to the plutus-example apps and tests

* Update required-redeemer.plutus to also check for an inline datum of 42
and to check for an inline datum of 42 in the reference inputs

* Add PlutusV2 minting and staking scripts (#528)

* [chain-index]: add inline datums support and update cardano-node (#488)

* PLT-484 Upgraded cardano-node version to the official 1.35.0 release. (#551)

* Also upgraded cardano-wallet, plutus et al. versions that work with v1.35.0 of the node.

* Updated golden tests in plutus-use-cases and plutus-contract

* Updated version of components to 1.0.0 with cardano-node (#560)

* Updated the cardano-node bundled with plutus-apps to v1.35.0

* Updated version of all components in their respective cabal files to 1.0.0

* Update cardano-node dependency to 1.35.1

* Updated cardano-wallet, plutus and cardano-ledger to match the node
  version.

* Add script equivalence context test for the V2 context. (#588)

* Remove withIsCardanoEra workaround. (#607)

* BlockInMode now carries a IsCardanoEra constraint

* Increase the delay of awaiting in plutus-pab-executables tests (#565)

Set slot's length to 1s for awaiting tx/out status tests to make them stable

* [PLT-81] plutus-chain-index: support inline scripts when querying TxOut of a TxOutRef (#613)

* Make plutus-ledger-api version explicit in Ledger.Tx

* Make pattern match explicit

* Reorder ScriptChainIndexTxOut fields

To highlight they are the same as PublicKeyChainIndexTxOut.

* Add datum to both branches of ChainIndexTxOut

- Unfortunately we need to rename the fields because they have now
  different types.
- In the PublicKeyChainIndexTxOut case, the output datum is optional and
  we can use plutus-ledger-api OutputDatum type.
- In the ScriptChainIndexTxOut case, the output datum is required,
  nothing changes here but the name.

* Add ReferenceScript to ChainIndexTxOut

* Remove old comment

* Rename _ciTxOutDatumPublicKey and _ciTxOutDatumScript into _ciTxOutPublicKeyDatum and _ciTxOutScriptDatum

* Introduce fromReferenceScript

* Add comments to ChainIndexTxOut

* Add minting context equivalent test plutus script (#631)

* Add missing record field `localTxMonitoringClient` (#617)

* PLT-568: Switch to Babbage era (#614)

* Make Babbage the default era for the emulator

* Clean up

* Accept changes in test output

* Workaround for parseBabbageEraInCardanoModeTx

* Fix minAda calculation

* [next-node]: Bump wallet, plutus, ledger, node (#616)

* Bump cardano-node to 1.35.2 and rest of dependencies based on cardano-wallet

* Use '[TxIn]' instead of 'Set TxIn' in 'data Tx' (#623)

* [plutus-ledger]: Use '[TxIn]' instead of 'Set TxIn' in 'data Tx'.
* Add a property test to check Ord instances of TxIn.
* Sort the inputs in fromOnChainTx
* Sort the inputs in `Emulator.Wallet`
* Fix the review notes and the problem with getInput in StateMachine tests

* PLT-445 Add `mustReferencePubKeyOutput` in constraints library (#640)

* PLT-445 Add mustReferencePubKeyOutput in constraints library

* Added the mustReferencePubKeyOutput constraint in
  plutus-ledger-constraints

* Added a test case for the mustReferencePubKeyOutput

* Refactored Ledger.Tx.CardanoAPI to work with PlutusV2 alongside PlutusV1 scripts in the tx inputs.

* Use existing unitRedeemer

* Move TxIn and TxInType to Ledger.Tx

* Add plutus version to ConsumeScriptAddress constructor

* Add costModelParams for PlutusScriptV2

* Fix error codes.

* Renamed mkTxInfo to mkPV1TxInfo, added test for plutus-tx-constraints without implementation and commented for now the off-chain validation in Ledger.Index

* Implement reference inputs in makeTransactionBody'

* Fixed failing test cases for Ledger.Constraints.mustReferencePubKeyOutput

* Add MustUseOutputAsCollateral

* Fix V2 tests. But issues with V1 tests.

* Disable tests

* WIP

* Remove unused code

* PR feedback

* Remove unused code.

* Clean up

* Added additional info in TODO

* Add Arbitrary instances

* Convert plutus-ledger-constraint tests to PV2

* Fixed test in plutus-ledger-constraints

* Fixed PS generator error in playground

* Fix build

* Fix PS

* Fix PS

* More support of plutus version in constraints libs

* Default to PlutusV1 for now

Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>

* Update cardano-node to 1.35.3-rc1 with deps (#647)

* Upgraded to a cardano-wallet compatible with node 1.35.3-rc1 (#657)

* Reorganized dependencies based on cardano-wallet's cabal.project

* Added the new 'protocolParamUTxOCostPerByte' in 'Ledger.Params' which replaces 'protocolParamUTxOCostPerWord'

* Fixed the `Plutus.Contract.Wallet.mkMintingRedeemers` which triggered an error if the redeemers in the tx contained spending redeemers.

* Simplify MustReferencePubKeyOutput to MustReferenceOutput (#661)

* Replace LedgerPlutusVersion with Language type (#662)

* PLT-494: PlutusV2 TypedValidators (#666)

* Move common code to Plutus.Script.Utils.Typed

* Enable V2 TypedValidators

* Enable and fix reference output tests

* Update cardano-node 1.35.3-rc1 -> 1.35.3 (#669)

* PLT-448: inline scripts in constraint libraries (#678)

* Add inline script support to plutus-tx-constraints.

* Add mustOutputInlineValidator and mustOutputInlineMintingPolicy

* Add documentation

* Check there's no inline script in V1

* Fix wrong minAdaTxOut use

* Update renderGuess.txt

* Naming

* PLT-738: Include plutus language versions with scripts (#681)

* Store Plutus language versions in chain-index

* Introduce Versioned scripts

Remove openapi3 as a dependency of plutus-script-utils

* Add hashing for versioned scripts

* PLT-454: mustUseOutputAsCollateral (#690)

* Finish mustUseOutputAsCollateral implementation

* Add testcase

* Add documentation

* Add missing fields to Ledger.Tx.Internal.Tx (#468)

Add missing fields to Ledger.Tx.Internal.Tx.

  * Add certificates and withdrawals to Tx.

  * Move script witnesses to txScripts.

  * Modify TxIn type, rename to TxInput.

  * Put redeemers together with minting scripts.

  * Translate withdrawals in toCardanoTxBody.

  * Export redeemers for signing with wallet.

* Add tests for mustIncludeDatum tx constraint (#700)

* Add tests for mustIncludeDatum tx constraint (3 failing tests need fix)

* run checks

* Add tests for MustPayToPubKeyAddress tx constraint (#701)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints (#706)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints

* Fixed the 'Ledger.Constraints.OffChain.typedValidatorLookups' lookup
function so that it adds the validator inside the 'TypedValidator' in
the 'slOtherScripts' lookup value.

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* plutus-contract emulator: Change the tx output representation of EmulatorTx to use Cardano.Api.TxOut (#698)

* First draft done for plutus-ledger

* plutus-ledger-constraints use Cardano.Tx

* use C.Tx in plutus-tx-constraints

* plutus-chain-index uses C.TxOut

* Forgot to add file

* Fixing my mess with CardanoAPI

* encoding via plutus.TxOut (can't work, no NetworkId)

* Fix code for the use cases

* Fix a bug in balanceTx

* Fix 0 ada outputs error

* Dirty fix for the uniswap check

* Use Cardano.Tx txId

* fix uniswap test

* Fix double satisfaction

* Fix Marconi

* Add TxOut typeclasses

* Remove unused imports

* Fix failing tests

* Clean import

* Fix pab

* Fix golden values

* Fix golden test

* Fix more plutus packages

* Rmove useless param from ChainIndex.Lib

* Fik playground

* Remove commented code

* Include several fixes following Konstantinos' review

* Add a Pretty TxOut and clean uniswap

* Remove useless stuff in playground

* error in generators display the original cause

* Fix imports

* prettier pretty

* Fix golden tests

* Fix uniswap

* Fix golden tests

* Restore deleted constraints

* Integrate more Sjoerd's comments

* Add tests for mustPayToOtherScript tx constraint (#710)

* Add tests for mustPayToOtherScript tx constraint and 2 more for mustPayToPubKeyAddress

* Fix failing test and reference two PLT tickets

* Refactored MustMint tests to use minting policies and added tests for token burning (#719)

* MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue check the redeemer's presence (#723)

* Add inline datum supports for mustPayToPubKey and mustPayToOtherScript (#721)

* Incremental change for datum

* Work but no inlining

* First working inline datum with V2

* Add tests for inline datum

* add smart constructors for inline datum

* fix PAB

* fixing tx-constraints

* clean up tests

* Address some of Konstantinos' comments

* Separate test group for plutus v2

* Refactor tests in MustPayToPubKeyAddress to ease version handling

* Code clean up

* Code clean up

* Fix unused imports

* Add a way to switch to cardano constraints in MustPayToOtherAddress tests

* more clean up

* PR feedbacks

* Remove dead code

* Add refactoring for MustPayToOtherScript tests

* typo

* clean test suites

* Clean up imports

* Fix some false-positives MustSpendScriptOutput tests using versioned minting policies (#725)

* Fix some false-positives MustSpendScriptOutput tests and refactor to use minting policies

* Use Versioned MintingPolicy and add tests for V2 scripts for MustSpendScriptOutput

* Further refactoring

* Improve onchain check for MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue constraints

* tidy up onchain check

* PLT-448: must spend script output with reference (#716)

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* PR feedback

* More PR feedback

* Fix merge issues

* PLT-807 Change behavior of MustPayToPubKeyAddress and MustPayToOtherScript w.r.t datum in transaction body (#705)

* Changed `MustPayToPubKeyAddress` and `MustPayToOtherScript` so that
  the user needs to explicitly specify if he wants:
    * the datum to only be included as a hash in the transaction
      output
    * the datum to be included as a hash in the transaction output
      as well as in the transaction body
    * the datum to be inlined in the transaction output

* Changed the name of the constraint `MustIncludeDatum` to
  `MustIncludeDatumInTx` and `MustHashDatum` to
  `MustIncludeDatumInTxWithHash`. These constraint don't modify the
  transaction anymore, but simply check that the datum is part of the
  transaction body.

* Added a note on the 'Plutus.Contract.Oracle' module explaining why it
  doesn't work in it's current form.

* Commented out failing test cases in `plutus-use-cases` that use the
  'Plutus.Contract.Oracle' module.

* PLT-511: collateral output in chain index (#730)

* Add collateral output support to chain index

* Generate invalid transactions in tests too

* PR feedback

* PLT-990 Removed Plutus.Contract.Wallet.finalize as we instead set the validity range of a transaction directly in `plutus-ledger-constraints` (since we now have access to the `SlotConfig`) (#741)

* Update the contributing guide (#729)

Co-authored-by: Evgenii Akentev <[email protected]>
Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>
Co-authored-by: Jordan Millar <[email protected]>
Co-authored-by: Andrea Bedini <[email protected]>
Co-authored-by: Markus Läll <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Jamie Bertram <[email protected]>
Co-authored-by: Karol Ochman-Milarski <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: Ziyang Liu <[email protected]>

* Revert "next-node is the new merge (ends PLT-558) (#745)" (#746)

This reverts commit dc3f549.

* chore(deps): bump nixbuild/nix-quick-install-action from 17 to 18 (#743)

Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 17 to 18.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](nixbuild/nix-quick-install-action@v17...v18)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add proper ToJSON instance for unit test results (#744)

* Add collateral output fields

* Add collateral balancing tests

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Ziyang Liu <[email protected]>
Co-authored-by: Nicolas B <[email protected]>
Co-authored-by: Evgenii Akentev <[email protected]>
Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>
Co-authored-by: Jordan Millar <[email protected]>
Co-authored-by: Andrea Bedini <[email protected]>
Co-authored-by: Markus Läll <[email protected]>
Co-authored-by: Jamie Bertram <[email protected]>
Co-authored-by: Karol Ochman-Milarski <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ulf Norell <[email protected]>
ghost pushed a commit that referenced this pull request Nov 8, 2022
* Update the contributing guide (#729)

* next-node is the new merge (ends PLT-558) (#745)

* SCP-3855: update node dep (#449)

* Update Cardano node et al. dependencies for the Vasil HF

* The Cardano node version will only work on a network with the Vasil release.

* Solve some compile issues

* wip: recovering instances for types from plutus-ledger-api

* wip

* plutus-ledger compiles

* plutus-ledger-constraints compiles

* Fixed warnings in Ledger.Tx.CardanoAPI for fields introduced by the Babbage era. Also adapted hashing functions for PlutusV1 scripts to work on PlutusV2

* Fixed warnings in Ledger.Tx.CardanoAPITemp and added implementation to undefined value

* plutus-contract compiles

* Added alonzoGenesisDefaults implementation (copied from cardano-node because it was deleted over there) to Ledger.Validation

* plutus-chain-index-core compiles

* Fixed compilation errors in playground-common and plutus-contract

* Fix compile errors in plutus-example

* Fix compile errors in plutus-pab

* Fix compile errors in plutus-playground-server

* WIP on plutus-use-cases

* Split Tx.Orphans into multiple Orphans

* Fix compilation errors on plutus-use-cases

* fix compilation issues

* Update nix

* fix formatting

* Remove wrongly commited files

* Update purescript modules

* Commented test on plutus-ledger temporarely until cardano-node is updated

* Update cardano-wallet with fixes for haddock

* Fix plutus-playground-client purescript imports

* Fix warnings in plutus-example

* Fix plutus-uniswap cabal

* Try to turn-off haddock for cardano-wallet

* [plutus-contract]: fix golden tests and commented test until cardano-node is updated

* Add cardano-cli/.../genesis.alonzo.spec.json to fix plutus-example

* Fix comment link to PR

* Comment out the test properly

* Update scripts/protocol-parameters with fresh plutusV1 cost parameters

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* [chain-index]: export all servant client functions (#492)

* Fix playground client

* Fix streaming

* Fix purescript

* Create separate directories for v1 and v2 plutus scripts (#486)

* Reorganize the plutus-example library to distinguish clearly between V1
and V2 scripts.

* plutus-example reorganization
create v2 example script

* Modify the ScriptContextChecker module to be more generic

* Propagate the changes to the plutus-example apps and tests

* Update required-redeemer.plutus to also check for an inline datum of 42
and to check for an inline datum of 42 in the reference inputs

* Add PlutusV2 minting and staking scripts (#528)

* [chain-index]: add inline datums support and update cardano-node (#488)

* PLT-484 Upgraded cardano-node version to the official 1.35.0 release. (#551)

* Also upgraded cardano-wallet, plutus et al. versions that work with v1.35.0 of the node.

* Updated golden tests in plutus-use-cases and plutus-contract

* Updated version of components to 1.0.0 with cardano-node (#560)

* Updated the cardano-node bundled with plutus-apps to v1.35.0

* Updated version of all components in their respective cabal files to 1.0.0

* Update cardano-node dependency to 1.35.1

* Updated cardano-wallet, plutus and cardano-ledger to match the node
  version.

* Add script equivalence context test for the V2 context. (#588)

* Remove withIsCardanoEra workaround. (#607)

* BlockInMode now carries a IsCardanoEra constraint

* Increase the delay of awaiting in plutus-pab-executables tests (#565)

Set slot's length to 1s for awaiting tx/out status tests to make them stable

* [PLT-81] plutus-chain-index: support inline scripts when querying TxOut of a TxOutRef (#613)

* Make plutus-ledger-api version explicit in Ledger.Tx

* Make pattern match explicit

* Reorder ScriptChainIndexTxOut fields

To highlight they are the same as PublicKeyChainIndexTxOut.

* Add datum to both branches of ChainIndexTxOut

- Unfortunately we need to rename the fields because they have now
  different types.
- In the PublicKeyChainIndexTxOut case, the output datum is optional and
  we can use plutus-ledger-api OutputDatum type.
- In the ScriptChainIndexTxOut case, the output datum is required,
  nothing changes here but the name.

* Add ReferenceScript to ChainIndexTxOut

* Remove old comment

* Rename _ciTxOutDatumPublicKey and _ciTxOutDatumScript into _ciTxOutPublicKeyDatum and _ciTxOutScriptDatum

* Introduce fromReferenceScript

* Add comments to ChainIndexTxOut

* Add minting context equivalent test plutus script (#631)

* Add missing record field `localTxMonitoringClient` (#617)

* PLT-568: Switch to Babbage era (#614)

* Make Babbage the default era for the emulator

* Clean up

* Accept changes in test output

* Workaround for parseBabbageEraInCardanoModeTx

* Fix minAda calculation

* [next-node]: Bump wallet, plutus, ledger, node (#616)

* Bump cardano-node to 1.35.2 and rest of dependencies based on cardano-wallet

* Use '[TxIn]' instead of 'Set TxIn' in 'data Tx' (#623)

* [plutus-ledger]: Use '[TxIn]' instead of 'Set TxIn' in 'data Tx'.
* Add a property test to check Ord instances of TxIn.
* Sort the inputs in fromOnChainTx
* Sort the inputs in `Emulator.Wallet`
* Fix the review notes and the problem with getInput in StateMachine tests

* PLT-445 Add `mustReferencePubKeyOutput` in constraints library (#640)

* PLT-445 Add mustReferencePubKeyOutput in constraints library

* Added the mustReferencePubKeyOutput constraint in
  plutus-ledger-constraints

* Added a test case for the mustReferencePubKeyOutput

* Refactored Ledger.Tx.CardanoAPI to work with PlutusV2 alongside PlutusV1 scripts in the tx inputs.

* Use existing unitRedeemer

* Move TxIn and TxInType to Ledger.Tx

* Add plutus version to ConsumeScriptAddress constructor

* Add costModelParams for PlutusScriptV2

* Fix error codes.

* Renamed mkTxInfo to mkPV1TxInfo, added test for plutus-tx-constraints without implementation and commented for now the off-chain validation in Ledger.Index

* Implement reference inputs in makeTransactionBody'

* Fixed failing test cases for Ledger.Constraints.mustReferencePubKeyOutput

* Add MustUseOutputAsCollateral

* Fix V2 tests. But issues with V1 tests.

* Disable tests

* WIP

* Remove unused code

* PR feedback

* Remove unused code.

* Clean up

* Added additional info in TODO

* Add Arbitrary instances

* Convert plutus-ledger-constraint tests to PV2

* Fixed test in plutus-ledger-constraints

* Fixed PS generator error in playground

* Fix build

* Fix PS

* Fix PS

* More support of plutus version in constraints libs

* Default to PlutusV1 for now

Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>

* Update cardano-node to 1.35.3-rc1 with deps (#647)

* Upgraded to a cardano-wallet compatible with node 1.35.3-rc1 (#657)

* Reorganized dependencies based on cardano-wallet's cabal.project

* Added the new 'protocolParamUTxOCostPerByte' in 'Ledger.Params' which replaces 'protocolParamUTxOCostPerWord'

* Fixed the `Plutus.Contract.Wallet.mkMintingRedeemers` which triggered an error if the redeemers in the tx contained spending redeemers.

* Simplify MustReferencePubKeyOutput to MustReferenceOutput (#661)

* Replace LedgerPlutusVersion with Language type (#662)

* PLT-494: PlutusV2 TypedValidators (#666)

* Move common code to Plutus.Script.Utils.Typed

* Enable V2 TypedValidators

* Enable and fix reference output tests

* Update cardano-node 1.35.3-rc1 -> 1.35.3 (#669)

* PLT-448: inline scripts in constraint libraries (#678)

* Add inline script support to plutus-tx-constraints.

* Add mustOutputInlineValidator and mustOutputInlineMintingPolicy

* Add documentation

* Check there's no inline script in V1

* Fix wrong minAdaTxOut use

* Update renderGuess.txt

* Naming

* PLT-738: Include plutus language versions with scripts (#681)

* Store Plutus language versions in chain-index

* Introduce Versioned scripts

Remove openapi3 as a dependency of plutus-script-utils

* Add hashing for versioned scripts

* PLT-454: mustUseOutputAsCollateral (#690)

* Finish mustUseOutputAsCollateral implementation

* Add testcase

* Add documentation

* Add missing fields to Ledger.Tx.Internal.Tx (#468)

Add missing fields to Ledger.Tx.Internal.Tx.

  * Add certificates and withdrawals to Tx.

  * Move script witnesses to txScripts.

  * Modify TxIn type, rename to TxInput.

  * Put redeemers together with minting scripts.

  * Translate withdrawals in toCardanoTxBody.

  * Export redeemers for signing with wallet.

* Add tests for mustIncludeDatum tx constraint (#700)

* Add tests for mustIncludeDatum tx constraint (3 failing tests need fix)

* run checks

* Add tests for MustPayToPubKeyAddress tx constraint (#701)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints (#706)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints

* Fixed the 'Ledger.Constraints.OffChain.typedValidatorLookups' lookup
function so that it adds the validator inside the 'TypedValidator' in
the 'slOtherScripts' lookup value.

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* plutus-contract emulator: Change the tx output representation of EmulatorTx to use Cardano.Api.TxOut (#698)

* First draft done for plutus-ledger

* plutus-ledger-constraints use Cardano.Tx

* use C.Tx in plutus-tx-constraints

* plutus-chain-index uses C.TxOut

* Forgot to add file

* Fixing my mess with CardanoAPI

* encoding via plutus.TxOut (can't work, no NetworkId)

* Fix code for the use cases

* Fix a bug in balanceTx

* Fix 0 ada outputs error

* Dirty fix for the uniswap check

* Use Cardano.Tx txId

* fix uniswap test

* Fix double satisfaction

* Fix Marconi

* Add TxOut typeclasses

* Remove unused imports

* Fix failing tests

* Clean import

* Fix pab

* Fix golden values

* Fix golden test

* Fix more plutus packages

* Rmove useless param from ChainIndex.Lib

* Fik playground

* Remove commented code

* Include several fixes following Konstantinos' review

* Add a Pretty TxOut and clean uniswap

* Remove useless stuff in playground

* error in generators display the original cause

* Fix imports

* prettier pretty

* Fix golden tests

* Fix uniswap

* Fix golden tests

* Restore deleted constraints

* Integrate more Sjoerd's comments

* Add tests for mustPayToOtherScript tx constraint (#710)

* Add tests for mustPayToOtherScript tx constraint and 2 more for mustPayToPubKeyAddress

* Fix failing test and reference two PLT tickets

* Refactored MustMint tests to use minting policies and added tests for token burning (#719)

* MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue check the redeemer's presence (#723)

* Add inline datum supports for mustPayToPubKey and mustPayToOtherScript (#721)

* Incremental change for datum

* Work but no inlining

* First working inline datum with V2

* Add tests for inline datum

* add smart constructors for inline datum

* fix PAB

* fixing tx-constraints

* clean up tests

* Address some of Konstantinos' comments

* Separate test group for plutus v2

* Refactor tests in MustPayToPubKeyAddress to ease version handling

* Code clean up

* Code clean up

* Fix unused imports

* Add a way to switch to cardano constraints in MustPayToOtherAddress tests

* more clean up

* PR feedbacks

* Remove dead code

* Add refactoring for MustPayToOtherScript tests

* typo

* clean test suites

* Clean up imports

* Fix some false-positives MustSpendScriptOutput tests using versioned minting policies (#725)

* Fix some false-positives MustSpendScriptOutput tests and refactor to use minting policies

* Use Versioned MintingPolicy and add tests for V2 scripts for MustSpendScriptOutput

* Further refactoring

* Improve onchain check for MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue constraints

* tidy up onchain check

* PLT-448: must spend script output with reference (#716)

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* PR feedback

* More PR feedback

* Fix merge issues

* PLT-807 Change behavior of MustPayToPubKeyAddress and MustPayToOtherScript w.r.t datum in transaction body (#705)

* Changed `MustPayToPubKeyAddress` and `MustPayToOtherScript` so that
  the user needs to explicitly specify if he wants:
    * the datum to only be included as a hash in the transaction
      output
    * the datum to be included as a hash in the transaction output
      as well as in the transaction body
    * the datum to be inlined in the transaction output

* Changed the name of the constraint `MustIncludeDatum` to
  `MustIncludeDatumInTx` and `MustHashDatum` to
  `MustIncludeDatumInTxWithHash`. These constraint don't modify the
  transaction anymore, but simply check that the datum is part of the
  transaction body.

* Added a note on the 'Plutus.Contract.Oracle' module explaining why it
  doesn't work in it's current form.

* Commented out failing test cases in `plutus-use-cases` that use the
  'Plutus.Contract.Oracle' module.

* PLT-511: collateral output in chain index (#730)

* Add collateral output support to chain index

* Generate invalid transactions in tests too

* PR feedback

* PLT-990 Removed Plutus.Contract.Wallet.finalize as we instead set the validity range of a transaction directly in `plutus-ledger-constraints` (since we now have access to the `SlotConfig`) (#741)

* Update the contributing guide (#729)

Co-authored-by: Evgenii Akentev <[email protected]>
Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>
Co-authored-by: Jordan Millar <[email protected]>
Co-authored-by: Andrea Bedini <[email protected]>
Co-authored-by: Markus Läll <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Jamie Bertram <[email protected]>
Co-authored-by: Karol Ochman-Milarski <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: Ziyang Liu <[email protected]>

* Revert "next-node is the new merge (ends PLT-558) (#745)" (#746)

This reverts commit dc3f549.

* chore(deps): bump nixbuild/nix-quick-install-action from 17 to 18 (#743)

Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 17 to 18.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](nixbuild/nix-quick-install-action@v17...v18)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add proper ToJSON instance for unit test results (#744)

* Add collateral output fields

* Add collateral balancing tests

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Ziyang Liu <[email protected]>
Co-authored-by: Nicolas B <[email protected]>
Co-authored-by: Evgenii Akentev <[email protected]>
Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>
Co-authored-by: Jordan Millar <[email protected]>
Co-authored-by: Andrea Bedini <[email protected]>
Co-authored-by: Markus Läll <[email protected]>
Co-authored-by: Jamie Bertram <[email protected]>
Co-authored-by: Karol Ochman-Milarski <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ulf Norell <[email protected]>
koslambrou added a commit that referenced this pull request Apr 6, 2023
* SCP-3855: update node dep (#449)

* Update Cardano node et al. dependencies for the Vasil HF

* The Cardano node version will only work on a network with the Vasil release.

* Solve some compile issues

* wip: recovering instances for types from plutus-ledger-api

* wip

* plutus-ledger compiles

* plutus-ledger-constraints compiles

* Fixed warnings in Ledger.Tx.CardanoAPI for fields introduced by the Babbage era. Also adapted hashing functions for PlutusV1 scripts to work on PlutusV2

* Fixed warnings in Ledger.Tx.CardanoAPITemp and added implementation to undefined value

* plutus-contract compiles

* Added alonzoGenesisDefaults implementation (copied from cardano-node because it was deleted over there) to Ledger.Validation

* plutus-chain-index-core compiles

* Fixed compilation errors in playground-common and plutus-contract

* Fix compile errors in plutus-example

* Fix compile errors in plutus-pab

* Fix compile errors in plutus-playground-server

* WIP on plutus-use-cases

* Split Tx.Orphans into multiple Orphans

* Fix compilation errors on plutus-use-cases

* fix compilation issues

* Update nix

* fix formatting

* Remove wrongly commited files

* Update purescript modules

* Commented test on plutus-ledger temporarely until cardano-node is updated

* Update cardano-wallet with fixes for haddock

* Fix plutus-playground-client purescript imports

* Fix warnings in plutus-example

* Fix plutus-uniswap cabal

* Try to turn-off haddock for cardano-wallet

* [plutus-contract]: fix golden tests and commented test until cardano-node is updated

* Add cardano-cli/.../genesis.alonzo.spec.json to fix plutus-example

* Fix comment link to PR

* Comment out the test properly

* Update scripts/protocol-parameters with fresh plutusV1 cost parameters

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* [chain-index]: export all servant client functions (#492)

* Fix playground client

* Fix streaming

* Fix purescript

* Create separate directories for v1 and v2 plutus scripts (#486)

* Reorganize the plutus-example library to distinguish clearly between V1
and V2 scripts.

* plutus-example reorganization
create v2 example script

* Modify the ScriptContextChecker module to be more generic

* Propagate the changes to the plutus-example apps and tests

* Update required-redeemer.plutus to also check for an inline datum of 42
and to check for an inline datum of 42 in the reference inputs

* Add PlutusV2 minting and staking scripts (#528)

* [chain-index]: add inline datums support and update cardano-node (#488)

* PLT-484 Upgraded cardano-node version to the official 1.35.0 release. (#551)

* Also upgraded cardano-wallet, plutus et al. versions that work with v1.35.0 of the node.

* Updated golden tests in plutus-use-cases and plutus-contract

* Updated version of components to 1.0.0 with cardano-node (#560)

* Updated the cardano-node bundled with plutus-apps to v1.35.0

* Updated version of all components in their respective cabal files to 1.0.0

* Update cardano-node dependency to 1.35.1

* Updated cardano-wallet, plutus and cardano-ledger to match the node
  version.

* Add script equivalence context test for the V2 context. (#588)

* Remove withIsCardanoEra workaround. (#607)

* BlockInMode now carries a IsCardanoEra constraint

* Increase the delay of awaiting in plutus-pab-executables tests (#565)

Set slot's length to 1s for awaiting tx/out status tests to make them stable

* [PLT-81] plutus-chain-index: support inline scripts when querying TxOut of a TxOutRef (#613)

* Make plutus-ledger-api version explicit in Ledger.Tx

* Make pattern match explicit

* Reorder ScriptChainIndexTxOut fields

To highlight they are the same as PublicKeyChainIndexTxOut.

* Add datum to both branches of ChainIndexTxOut

- Unfortunately we need to rename the fields because they have now
  different types.
- In the PublicKeyChainIndexTxOut case, the output datum is optional and
  we can use plutus-ledger-api OutputDatum type.
- In the ScriptChainIndexTxOut case, the output datum is required,
  nothing changes here but the name.

* Add ReferenceScript to ChainIndexTxOut

* Remove old comment

* Rename _ciTxOutDatumPublicKey and _ciTxOutDatumScript into _ciTxOutPublicKeyDatum and _ciTxOutScriptDatum

* Introduce fromReferenceScript

* Add comments to ChainIndexTxOut

* Add minting context equivalent test plutus script (#631)

* Add missing record field `localTxMonitoringClient` (#617)

* PLT-568: Switch to Babbage era (#614)

* Make Babbage the default era for the emulator

* Clean up

* Accept changes in test output

* Workaround for parseBabbageEraInCardanoModeTx

* Fix minAda calculation

* [next-node]: Bump wallet, plutus, ledger, node (#616)

* Bump cardano-node to 1.35.2 and rest of dependencies based on cardano-wallet

* Use '[TxIn]' instead of 'Set TxIn' in 'data Tx' (#623)

* [plutus-ledger]: Use '[TxIn]' instead of 'Set TxIn' in 'data Tx'.
* Add a property test to check Ord instances of TxIn.
* Sort the inputs in fromOnChainTx
* Sort the inputs in `Emulator.Wallet`
* Fix the review notes and the problem with getInput in StateMachine tests

* PLT-445 Add `mustReferencePubKeyOutput` in constraints library (#640)

* PLT-445 Add mustReferencePubKeyOutput in constraints library

* Added the mustReferencePubKeyOutput constraint in
  plutus-ledger-constraints

* Added a test case for the mustReferencePubKeyOutput

* Refactored Ledger.Tx.CardanoAPI to work with PlutusV2 alongside PlutusV1 scripts in the tx inputs.

* Use existing unitRedeemer

* Move TxIn and TxInType to Ledger.Tx

* Add plutus version to ConsumeScriptAddress constructor

* Add costModelParams for PlutusScriptV2

* Fix error codes.

* Renamed mkTxInfo to mkPV1TxInfo, added test for plutus-tx-constraints without implementation and commented for now the off-chain validation in Ledger.Index

* Implement reference inputs in makeTransactionBody'

* Fixed failing test cases for Ledger.Constraints.mustReferencePubKeyOutput

* Add MustUseOutputAsCollateral

* Fix V2 tests. But issues with V1 tests.

* Disable tests

* WIP

* Remove unused code

* PR feedback

* Remove unused code.

* Clean up

* Added additional info in TODO

* Add Arbitrary instances

* Convert plutus-ledger-constraint tests to PV2

* Fixed test in plutus-ledger-constraints

* Fixed PS generator error in playground

* Fix build

* Fix PS

* Fix PS

* More support of plutus version in constraints libs

* Default to PlutusV1 for now

Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>

* Update cardano-node to 1.35.3-rc1 with deps (#647)

* Upgraded to a cardano-wallet compatible with node 1.35.3-rc1 (#657)

* Reorganized dependencies based on cardano-wallet's cabal.project

* Added the new 'protocolParamUTxOCostPerByte' in 'Ledger.Params' which replaces 'protocolParamUTxOCostPerWord'

* Fixed the `Plutus.Contract.Wallet.mkMintingRedeemers` which triggered an error if the redeemers in the tx contained spending redeemers.

* Simplify MustReferencePubKeyOutput to MustReferenceOutput (#661)

* Replace LedgerPlutusVersion with Language type (#662)

* PLT-494: PlutusV2 TypedValidators (#666)

* Move common code to Plutus.Script.Utils.Typed

* Enable V2 TypedValidators

* Enable and fix reference output tests

* Update cardano-node 1.35.3-rc1 -> 1.35.3 (#669)

* PLT-448: inline scripts in constraint libraries (#678)

* Add inline script support to plutus-tx-constraints.

* Add mustOutputInlineValidator and mustOutputInlineMintingPolicy

* Add documentation

* Check there's no inline script in V1

* Fix wrong minAdaTxOut use

* Update renderGuess.txt

* Naming

* PLT-738: Include plutus language versions with scripts (#681)

* Store Plutus language versions in chain-index

* Introduce Versioned scripts

Remove openapi3 as a dependency of plutus-script-utils

* Add hashing for versioned scripts

* PLT-454: mustUseOutputAsCollateral (#690)

* Finish mustUseOutputAsCollateral implementation

* Add testcase

* Add documentation

* Add missing fields to Ledger.Tx.Internal.Tx (#468)

Add missing fields to Ledger.Tx.Internal.Tx.

  * Add certificates and withdrawals to Tx.

  * Move script witnesses to txScripts.

  * Modify TxIn type, rename to TxInput.

  * Put redeemers together with minting scripts.

  * Translate withdrawals in toCardanoTxBody.

  * Export redeemers for signing with wallet.

* Add tests for mustIncludeDatum tx constraint (#700)

* Add tests for mustIncludeDatum tx constraint (3 failing tests need fix)

* run checks

* Add tests for MustPayToPubKeyAddress tx constraint (#701)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints (#706)

* Add tests for mustSpendScriptOutput and mustSpendScriptOutputWithMatchingDatumAndValue tx constraints

* Fixed the 'Ledger.Constraints.OffChain.typedValidatorLookups' lookup
function so that it adds the validator inside the 'TypedValidator' in
the 'slOtherScripts' lookup value.

Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>

* plutus-contract emulator: Change the tx output representation of EmulatorTx to use Cardano.Api.TxOut (#698)

* First draft done for plutus-ledger

* plutus-ledger-constraints use Cardano.Tx

* use C.Tx in plutus-tx-constraints

* plutus-chain-index uses C.TxOut

* Forgot to add file

* Fixing my mess with CardanoAPI

* encoding via plutus.TxOut (can't work, no NetworkId)

* Fix code for the use cases

* Fix a bug in balanceTx

* Fix 0 ada outputs error

* Dirty fix for the uniswap check

* Use Cardano.Tx txId

* fix uniswap test

* Fix double satisfaction

* Fix Marconi

* Add TxOut typeclasses

* Remove unused imports

* Fix failing tests

* Clean import

* Fix pab

* Fix golden values

* Fix golden test

* Fix more plutus packages

* Rmove useless param from ChainIndex.Lib

* Fik playground

* Remove commented code

* Include several fixes following Konstantinos' review

* Add a Pretty TxOut and clean uniswap

* Remove useless stuff in playground

* error in generators display the original cause

* Fix imports

* prettier pretty

* Fix golden tests

* Fix uniswap

* Fix golden tests

* Restore deleted constraints

* Integrate more Sjoerd's comments

* Add tests for mustPayToOtherScript tx constraint (#710)

* Add tests for mustPayToOtherScript tx constraint and 2 more for mustPayToPubKeyAddress

* Fix failing test and reference two PLT tickets

* Refactored MustMint tests to use minting policies and added tests for token burning (#719)

* MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue check the redeemer's presence (#723)

* Add inline datum supports for mustPayToPubKey and mustPayToOtherScript (#721)

* Incremental change for datum

* Work but no inlining

* First working inline datum with V2

* Add tests for inline datum

* add smart constructors for inline datum

* fix PAB

* fixing tx-constraints

* clean up tests

* Address some of Konstantinos' comments

* Separate test group for plutus v2

* Refactor tests in MustPayToPubKeyAddress to ease version handling

* Code clean up

* Code clean up

* Fix unused imports

* Add a way to switch to cardano constraints in MustPayToOtherAddress tests

* more clean up

* PR feedbacks

* Remove dead code

* Add refactoring for MustPayToOtherScript tests

* typo

* clean test suites

* Clean up imports

* Fix some false-positives MustSpendScriptOutput tests using versioned minting policies (#725)

* Fix some false-positives MustSpendScriptOutput tests and refactor to use minting policies

* Use Versioned MintingPolicy and add tests for V2 scripts for MustSpendScriptOutput

* Further refactoring

* Improve onchain check for MustSpendScriptOutput and MustSpendScriptOutputWithMatchingDatumAndValue constraints

* tidy up onchain check

* PLT-448: must spend script output with reference (#716)

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* Add ownAddress (singular)

* Support reference scripts in TxIn

* Add mustSpendScriptOutputWithReference

* Test using reference scripts

* Fix merge issues

* Direct conversion from ChainIndexTxOut to the new TxOut

* Push Versioned inside Either

* Accept test outputs

* Fix reference script support in ledger-constraints

* Fix comments

* PR feedback

* More PR feedback

* Fix merge issues

* PLT-807 Change behavior of MustPayToPubKeyAddress and MustPayToOtherScript w.r.t datum in transaction body (#705)

* Changed `MustPayToPubKeyAddress` and `MustPayToOtherScript` so that
  the user needs to explicitly specify if he wants:
    * the datum to only be included as a hash in the transaction
      output
    * the datum to be included as a hash in the transaction output
      as well as in the transaction body
    * the datum to be inlined in the transaction output

* Changed the name of the constraint `MustIncludeDatum` to
  `MustIncludeDatumInTx` and `MustHashDatum` to
  `MustIncludeDatumInTxWithHash`. These constraint don't modify the
  transaction anymore, but simply check that the datum is part of the
  transaction body.

* Added a note on the 'Plutus.Contract.Oracle' module explaining why it
  doesn't work in it's current form.

* Commented out failing test cases in `plutus-use-cases` that use the
  'Plutus.Contract.Oracle' module.

* PLT-511: collateral output in chain index (#730)

* Add collateral output support to chain index

* Generate invalid transactions in tests too

* PR feedback

* PLT-990 Removed Plutus.Contract.Wallet.finalize as we instead set the validity range of a transaction directly in `plutus-ledger-constraints` (since we now have access to the `SlotConfig`) (#741)

* Update the contributing guide (#729)

Co-authored-by: Evgenii Akentev <[email protected]>
Co-authored-by: Konstantinos Lambrou-Latreille <[email protected]>
Co-authored-by: Jordan Millar <[email protected]>
Co-authored-by: Andrea Bedini <[email protected]>
Co-authored-by: Markus Läll <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Sjoerd Visscher <[email protected]>
Co-authored-by: Jamie Bertram <[email protected]>
Co-authored-by: Karol Ochman-Milarski <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: Ziyang Liu <[email protected]>
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plutus-pab-test-full can non-deterministically break.
1 participant