document newly added validation context types
This commit is contained in:
parent
e5dc29f98b
commit
0db0abbe49
2 changed files with 34 additions and 12 deletions
|
|
@ -134,33 +134,49 @@ proposalPolicy (AssetClass (govCs, govTn)) =
|
||||||
|
|
||||||
pure $ popaque (pconstant ())
|
pure $ popaque (pconstant ())
|
||||||
|
|
||||||
|
{- | Validation context for redeemers which witness multiple stake in the reference
|
||||||
|
inputs.
|
||||||
|
|
||||||
|
@since 1.0.0
|
||||||
|
-}
|
||||||
data PWitneseMultipleStakeContext (s :: S) = PWitneseMultipleStakeContext
|
data PWitneseMultipleStakeContext (s :: S) = PWitneseMultipleStakeContext
|
||||||
{ totalAmount :: Term s PInteger
|
{ totalAmount :: Term s PInteger
|
||||||
, orderedOwners :: Term s (PList PCredential)
|
, orderedOwners :: Term s (PList PCredential)
|
||||||
}
|
}
|
||||||
deriving stock (Generic)
|
deriving stock
|
||||||
|
( -- | @since 1.0.0
|
||||||
|
Generic
|
||||||
|
)
|
||||||
deriving anyclass
|
deriving anyclass
|
||||||
( PlutusType
|
( -- | @since 1.0.0
|
||||||
|
PlutusType
|
||||||
)
|
)
|
||||||
|
|
||||||
|
-- | @since 1.0.0
|
||||||
instance DerivePlutusType PWitneseMultipleStakeContext where
|
instance DerivePlutusType PWitneseMultipleStakeContext where
|
||||||
type DPTStrat _ = PlutusTypeScott
|
type DPTStrat _ = PlutusTypeScott
|
||||||
|
|
||||||
|
{- | Validation context for redeemers which need to modify a single stake.
|
||||||
|
|
||||||
|
@since 1.0.0
|
||||||
|
-}
|
||||||
data PSpendSingleStakeContext (s :: S) = PSpendSingleStakeContext
|
data PSpendSingleStakeContext (s :: S) = PSpendSingleStakeContext
|
||||||
{ inputStake :: Term s PStakeDatum
|
{ inputStake :: Term s PStakeDatum
|
||||||
, outputStake :: Term s PStakeDatum
|
, outputStake :: Term s PStakeDatum
|
||||||
}
|
}
|
||||||
deriving stock (Generic)
|
deriving stock
|
||||||
|
( -- | @since 1.0.0
|
||||||
|
Generic
|
||||||
|
)
|
||||||
deriving anyclass
|
deriving anyclass
|
||||||
( PlutusType
|
( -- | @since 1.0.0
|
||||||
|
PlutusType
|
||||||
)
|
)
|
||||||
|
|
||||||
|
-- | @since 1.0.0
|
||||||
instance DerivePlutusType PSpendSingleStakeContext where
|
instance DerivePlutusType PSpendSingleStakeContext where
|
||||||
type DPTStrat _ = PlutusTypeScott
|
type DPTStrat _ = PlutusTypeScott
|
||||||
|
|
||||||
pemptyWitneseMultipleStakeContext :: forall (s :: S). Term s PWitneseMultipleStakeContext
|
|
||||||
pemptyWitneseMultipleStakeContext = pcon $ PWitneseMultipleStakeContext 0 pnil
|
|
||||||
|
|
||||||
{- | The validator for Proposals.
|
{- | The validator for Proposals.
|
||||||
|
|
||||||
The documentation for various of the redeemers lives at 'Agora.Proposal.ProposalRedeemer'.
|
The documentation for various of the redeemers lives at 'Agora.Proposal.ProposalRedeemer'.
|
||||||
|
|
@ -293,8 +309,6 @@ proposalValidator as maximumCosigners =
|
||||||
|
|
||||||
onlyStatusChanged <-
|
onlyStatusChanged <-
|
||||||
pletC $
|
pletC $
|
||||||
-- Only the status of proposals is updated.
|
|
||||||
|
|
||||||
-- Only the status of proposals is updated.
|
-- Only the status of proposals is updated.
|
||||||
proposalOut
|
proposalOut
|
||||||
#== mkRecordConstr
|
#== mkRecordConstr
|
||||||
|
|
@ -376,7 +390,7 @@ proposalValidator as maximumCosigners =
|
||||||
sortOwners
|
sortOwners
|
||||||
#$ pfoldl
|
#$ pfoldl
|
||||||
# f
|
# f
|
||||||
# pemptyWitneseMultipleStakeContext
|
# pcon (PWitneseMultipleStakeContext 0 pnil)
|
||||||
# txInfoF.referenceInputs
|
# txInfoF.referenceInputs
|
||||||
in plam (# ctx)
|
in plam (# ctx)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,11 @@ stakePolicy gtClassRef =
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
{- | Validation context for stake redeemers that allow only one stake to be
|
||||||
|
spent in the transaction.
|
||||||
|
|
||||||
|
@since 1.0.0
|
||||||
|
-}
|
||||||
data POnlyOneStakeContext (s :: S) = POnlyOneStakeContext
|
data POnlyOneStakeContext (s :: S) = POnlyOneStakeContext
|
||||||
{ ownOutputDatum :: Term s PStakeDatum
|
{ ownOutputDatum :: Term s PStakeDatum
|
||||||
, ownOutputValue :: Term s (PValue 'Sorted 'Positive)
|
, ownOutputValue :: Term s (PValue 'Sorted 'Positive)
|
||||||
|
|
@ -204,12 +209,15 @@ data POnlyOneStakeContext (s :: S) = POnlyOneStakeContext
|
||||||
, onlyLocksUpdated :: Term s PBool
|
, onlyLocksUpdated :: Term s PBool
|
||||||
}
|
}
|
||||||
deriving stock
|
deriving stock
|
||||||
( Generic
|
( -- | @since 1.0.0
|
||||||
|
Generic
|
||||||
)
|
)
|
||||||
deriving anyclass
|
deriving anyclass
|
||||||
( PlutusType
|
( -- | @since 1.0.0
|
||||||
|
PlutusType
|
||||||
)
|
)
|
||||||
|
|
||||||
|
-- | @since 1.0.0
|
||||||
instance DerivePlutusType POnlyOneStakeContext where
|
instance DerivePlutusType POnlyOneStakeContext where
|
||||||
type DPTStrat _ = PlutusTypeScott
|
type DPTStrat _ = PlutusTypeScott
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue