agora/agora-test/Spec/Governor.hs
fanghr c1c4c919a2
add the rest of the tests
They won't pass for some reasons, unfortunately.
2022-05-06 17:11:13 +08:00

51 lines
1.5 KiB
Haskell

{- |
Module : Spec.Governor
Maintainer : connor@mlabs.city
Description: Tests for Governor policy and validator
Tests for Governor policy and validator
-}
module Spec.Governor (tests) where
import Agora.Governor (GovernorDatum (..), GovernorRedeemer (..))
import Agora.Governor.Scripts (governorPolicy, governorValidator)
import Agora.Proposal (ProposalId (..))
import Spec.Sample.Governor (createProposal, mintGATs, mintGST, mutateState)
import Spec.Sample.Shared qualified as Shared
import Spec.Util (policySucceedsWith, validatorSucceedsWith)
import Test.Tasty (TestTree, testGroup)
--------------------------------------------------------------------------------
tests :: [TestTree]
tests =
[ testGroup
"policy"
[ policySucceedsWith
"GST minting"
(governorPolicy Shared.governor)
()
mintGST
]
, testGroup
"validator"
[ validatorSucceedsWith
"proposal creation"
(governorValidator Shared.governor)
(GovernorDatum Shared.defaultProposalThresholds (ProposalId 0))
CreateProposal
createProposal
, validatorSucceedsWith
"GATs minting"
(governorValidator Shared.governor)
(GovernorDatum Shared.defaultProposalThresholds (ProposalId 5))
MintGATs
mintGATs
, validatorSucceedsWith
"mutate governor state"
(governorValidator Shared.governor)
(GovernorDatum Shared.defaultProposalThresholds (ProposalId 5))
MutateGovernor
mutateState
]
]