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

Enable build of CertifyingAndWithdrawingPlutus test #364

Merged
merged 8 commits into from
Mar 30, 2022

Conversation

newhoggy
Copy link
Collaborator

@newhoggy newhoggy commented Mar 17, 2022

Changes

  • Enable CertifyingAndWithdrawingPlutus test.
  • Add necessary configuration, data, and script files for enabling the test.
  • Update cardano-node dependency.
  • Add cardano-node and cardano-cli as build-tool-depends.

Example output

$ cabal test plutus-example --enable-tests
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - plutus-example-1.33.0 (test:plutus-example-test) (first run)
Preprocessing test suite 'plutus-example-test' for plutus-example-1.33.0..
Building test suite 'plutus-example-test' for plutus-example-1.33.0..
Running 1 test suites...
Test suite plutus-example-test: RUNNING...
plutus-example
  Plutus.Direct.CertifyingAndWithdrawingPlutus: OK (102.33s)
      ✓ Plutus.Direct.CertifyingAndWithdrawingPlutus passed 1 test.
  prop_TxId_Api_Ledger_Plutus_Roundtrip:        OK (0.89s)
      ✓ prop_TxId_Api_Ledger_Plutus_Roundtrip passed 100 tests.
  prop_TxId_Api_Ledger_Roundtrip:               OK (0.92s)
      ✓ prop_TxId_Api_Ledger_Roundtrip passed 100 tests.
  prop_ScriptData_MyCustomRedeemer:             OK (0.38s)
      ✓ prop_ScriptData_MyCustomRedeemer passed 100 tests.
  prop_ScriptData_MyCustomRedeemer_JSON:        OK (0.47s)
      ✓ prop_ScriptData_MyCustomRedeemer_JSON passed 100 tests.

All 5 tests passed (104.99s)
Test suite plutus-example-test: PASS
Test suite logged to:
/Users/jky/wrk/iohk/plutus-apps/dist-newstyle/build/x86_64-osx/ghc-8.10.7/plutus-example-1.33.0/t/plutus-example-test/test/plutus-example-1.33.0-plutus-example-test.log
1 of 1 test suites (1 of 1 test cases) passed.

Work in progress

Currently this PR doesn't build in nix and it involves some dependency version changes that don't track the documented projects in cabal.project, so the PR is not ready for merging.

@newhoggy newhoggy force-pushed the newhoggy/enable-CertifyingAndWithdrawingPlutus-test branch from 683b368 to 723f69a Compare March 17, 2022 11:10
@newhoggy newhoggy requested a review from Jimbo4350 March 17, 2022 11:11
@@ -157,3 +158,7 @@ test-suite plutus-example-test
Test.PlutusExample.ScriptData

ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T

build-tool-depends: cardano-node:cardano-node
, cardano-cli:cardano-cli
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is required because cardano-node and cardano-cli need to be available for the tests to invoke.

[ testProperty "prop_TxId_Api_Ledger_Plutus_Roundtrip" Test.PlutusExample.Plutus.prop_TxId_Api_Ledger_Plutus_Roundtrip
, testProperty "prop_TxId_Api_Ledger_Roundtrip" Test.PlutusExample.Plutus.prop_TxId_Api_Ledger_Roundtrip
[ -- Fails to meet deadline on MacOS for an unknown reason
testProperty "Plutus.Direct.CertifyingAndWithdrawingPlutus" Test.PlutusExample.Direct.CertifyingAndWithdrawingPlutus.hprop_plutus_certifying_withdrawing
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the test being enabled.

@newhoggy newhoggy changed the title Enable build of CertifyingAndWithdrawingPlutus test WIP Enable build of CertifyingAndWithdrawingPlutus test Mar 17, 2022
@newhoggy newhoggy added the WIP The issue is currently being worked on label Mar 17, 2022
@catch-21
Copy link
Contributor

catch-21 commented Mar 22, 2022

It would be good to keep all compiled plutus scripts (and script data I guess) in plutus-example/example-scripts, ideally with corresponding plutus code in plutus-example/src.

@newhoggy newhoggy force-pushed the newhoggy/enable-CertifyingAndWithdrawingPlutus-test branch 7 times, most recently from 243d249 to f0af84b Compare March 29, 2022 09:50
@newhoggy newhoggy marked this pull request as ready for review March 29, 2022 11:24
@newhoggy newhoggy force-pushed the newhoggy/enable-CertifyingAndWithdrawingPlutus-test branch from 5e2becb to dfbd396 Compare March 29, 2022 11:34
@newhoggy newhoggy requested a review from Jimbo4350 March 29, 2022 12:41
@newhoggy newhoggy removed the WIP The issue is currently being worked on label Mar 29, 2022
@newhoggy newhoggy force-pushed the newhoggy/enable-CertifyingAndWithdrawingPlutus-test branch from c775159 to 9f75b3b Compare March 29, 2022 12:44
@newhoggy newhoggy force-pushed the newhoggy/enable-CertifyingAndWithdrawingPlutus-test branch from 9f75b3b to 5e8fd82 Compare March 29, 2022 12:44
@newhoggy newhoggy changed the title WIP Enable build of CertifyingAndWithdrawingPlutus test Enable build of CertifyingAndWithdrawingPlutus test Mar 29, 2022
@newhoggy newhoggy force-pushed the newhoggy/enable-CertifyingAndWithdrawingPlutus-test branch from 1db03d1 to f6defac Compare March 29, 2022 12:51
Copy link
Collaborator

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

LGTM! Just one comment about redeemers, datums and the configuration file.

@@ -29,8 +29,11 @@ jobs:
- uses: actions/checkout@v3
- uses: nixbuild/nix-quick-install-action@v12
- run: |
echo "=== 1 ==="
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does the 1 symbolize?

Copy link
Collaborator Author

@newhoggy newhoggy Mar 30, 2022

Choose a reason for hiding this comment

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

Left over debugging. Not sure why it still shows up here, but it's not in the diff.

@@ -0,0 +1,287 @@
##########################################################
############### Mainnet #########
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to move this file into the plutus-example folder? Likewise for any datums and redeemers the library uses.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The path is specified in cardano-testnet from the cardano-node repo. Will have to change that to make it configurable.

@newhoggy newhoggy requested a review from koslambrou March 30, 2022 05:43
@koslambrou
Copy link
Contributor

Does this PR subsume #378?

@newhoggy newhoggy merged commit b86ee21 into main Mar 30, 2022
@newhoggy newhoggy deleted the newhoggy/enable-CertifyingAndWithdrawingPlutus-test branch March 30, 2022 10:25
@newhoggy
Copy link
Collaborator Author

newhoggy commented Mar 30, 2022

I have closed #378

iohk-bors bot added a commit to IntersectMBO/cardano-node that referenced this pull request Mar 31, 2022
3727: Make configuration template in cardano-testnet configurable r=newhoggy a=newhoggy

The change is for this: IntersectMBO/plutus-apps#364 (comment)

Co-authored-by: John Ky <john.ky@iohk.io>
{ };
cardano-wallet = (import sources.flake-compat {
inherit pkgs;
src = builtins.fetchTree
Copy link
Contributor

Choose a reason for hiding this comment

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

This broke everything for people not using the flakes experimental feature.

newhoggy added a commit to IntersectMBO/cardano-cli that referenced this pull request May 24, 2023
3727: Make configuration template in cardano-testnet configurable r=newhoggy a=newhoggy

The change is for this: IntersectMBO/plutus-apps#364 (comment)

Co-authored-by: John Ky <john.ky@iohk.io>
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.

6 participants