Skip to content

Commit

Permalink
Test currentChainIndexSlot
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoerdvisscher committed Nov 21, 2022
1 parent f2fe33d commit 2ae43b9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions plutus-contract/test/Spec/Contract.hs
Expand Up @@ -381,6 +381,22 @@ tests =
in run "mustSatisfyAnyOf [mempty] works"
( assertDone c tag (const True) "should be done"
) (void $ activateContract w1 c tag)

, let c :: Contract [Ledger.Slot] Schema ContractError () = do
void $ submitTx mempty
void $ awaitSlot 10
slotCI <- currentChainIndexSlot
tell [slotCI]
slotNC <- currentNodeClientSlot
tell [slotNC]
expectedState [slotCI, slotNC] = slotCI == slotNC
expectedState _ = False

in run "currentChainIndexSlot"
( assertAccumState c tag expectedState "slots should be equal"
) $ do
_ <- activateContract w1 c tag
void (Trace.waitNSlots 10)
]

checkpointContract :: Contract () Schema ContractError ()
Expand Down

0 comments on commit 2ae43b9

Please sign in to comment.