From b88905dca661a07d420b51615cd3bcdaf1260c6c Mon Sep 17 00:00:00 2001 From: Peter Dragos Date: Thu, 12 Oct 2023 12:01:49 +0300 Subject: [PATCH 1/2] fix ex-units violation in contract-models tutorial --- doc/plutus/tutorials/contract-models.rst | 4 +++- plutus-use-cases/test/Spec/Tutorial/Escrow1.hs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/plutus/tutorials/contract-models.rst b/doc/plutus/tutorials/contract-models.rst index bce72a7337..73a5b747e0 100644 --- a/doc/plutus/tutorials/contract-models.rst +++ b/doc/plutus/tutorials/contract-models.rst @@ -325,7 +325,9 @@ Running tests and debugging the model We are finally ready to run some tests! We do still need to define a *property* that we can call QuickCheck with, but the :hsobj:`Plutus.Contract.Test.ContractModel.Interface.ContractModel` -framework provides a standard one that we can just reuse. So we define +framework provides a standard one that we can just reuse. To run the +test successfully, we must increase the budget of the emulator, so +we define .. literalinclude:: Escrow.hs :start-after: START prop_Escrow diff --git a/plutus-use-cases/test/Spec/Tutorial/Escrow1.hs b/plutus-use-cases/test/Spec/Tutorial/Escrow1.hs index c024d85498..9425c5bbf7 100644 --- a/plutus-use-cases/test/Spec/Tutorial/Escrow1.hs +++ b/plutus-use-cases/test/Spec/Tutorial/Escrow1.hs @@ -106,7 +106,9 @@ testWallets :: [Wallet] testWallets = [w1, w2, w3, w4, w5] prop_Escrow :: Actions EscrowModel -> Property -prop_Escrow = propRunActions_ +prop_Escrow = propRunActionsWithOptions options defaultCoverageOptions (\ _ -> pure True) + where + options = defaultCheckOptionsContractModel & increaseTransactionLimits escrowParams :: EscrowParams d escrowParams = From 7128bbb15e4d0604f2df446064914aa900e18e03 Mon Sep 17 00:00:00 2001 From: Peter Dragos Date: Fri, 13 Oct 2023 13:23:06 +0300 Subject: [PATCH 2/2] fix exunits error in Escrow2 --- plutus-use-cases/test/Spec/Tutorial/Escrow2.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plutus-use-cases/test/Spec/Tutorial/Escrow2.hs b/plutus-use-cases/test/Spec/Tutorial/Escrow2.hs index cd9cfca106..eda67a812a 100644 --- a/plutus-use-cases/test/Spec/Tutorial/Escrow2.hs +++ b/plutus-use-cases/test/Spec/Tutorial/Escrow2.hs @@ -138,8 +138,9 @@ testContract params = selectList [ void $ payEp params prop_Escrow :: Actions EscrowModel -> Property -prop_Escrow = propRunActions_ - +prop_Escrow = propRunActionsWithOptions options defaultCoverageOptions (\ _ -> pure True) + where + options = defaultCheckOptionsContractModel & increaseTransactionLimits escrowParams :: [(Wallet, Integer)] -> EscrowParams d escrowParams tgts =