Began applying Emily's suggestions

This commit is contained in:
Jack Hodgkinson 2022-03-02 16:46:09 +00:00
parent 507a4b2247
commit d143ec87b5
3 changed files with 6 additions and 12 deletions

View file

@ -1,6 +1,6 @@
SHELL := /usr/bin/env bash
.PHONY: hoogle format usage
.PHONY: hoogle format haddock usage
usage:
@echo "usage: make <command> [OPTIONS]"

View file

@ -76,7 +76,6 @@ common lang
TypeOperators
TypeSynonymInstances
UndecidableInstances
UndecidableInstances
ViewPatterns
OverloadedRecordDot
QualifiedDo

View file

@ -1,5 +1,3 @@
{-# OPTIONS_GHC -Wwarn #-}
{- |
Module: Agora.Treasury
Maintainer: jack@mlabs.city
@ -8,7 +6,7 @@ Description: Treasury scripts.
Contains the datum, redeemer and validator for a template DAO
treasury.
-}
module Agora.Treasury where
module Agora.Treasury (treasuryV) where
import GHC.Generics qualified as GHC
import Generics.SOP
@ -20,8 +18,8 @@ import Plutarch.Api.V1.Contexts (
import Plutarch.Api.V1.Maybe (PMaybeData (PDJust))
import Plutarch.Api.V1.Scripts (PDatum, PDatumHash)
import Plutarch.Api.V1.Tx (
PTxInInfo (PTxInInfo),
PTxOut (PTxOut),
PTxInInfo,
PTxOut,
)
import Plutarch.Api.V1.Value (PCurrencySymbol, PValue)
import Plutarch.Builtin (pforgetData)
@ -107,7 +105,7 @@ getTrDatumHash = plam $ \d l -> P.do
)
matchDatums = plam $ \d t' ->
let t = pfield @"_1" # t'
in (pforgetData d) #== (pforgetData t)
in pforgetData d #== pforgetData t
-- | Get the "resolved" field of a TxInInfo.
toResolved :: Term s (PAsData PTxInInfo :--> PAsData PTxOut)
@ -133,8 +131,6 @@ getValAtDHash = plam $ \dh outs -> P.do
{- | Plutarch level type representing datum of the treasury.
Contains:
- @reserves@ representing the current value kept in the
treasury.
- @stateThread@ representing the asset class of the
treasury's state thread token.
-}
@ -143,8 +139,7 @@ newtype PTreasuryDatum (s :: S)
( Term
s
( PDataRecord
'[ "reserves" ':= PValue
, "stateThread" ':= PCurrencySymbol
'[ "stateThread" ':= PCurrencySymbol
]
)
)