add tests for GAT minting

no more propsoal T_T
This commit is contained in:
Hongrui Fang 2022-07-18 18:31:51 +08:00
parent 2098de2d9c
commit 558313e213
12 changed files with 1544 additions and 751 deletions

View file

@ -575,18 +575,19 @@ governorValidator gov =
gatOutputValidator = gatOutputValidator' # effectGroup
pure $
popaque $
pfoldr
# plam
( \txOut r ->
let value = pfield @"value" # txOut
atValue = psymbolValueOf # patSymbol # value
in pif (atValue #== 0) r $
pif (atValue #== 1) (r #&& gatOutputValidator # txOut) $ pconstant False
)
# pconstant True
# pfromData txInfoF.outputs
pguardC "GATs valid" $
pfoldr
# plam
( \txOut r ->
let value = pfield @"value" # txOut
atValue = psymbolValueOf # patSymbol # value
in pif (atValue #== 0) r $
pif (atValue #== 1) (r #&& gatOutputValidator # txOut) $ pconstant False
)
# pconstant True
# pfromData txInfoF.outputs
pure $ popaque $ pconstant ()
--------------------------------------------------------------------------

View file

@ -119,7 +119,7 @@ data ProposalLock
-- ^ The identifier of the proposal.
| -- | The stake was used to vote on a proposal.
--
-- This kind of lock is placed while voting on a propsoal, in order to
-- This kind of lock is placed while voting on a proposal, in order to
-- prevent depositing and withdrawing when votes are in place.
--
-- @since 0.2.0
@ -416,13 +416,13 @@ data PStakeRole (s :: S)
PVoter
(Term s PResultTag)
-- ^ The option which was voted for.
| -- | The stake was used to create the propsoal.
| -- | The stake was used to create the proposal.
PCreator
| -- | The stake was used to both create and vote on the proposal.
PBoth
(Term s PResultTag)
-- ^ The option which was voted for.
| -- | The stake has nothing to do with the given propsoal.
| -- | The stake has nothing to do with the given proposal.
PIrrelevant
deriving stock
( -- | @since 0.2.0