apply docs suggestions

This commit is contained in:
Emily Martins 2022-03-28 18:01:27 +02:00
parent 7a3e62a401
commit bd4fe1e000
4 changed files with 17 additions and 12 deletions

View file

@ -96,6 +96,7 @@ common deps
, generics-sop , generics-sop
, plutarch , plutarch
, plutarch-extra , plutarch-extra
, plutarch-numeric
, plutus-core , plutus-core
, plutus-ledger-api , plutus-ledger-api
, plutus-tx , plutus-tx

View file

@ -5,7 +5,7 @@ Description: Governor entity scripts acting as authority of entire system.
Governor entity scripts acting as authority of entire system. Governor entity scripts acting as authority of entire system.
-} -}
module Agora.Governor (GovernorDatum (..), GovernorRedeemer (..)) where module Agora.Governor (GovernorDatum (..), GovernorRedeemer (..), Governor (..)) where
import Agora.Proposal (ProposalThresholds) import Agora.Proposal (ProposalThresholds)
@ -15,11 +15,11 @@ newtype GovernorDatum = GovernorDatum
-- ^ Gets copied over upon creation of a 'Agora.Proposal.ProposalDatum'. -- ^ Gets copied over upon creation of a 'Agora.Proposal.ProposalDatum'.
} }
{- | Redeemer for Governor script. {- | Redeemer for Governor script. The governor has two primary
responsibilities:
The governor has two primary responsibilities: 1. The gating of Proposal creation.
- The gating of Proposal creation 2. The gating of minting authority tokens.
- The gating of minting authority tokens
-} -}
data GovernorRedeemer data GovernorRedeemer
= -- | Checks that a proposal was created lawfully, and allows it. = -- | Checks that a proposal was created lawfully, and allows it.
@ -27,3 +27,7 @@ data GovernorRedeemer
| -- | Checks that a SINGLE proposal finished correctly, | -- | Checks that a SINGLE proposal finished correctly,
-- and allows minting GATs for each effect script. -- and allows minting GATs for each effect script.
MintGATs MintGATs
-- | Parameters for creating Governor scripts.
data Governor
= Governor

View file

@ -88,12 +88,12 @@ data ProposalStatus
PlutusTx.makeIsDataIndexed ''ProposalStatus [('Draft, 0), ('VotingReady, 1), ('Finished, 2)] PlutusTx.makeIsDataIndexed ''ProposalStatus [('Draft, 0), ('VotingReady, 1), ('Finished, 2)]
{- | The threshold values for various state transitions to happen. {- | The threshold values for various state transitions to happen.
This data is stored centrally (in the Governor) and copied over This data is stored centrally (in the 'Agora.Governor.Governor') and copied over
to Proposals when they are created. to 'Proposal's when they are created.
-} -}
data ProposalThresholds = ProposalThresholds data ProposalThresholds = ProposalThresholds
{ execute :: Discrete GTTag { execute :: Discrete GTTag
-- ^ How much GT minimum must a particular 'ResultTag' accumulate to fulfil. -- ^ How much GT minimum must a particular 'ResultTag' accumulate for it to pass.
, draft :: Discrete GTTag , draft :: Discrete GTTag
-- ^ How much GT required to "create" a proposal. -- ^ How much GT required to "create" a proposal.
, vote :: Discrete GTTag , vote :: Discrete GTTag
@ -110,7 +110,7 @@ PlutusTx.makeIsDataIndexed ''ProposalThresholds [('ProposalThresholds, 0)]
@[('ResultTag' 0, []), ('ResultTag' 1, [(vh, dh)])]@ @[('ResultTag' 0, []), ('ResultTag' 1, [(vh, dh)])]@
Then 'ProposalVotes' need be of the shape: Then 'ProposalVotes' needs be of the shape:
@[('ResultTag' 0, n), ('ResultTag' 1, m)]@ @[('ResultTag' 0, n), ('ResultTag' 1, m)]@
-} -}
@ -125,11 +125,11 @@ data ProposalDatum = ProposalDatum
-- This is shaped this way for future proofing. -- This is shaped this way for future proofing.
-- See https://github.com/Liqwid-Labs/agora/issues/39 -- See https://github.com/Liqwid-Labs/agora/issues/39
effects :: [(ResultTag, [(ValidatorHash, DatumHash)])] effects :: [(ResultTag, [(ValidatorHash, DatumHash)])]
-- ^ Effect lookup table. First by result, then by -- ^ Effect lookup table. First by result, then by effect hash.
, status :: ProposalStatus , status :: ProposalStatus
-- ^ The status the proposal is in. -- ^ The status the proposal is in.
, cosigners :: [PubKeyHash] , cosigners :: [PubKeyHash]
-- ^ Who created the proposal initially + who cosigned. -- ^ Who created the proposal initially, and who cosigned it later.
, thresholds :: ProposalThresholds , thresholds :: ProposalThresholds
-- ^ Thresholds copied over on initialization. -- ^ Thresholds copied over on initialization.
, votes :: ProposalVotes , votes :: ProposalVotes

View file

@ -83,7 +83,7 @@ import Agora.Utils (
-- | Parameters for creating Stake scripts. -- | Parameters for creating Stake scripts.
newtype Stake = Stake newtype Stake = Stake
{ gtClassRef :: AssetClassRef GTTag { gtClassRef :: AssetClassRef GTTag
-- ^ Resolve governance token -- ^ Used when inlining the AssetClass of a 'PDiscrete' in the script code.
} }
-- | Plutarch-level redeemer for Stake scripts. -- | Plutarch-level redeemer for Stake scripts.