Merge pull request #97 from Liqwid-Labs/connor/bridge-update

Update purescript bridge
This commit is contained in:
方泓睿 2022-05-26 16:02:23 +08:00 committed by GitHub
commit 4c3f48bae0
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.AuthorityToken qualified as AuthorityToken
import Agora.Effect.GovernorMutation qualified as GovernorMutation
import Agora.Effect.TreasuryWithdrawal qualified as TreasuryWithdrawalEffect import Agora.Effect.TreasuryWithdrawal qualified as TreasuryWithdrawalEffect
import Agora.Governor qualified as Governor import Agora.Governor qualified as Governor
import Agora.MultiSig qualified as MultiSig import Agora.MultiSig qualified as MultiSig
@ -48,4 +49,5 @@ agoraTypes =
mkSumType @AuthorityToken.AuthorityToken mkSumType @AuthorityToken.AuthorityToken
, -- Effects , -- Effects
mkSumType @TreasuryWithdrawalEffect.TreasuryWithdrawalDatum 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 Prelude
import Agora.Proposal (ProposalId, ProposalThresholds) import Agora.Proposal (ProposalId, ProposalThresholds)
import Agora.Proposal.Time (MaxTimeRangeWidth, ProposalTimingConfig)
import Agora.SafeMoney (GTTag) import Agora.SafeMoney (GTTag)
import Data.Bounded.Generic (genericBottom, genericTop) import Data.Bounded.Generic (genericBottom, genericTop)
import Data.Enum (class Enum) import Data.Enum (class Enum)
@ -23,6 +24,8 @@ import Type.Proxy (Proxy(Proxy))
newtype GovernorDatum = GovernorDatum newtype GovernorDatum = GovernorDatum
{ proposalThresholds :: ProposalThresholds { proposalThresholds :: ProposalThresholds
, nextProposalId :: ProposalId , nextProposalId :: ProposalId
, proposalTimings :: ProposalTimingConfig
, createProposalTimeRangeMaxWidth :: MaxTimeRangeWidth
} }
derive instance Generic GovernorDatum _ 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 _GovernorDatum = _Newtype
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View file

@ -3,6 +3,7 @@ module Agora.Proposal where
import Prelude import Prelude
import Agora.Proposal.Time (ProposalStartingTime, ProposalTimingConfig)
import Agora.SafeMoney (GTTag) import Agora.SafeMoney (GTTag)
import Data.Bounded.Generic (genericBottom, genericTop) import Data.Bounded.Generic (genericBottom, genericTop)
import Data.Enum (class Enum) import Data.Enum (class Enum)
@ -124,6 +125,8 @@ newtype ProposalDatum = ProposalDatum
, cosigners :: Array PubKeyHash , cosigners :: Array PubKeyHash
, thresholds :: ProposalThresholds , thresholds :: ProposalThresholds
, votes :: ProposalVotes , votes :: ProposalVotes
, timingConfig :: ProposalTimingConfig
, startingTime :: ProposalStartingTime
} }
derive instance Generic ProposalDatum _ 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 _ProposalDatum = _Newtype
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------