WIP simple sample test for Stake policy
This commit is contained in:
parent
9aa5f5b1a3
commit
a2ea0a46f5
9 changed files with 256 additions and 137 deletions
|
|
@ -9,6 +9,7 @@ module Agora.SafeMoney (
|
|||
-- * Types
|
||||
MoneyClass,
|
||||
PDiscrete,
|
||||
Discrete,
|
||||
|
||||
-- * Utility functions
|
||||
paddDiscrete,
|
||||
|
|
@ -60,6 +61,10 @@ newtype PDiscrete (mc :: MoneyClass) (s :: S)
|
|||
= PDiscrete (Term s PInteger)
|
||||
deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype (PDiscrete mc) PInteger)
|
||||
|
||||
newtype Discrete (mc :: MoneyClass)
|
||||
= Discrete Integer
|
||||
deriving stock (Show)
|
||||
|
||||
-- | Add two `PDiscrete` values of the same `MoneyClass`.
|
||||
paddDiscrete :: Term s (PDiscrete mc :--> PDiscrete mc :--> PDiscrete mc)
|
||||
paddDiscrete = phoistAcyclic $
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue