Began applying Emily's suggestions
This commit is contained in:
parent
507a4b2247
commit
d143ec87b5
3 changed files with 6 additions and 12 deletions
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
SHELL := /usr/bin/env bash
|
||||
|
||||
.PHONY: hoogle format usage
|
||||
.PHONY: hoogle format haddock usage
|
||||
|
||||
usage:
|
||||
@echo "usage: make <command> [OPTIONS]"
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ common lang
|
|||
TypeOperators
|
||||
TypeSynonymInstances
|
||||
UndecidableInstances
|
||||
UndecidableInstances
|
||||
ViewPatterns
|
||||
OverloadedRecordDot
|
||||
QualifiedDo
|
||||
|
|
|
|||
|
|
@ -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
|
||||
]
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue