update purescript bridge

This commit is contained in:
fanghr 2022-05-25 17:57:25 +08:00
parent ff4eb9cf27
commit c319169bea
No known key found for this signature in database
GPG key ID: 35CD9A71CD5D5870
4 changed files with 38 additions and 2 deletions

View file

@ -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
]

View file

@ -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

View file

@ -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
--------------------------------------------------------------------------------

View file

@ -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
--------------------------------------------------------------------------------