From c1976b86fcb95236856546d58560387589911601 Mon Sep 17 00:00:00 2001 From: fanghr Date: Thu, 28 Apr 2022 17:20:21 +0800 Subject: [PATCH] fix typos/grammar/docstrings, suggested by @jhodgdev Co-authored-by: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> --- agora/Agora/Governor.hs | 8 ++++---- agora/Agora/Utils.hs | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/agora/Agora/Governor.hs b/agora/Agora/Governor.hs index da057a9..1d4fcf9 100644 --- a/agora/Agora/Governor.hs +++ b/agora/Agora/Governor.hs @@ -2,7 +2,7 @@ {- | Module : Agora.Governor -Maintainer : chfanghr@gmail.com +Maintainer : connor@mlabs.city Description: Governor entity scripts acting as authority of entire system. Governor entity scripts acting as authority of entire system. @@ -137,7 +137,7 @@ import PlutusTx qualified -------------------------------------------------------------------------------- {- $gst - Governance state token, aka. GST, is an NFT that identifies an UTXO that carries the state datum of the Governance script. + Governance state token, aka. GST, is an NFT that identifies a UTXO that carries the state datum of the Governance script. This token is minted by a one-shot monetary policy 'governorPolicy', meaning that the token has guaranteed uniqueness. @@ -773,7 +773,7 @@ governorValidator gov = -------------------------------------------------------------------------------- --- | Get the assetclass of GST from governor parameters. +-- | Get the 'AssetClass' of GST from 'Governor'. gstAssetClass :: Governor -> AssetClass gstAssetClass gov = AssetClass (symbol, "") where @@ -783,7 +783,7 @@ gstAssetClass gov = AssetClass (symbol, "") symbol :: CurrencySymbol symbol = mintingPolicySymbol policy --- | Get the currency symbol of GAT from governor parameters. +-- | Get the `CurrencySymbol` of GAT from 'Governor'. gatSymbol :: Governor -> CurrencySymbol gatSymbol gov = mintingPolicySymbol policy where diff --git a/agora/Agora/Utils.hs b/agora/Agora/Utils.hs index 83fbdb2..3ea3fb4 100644 --- a/agora/Agora/Utils.hs +++ b/agora/Agora/Utils.hs @@ -380,13 +380,15 @@ pisDJust = phoistAcyclic $ ) -- | The 'CurrencySymbol' of the current minting policy. +-- FIXME: Yeet/reimplement this function, since passing the whole script context is highly inefficient. pownCurrencySymbol :: Term s (PScriptContext :--> PCurrencySymbol) pownCurrencySymbol = phoistAcyclic $ plam $ \ctx -> P.do PMinting m <- pmatch $ pfield @"purpose" # ctx pfield @"_0" # m --- | Determines if a given utxo is spent. +-- | Determines if a given UTXO is spent. +-- TODO: no need to pass the whole TxInfo here. pisUxtoSpent :: Term s (PTxOutRef :--> PTxInfo :--> PBool) pisUxtoSpent = phoistAcyclic $ plam $ \oref info -> P.do @@ -529,7 +531,7 @@ hasOnlyOneTokenOfAssetClass' :: AssetClass -> Term s (PValue :--> PBool) hasOnlyOneTokenOfAssetClass' ac = phoistAcyclic $ plam $ \vs -> passetClassValueOf' ac # vs #== 1 --- | The entire value only contains one token of the specific currency symbol. +-- | The entire value only contains one token of the given currency symbol. hasOnlyOneTokenOfCurrencySymbol :: Term s (PCurrencySymbol :--> PValue :--> PBool) hasOnlyOneTokenOfCurrencySymbol = phoistAcyclic $ plam $ \cs vs -> P.do