module Lorentz.TestScenario
{-# DEPRECATED "Use morley-nettest instead" #-}
( TestScenario
, showTestScenario
) where
import Fmt (Buildable, Builder, fmt, (+|), (|+))
import Lorentz.Constraints (KnownValue, NicePrintedValue, NoOperation)
import Lorentz.Print (printLorentzValue)
import Michelson.Typed.Haskell.Value (IsoValue)
import Tezos.Address (Address)
type TestScenario param = [(Address, param)]
showTestScenario
:: (Buildable param, NicePrintedValue param)
=> TestScenario param -> Text
showTestScenario = fmt . foldMap formatParam
where
formatParam
:: (Buildable param, KnownValue param, NoOperation param)
=> (Address, param) -> Builder
formatParam (addr, param) =
"# " +| param |+ "\n" +|
addr |+ "\n" +|
printLorentzValue True param |+ "\n"
data Parameter
= Param1 Integer Bool
| Param2
| Param3 Natural Natural
deriving stock Generic
deriving anyclass IsoValue
_mkTestScenarioExample :: Address -> TestScenario Parameter
_mkTestScenarioExample owner =
[ (owner, Param1 5 False)
, (owner, Param2)
, (owner, Param3 2 2)
]