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

Commit

Permalink
Add more delay in CoreSpec to fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Akentev committed Jul 8, 2022
1 parent 3377926 commit afd1104
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plutus-pab-executables/test/full/Plutus/PAB/CoreSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ executionTests =
, currencyTest
, testCase "wait for update" waitForUpdateTest
, testCase "stop contract instance" stopContractInstanceTest
-- TODO: Commented temporarly until PR#565 is merged
-- , testCase "can wait for tx status change" waitForTxStatusChangeTest
-- , testCase "can wait for tx output status change" waitForTxOutStatusChangeTest
, testCase "can wait for tx status change" waitForTxStatusChangeTest
, testCase "can wait for tx output status change" waitForTxOutStatusChangeTest
, testCase "can subscribe to slot updates" slotChangeTest
, testCase "can query wallet funds" valueAtTest
, testCase "can subscribe to observable state changes" observableStateChangeTest
Expand Down Expand Up @@ -188,6 +187,7 @@ waitForTxStatusChangeTest = runScenario $ do
(w1, pk1) <- Simulator.addWallet
Simulator.waitNSlots 1
tx <- Simulator.payToPaymentPublicKeyHash w1 pk1 (lovelaceValueOf 100_000_000)
Simulator.waitNSlots 1
txStatus <- Simulator.waitForTxStatusChange (getCardanoTxId tx)
assertEqual "tx should be tentatively confirmed of depth 1"
(TentativelyConfirmed 1 TxValid ())
Expand All @@ -206,7 +206,7 @@ waitForTxStatusChangeTest = runScenario $ do
let (Depth n) = chainConstant
replicateM_ (n - 1) $ do
void $ Simulator.payToPaymentPublicKeyHash w1 pk1 (Ada.toValue Ledger.minAdaTxOut)
Simulator.waitNSlots 1
Simulator.waitNSlots 2

txStatus'' <- Simulator.waitForTxStatusChange (getCardanoTxId tx)
assertEqual "tx should be committed"
Expand Down Expand Up @@ -247,7 +247,7 @@ waitForTxOutStatusChangeTest = runScenario $ do
-- We create a new transaction to trigger a block creation in order to
-- increment the block number.
tx2 <- Simulator.payToPaymentPublicKeyHash w1 pk1 (Ada.toValue Ledger.minAdaTxOut)
Simulator.waitNSlots 1
Simulator.waitNSlots 2
txOutStatus1' <- Simulator.waitForTxOutStatusChange txOutRef1
assertEqual "tx output 1 should be tentatively confirmed of depth 1"
(TentativelyConfirmed 1 TxValid (Spent $ getCardanoTxId tx2))
Expand All @@ -261,7 +261,7 @@ waitForTxOutStatusChangeTest = runScenario $ do
let (Depth n) = chainConstant
replicateM_ n $ do
void $ Simulator.payToPaymentPublicKeyHash w1 pk1 (Ada.toValue Ledger.minAdaTxOut)
Simulator.waitNSlots 1
Simulator.waitNSlots 2

txOutStatus1'' <- Simulator.waitForTxOutStatusChange txOutRef1
assertEqual "tx output 1 should be committed"
Expand Down

0 comments on commit afd1104

Please sign in to comment.