stub out Proposal, Governor. kill hoogle before starting a new one.
This commit is contained in:
parent
5aa1a1e93d
commit
87ff8ba343
5 changed files with 73 additions and 4 deletions
1
Makefile
1
Makefile
|
|
@ -12,6 +12,7 @@ usage:
|
|||
@echo " haddock -- Generate Haddock docs for project"
|
||||
|
||||
hoogle:
|
||||
pkill hoogle
|
||||
hoogle generate --local=haddock --database=hoo/local.hoo
|
||||
hoogle server --local -p 8081 >> /dev/null &
|
||||
hoogle server --local --database=hoo/local.hoo -p 8082 >> /dev/null &
|
||||
|
|
|
|||
|
|
@ -124,7 +124,8 @@ library
|
|||
Agora.SafeMoney.QQ
|
||||
Agora.Stake
|
||||
Agora.Treasury
|
||||
Agora.Voting
|
||||
Agora.Governor
|
||||
Agora.Proposal
|
||||
|
||||
other-modules:
|
||||
Agora.Utils
|
||||
|
|
|
|||
8
agora/Agora/Governor.hs
Normal file
8
agora/Agora/Governor.hs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{- |
|
||||
Module : Agora.Governor
|
||||
Maintainer : emi@haskell.fyi
|
||||
Description: Governor entity scripts acting as authority of entire system.
|
||||
|
||||
Governor entity scripts acting as authority of entire system.
|
||||
-}
|
||||
module Agora.Governor () where
|
||||
62
agora/Agora/Proposal.hs
Normal file
62
agora/Agora/Proposal.hs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{- |
|
||||
Module : Agora.Proposal
|
||||
Maintainer : emi@haskell.fyi
|
||||
Description: Proposal scripts encoding effects that operate on the system.
|
||||
|
||||
Proposal scripts encoding effects that operate on the system.
|
||||
-}
|
||||
module Agora.Proposal (
|
||||
ProposalDatum (..),
|
||||
ProposalStatus (..),
|
||||
ResultTag (..),
|
||||
) where
|
||||
|
||||
import Plutus.V1.Ledger.Api (DatumHash, PubKeyHash, ValidatorHash)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
{- | Encodes a result. Typically, for a Yes/No proposal, we encode it like this:
|
||||
|
||||
"No" ~ EffectTag 0
|
||||
"Yes" ~ EffectTag 1
|
||||
-}
|
||||
newtype ResultTag = ResultTag {getResultTag :: Integer}
|
||||
|
||||
{- | The 'status' of the proposal. This is only useful for __actual__
|
||||
state transitions, as opposed to time-based 'phases'.
|
||||
|
||||
If the proposal is 'VotingReady', for instance, that doesn't necessarily
|
||||
mean that voting is possible, as this also requires the timing to be right.
|
||||
-}
|
||||
data ProposalStatus
|
||||
= -- | A draft proposal represents a proposal that has yet to be realized.
|
||||
-- In effect, this means one which didn't have enough LQ to be a full
|
||||
-- proposal, and needs cosigners to enable that to happen. This is
|
||||
-- similar to a "temperature check", but only useful if multiple people
|
||||
-- want to pool governance tokens together. If the proposal doesn't get to
|
||||
-- 'VotingReady' on time, the proposal will **never** be able to get
|
||||
-- voted on.
|
||||
Draft
|
||||
| -- | The proposal has/had enough GT cosigned in order to be a fully fledged
|
||||
-- proposal. This means that once the timing requirements align,
|
||||
-- proposal will be able to be voted on.
|
||||
VotingReady
|
||||
| -- | The proposal has finished for whatever reason. This can mean it's been
|
||||
-- voted on and completed, but it can also mean the proposal failed due to
|
||||
-- time constraints or didn't get to 'VotingReady' first.
|
||||
--
|
||||
-- TODO: The owner of the proposal may choose to reclaim their proposal.
|
||||
Finished
|
||||
|
||||
data ProposalDatum = ProposalDatum
|
||||
{ -- TODO: could we encode this more efficiently?
|
||||
-- This is shaped this way for future proofing.
|
||||
-- See https://github.com/Liqwid-Labs/agora/issues/39
|
||||
effects :: [(ResultTag, [(ValidatorHash, DatumHash)])]
|
||||
-- ^ Effect lookup table. First by result, then by
|
||||
, status :: ProposalStatus
|
||||
-- ^ The status the proposal is in.
|
||||
, proposers :: [PubKeyHash]
|
||||
-- ^ Who created the proposal initially.
|
||||
-- We may want to remove this.
|
||||
}
|
||||
|
|
@ -6,6 +6,3 @@ Description: Types for votes and vote counting
|
|||
module Agora.Voting (
|
||||
Vote (..),
|
||||
) where
|
||||
|
||||
-- | Type representing direction of vote.
|
||||
data Vote = InFavorOf | OpposedTo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue