Skip to content

Commit

Permalink
Add example in CHEATSHEET
Browse files Browse the repository at this point in the history
  • Loading branch information
florentc committed Mar 19, 2024
1 parent 9245dc6 commit c606374
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions doc/CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@ initDist = initialDistribution [(i, [lovelaceValueOf 25_000_000]) | i <- knownWa
* In a test `Tasty.testCase "foo" $ testSucceedsFrom def initDist foo`
* In the REPL `printCooked $ interpretAndRunWith (runMockChainTFrom initDist) foo`

### Give human-readable names to pubkey/script/minting hashes

```haskell
pcOpts :: C.PrettyCookedOpts
pcOpts =
def
{ C.pcOptHashes =
def
{ C.pcOptHashNames =
defaultHashNames
<> C.hashNamesFromList
[ (alice, "Alice"),
(bob, "Bob"),
(carrie, "Carie")
]
<> C.hashNamesFromList
[ (nftCurrencySymbol, "NFT"),
(customCoinsCurrencySymbol, "Custom Coins")
]
<> C.hashNamesFromList
[ (fooValidator, "Foo")
]
}
}
```

### Write a trace or endpoint

```haskell
Expand Down

0 comments on commit c606374

Please sign in to comment.