store timing config in the proposal datum

.... and mock the value upon creation for now
This commit is contained in:
fanghr 2022-05-18 20:34:56 +08:00
parent 7da72e9398
commit d44fe083da
8 changed files with 68 additions and 2 deletions

View file

@ -126,6 +126,7 @@ import Plutarch.TryFrom (ptryFrom)
--------------------------------------------------------------------------------
import Agora.Proposal.Time (ProposalTimingConfig (..))
import Plutus.V1.Ledger.Api (
CurrencySymbol (..),
MintingPolicy,
@ -576,6 +577,8 @@ governorValidator gov =
.& #cosigners .= proposalInputDatumF.cosigners
.& #thresholds .= proposalInputDatumF.thresholds
.& #votes .= proposalInputDatumF.votes
-- FIXME: copy from the governor datum
.& #timingConfig .= pdata (pconstant tmpTimingConfig)
)
tcassert "Unexpected output proposal datum" $
@ -727,6 +730,16 @@ governorValidator gov =
let sym = governorSTSymbolFromGovernor gov
in phoistAcyclic $ pconstant sym
-- TODO: remove this. This is temperary.
tmpTimingConfig :: ProposalTimingConfig
tmpTimingConfig =
ProposalTimingConfig
{ draftTime = 0
, votingTime = 1000
, lockingTime = 2000
, executingTime = 3000
}
--------------------------------------------------------------------------------
-- | Get the 'CurrencySymbol' of GST.