Plutus Pioneer Program - Iteration #2 - Lecture #8

Lars Brünjes · 2K views · 2021 · 2:13:09

Open on YouTube

Testing, debugging & developer toolsFunctional programmingSoftware (other)lecturedated

Why Cardano Stack Exchange recommends it

Cardano Stack Exchange users link it as the reference lecture for the Plutus version and testing approach used in the course, both when debugging version-specific problems and when asking about testing on-chain code.

Recommended by 0 people across 0 different months, 2021 to 2022.

What it is

Lecture 8 of the second Plutus Pioneer Program iteration, taught by Lars Br\u00fcnjes. It covers a token sale state machine example, automatic testing with emulator traces, a short interlude on optics, and property-based testing with QuickCheck applied to Plutus contracts, ending with homework.

What people said

Cites abdelkrimdev · 2021-08 · Cardano Stack Exchange · on “The PAB is no longer working after upgrading the Plutus version”

I upgraded the Plutus version used by my project to: 2f11c28bd8f6d630daab582255e16d8408075bd7 PS: It is the same version Lars used in his latest lecture ( Iteration #2 - Lecture #8 [this video] ) Here is the code I'm using to define the endpoints: data StarterContracts = MarketContract deriving (Eq, Ord, Show, Generic, FromJSON, ToJSON) instance Pretty StarterContracts where pretty = viaShow handleStarterContract :: ( Member (Error PABError) effs , Member (LogMsg (PABMultiAgentMsg (Builtin StarterContracts))) effs ) => ContractEffect (Builtin StarterContracts) ~> Eff effs handleStarterContract = handleBuiltin getSchema getContract where getSchema = \case MarketContract -> endpointsToSchemas @Mark

Cites zarej · 2021-11 · Cardano Stack Exchange · on “I'm getting errors in Week05 Solution.hs”

It is because endpoint has changed according to: [this video] You need to use an older version of Plutus Playground which comes together with plutus commit which was in lecture 5. You will need to start it locally. So in general you will need to do checkout [LINK] at the same commit which is [LINK] but this commit is not present anymore so you can use this instead a5e7a257706c7f5fdab17dbd16683c2390c3ab95 and to start plutus-playground server and client like it is described in Readme for Week1 [LINK] or you can try to change endpoints = mint' >> endpoints where mint' = endpoint @"mint" >>= mint to: endpoints = forever $ handleError logError $ awaitPromise $ endpoint @"mint" $ mint

Cites waalge · 2022-01 · Cardano Stack Exchange · on “Examples of testing on-chain code”

There are extensive examples for the testing frameworks for contracts, ie off-chain code, for example as discussed in Lecture 8 of the plutus pioneer program [this video] . Its mentioned there that one thing not covered is the testing of validators directly, ie on-chain code. Are there examples of this available?