Skip to content

Commit

Permalink
Have default "wallet i" name for known wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
florentc committed Mar 22, 2024
1 parent 9e7d97d commit 60fb9f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ pcOpts =
{ C.pcOptHashes =
def
{ C.pcOptHashNames =
defaultHashNames
<> C.hashNamesFromList
C.hashNamesFromList
[ (alice, "Alice"),
(bob, "Bob"),
(carrie, "Carie")
Expand All @@ -67,6 +66,7 @@ pcOpts =
<> C.hashNamesFromList
[ (fooValidator, "Foo")
]
<> C.defaultHashNames -- IMPORTANT: must be the last element
}
}
```
Expand Down
3 changes: 3 additions & 0 deletions src/Cooked/Pretty/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ where

import Cooked.Currencies (permanentCurrencySymbol, quickCurrencySymbol)
import Cooked.Pretty.Hashable
import Cooked.Wallet (wallet)
import Data.Bifunctor (first)
import Data.Default
import Data.Map (Map)
Expand Down Expand Up @@ -99,6 +100,8 @@ defaultHashNames =
(quickCurrencySymbol, "Quick"),
(permanentCurrencySymbol, "Permanent")
]
<> hashNamesFromList
((\i -> (wallet i, "wallet " <> show i)) <$> [1 .. 10])

-- | Smart constructor for maps to be used in the "pcOptHashNames"
-- pretty-printing option.
Expand Down

0 comments on commit 60fb9f3

Please sign in to comment.