Skip to content

Commit 18185ba

Browse files
committed
Documented the Coop.Plutus.exampleConsumer function
1 parent 3434539 commit 18185ba

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

coop-plutus/src/Coop/Plutus.hs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,20 @@ pmustSpendAtLeastAa = phoistAcyclic $
591591
(ptrace "pmustSpendAtLeastAa: Spent at least the specified amount of AA tokens" $ pblake2b_256 # tnBytes)
592592
(ptraceError "pmustSpendAtLeastAa: Must spend at least the specified amount of AA tokens")
593593

594+
{- | Example Consumer validator that authenticates and processes a referenced
595+
FactStatement UTxO
596+
597+
- check that the reference input holds the appropriate $FS token (with the
598+
trusted COOP Oracle's CurrencySymbol),
599+
- parse the Fact Statement embedded in the UTxO datum and perform assertions.
600+
601+
To demonstrate the COOP provided Plutus JSON encoding a file was created with the COOP
602+
provided `plutus-json-cli` tool:
603+
604+
$ plutus-json-cli from-json -i resources/sample.json -o resources/sample.pd.cbor
605+
606+
This served as an exemplary Fact Statement.
607+
-}
594608
exampleConsumer :: ClosedTerm (PCurrencySymbol :--> PValidator)
595609
exampleConsumer = phoistAcyclic $
596610
plam $ \trustedCs _ _ ctx -> ptrace "exampleConsumer" P.do

0 commit comments

Comments
 (0)