diff --git a/agora-purescript-bridge/AgoraTypes.hs b/agora-purescript-bridge/AgoraTypes.hs index e56d4d8..d59923b 100644 --- a/agora-purescript-bridge/AgoraTypes.hs +++ b/agora-purescript-bridge/AgoraTypes.hs @@ -11,6 +11,7 @@ import Language.PureScript.Bridge ( -------------------------------------------------------------------------------- import Agora.AuthorityToken qualified as AuthorityToken +import Agora.Effect.GovernorMutation qualified as GovernorMutation import Agora.Effect.TreasuryWithdrawal qualified as TreasuryWithdrawalEffect import Agora.Governor qualified as Governor import Agora.MultiSig qualified as MultiSig @@ -48,4 +49,5 @@ agoraTypes = mkSumType @AuthorityToken.AuthorityToken , -- Effects mkSumType @TreasuryWithdrawalEffect.TreasuryWithdrawalDatum + , mkSumType @GovernorMutation.MutateGovernorDatum ] diff --git a/agora-purescript-bridge/src/Agora/Effect/GovernorMutation.purs b/agora-purescript-bridge/src/Agora/Effect/GovernorMutation.purs new file mode 100644 index 0000000..c4e4b44 --- /dev/null +++ b/agora-purescript-bridge/src/Agora/Effect/GovernorMutation.purs @@ -0,0 +1,28 @@ +-- File auto generated by purescript-bridge! -- +module Agora.Effect.GovernorMutation where + +import Prelude + +import Agora.Governor (GovernorDatum) +import Data.Generic.Rep (class Generic) +import Data.Lens (Iso', Lens', Prism', iso, prism') +import Data.Lens.Iso.Newtype (_Newtype) +import Data.Lens.Record (prop) +import Data.Maybe (Maybe(..)) +import Data.Newtype (class Newtype) +import Plutus.V1.Ledger.Tx (TxOutRef) +import Type.Proxy (Proxy(Proxy)) + +newtype MutateGovernorDatum = MutateGovernorDatum + { governorRef :: TxOutRef + , newDatum :: GovernorDatum + } + +derive instance Generic MutateGovernorDatum _ + +derive instance Newtype MutateGovernorDatum _ + +-------------------------------------------------------------------------------- + +_MutateGovernorDatum :: Iso' MutateGovernorDatum {governorRef :: TxOutRef, newDatum :: GovernorDatum} +_MutateGovernorDatum = _Newtype diff --git a/agora-purescript-bridge/src/Agora/Governor.purs b/agora-purescript-bridge/src/Agora/Governor.purs index 29172a1..2fe117e 100644 --- a/agora-purescript-bridge/src/Agora/Governor.purs +++ b/agora-purescript-bridge/src/Agora/Governor.purs @@ -4,6 +4,7 @@ module Agora.Governor where import Prelude import Agora.Proposal (ProposalId, ProposalThresholds) +import Agora.Proposal.Time (MaxTimeRangeWidth, ProposalTimingConfig) import Agora.SafeMoney (GTTag) import Data.Bounded.Generic (genericBottom, genericTop) import Data.Enum (class Enum) @@ -23,6 +24,8 @@ import Type.Proxy (Proxy(Proxy)) newtype GovernorDatum = GovernorDatum { proposalThresholds :: ProposalThresholds , nextProposalId :: ProposalId + , proposalTimings :: ProposalTimingConfig + , createProposalTimeRangeMaxWidth :: MaxTimeRangeWidth } derive instance Generic GovernorDatum _ @@ -31,7 +34,7 @@ derive instance Newtype GovernorDatum _ -------------------------------------------------------------------------------- -_GovernorDatum :: Iso' GovernorDatum {proposalThresholds :: ProposalThresholds, nextProposalId :: ProposalId} +_GovernorDatum :: Iso' GovernorDatum {proposalThresholds :: ProposalThresholds, nextProposalId :: ProposalId, proposalTimings :: ProposalTimingConfig, createProposalTimeRangeMaxWidth :: MaxTimeRangeWidth} _GovernorDatum = _Newtype -------------------------------------------------------------------------------- diff --git a/agora-purescript-bridge/src/Agora/Proposal.purs b/agora-purescript-bridge/src/Agora/Proposal.purs index 416545e..2e4d7c6 100644 --- a/agora-purescript-bridge/src/Agora/Proposal.purs +++ b/agora-purescript-bridge/src/Agora/Proposal.purs @@ -3,6 +3,7 @@ module Agora.Proposal where import Prelude +import Agora.Proposal.Time (ProposalStartingTime, ProposalTimingConfig) import Agora.SafeMoney (GTTag) import Data.Bounded.Generic (genericBottom, genericTop) import Data.Enum (class Enum) @@ -124,6 +125,8 @@ newtype ProposalDatum = ProposalDatum , cosigners :: Array PubKeyHash , thresholds :: ProposalThresholds , votes :: ProposalVotes + , timingConfig :: ProposalTimingConfig + , startingTime :: ProposalStartingTime } derive instance Generic ProposalDatum _ @@ -132,7 +135,7 @@ derive instance Newtype ProposalDatum _ -------------------------------------------------------------------------------- -_ProposalDatum :: Iso' ProposalDatum {proposalId :: ProposalId, effects :: Map ResultTag (Map ValidatorHash DatumHash), status :: ProposalStatus, cosigners :: Array PubKeyHash, thresholds :: ProposalThresholds, votes :: ProposalVotes} +_ProposalDatum :: Iso' ProposalDatum {proposalId :: ProposalId, effects :: Map ResultTag (Map ValidatorHash DatumHash), status :: ProposalStatus, cosigners :: Array PubKeyHash, thresholds :: ProposalThresholds, votes :: ProposalVotes, timingConfig :: ProposalTimingConfig, startingTime :: ProposalStartingTime} _ProposalDatum = _Newtype --------------------------------------------------------------------------------