add the rest of the tests

They won't pass for some reasons, unfortunately.
This commit is contained in:
fanghr 2022-05-05 19:39:12 +08:00
parent a12c9832b8
commit c1c4c919a2
No known key found for this signature in database
GPG key ID: 35CD9A71CD5D5870
2 changed files with 16 additions and 4 deletions

View file

@ -10,7 +10,7 @@ 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, mintGST)
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)
@ -35,5 +35,17 @@ tests =
(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
]
]

View file

@ -8,7 +8,7 @@ This module tests primarily the happy path for Governor interactions
module Spec.Sample.Governor (
createProposal,
mutateState,
mintGAT,
mintGATs,
mintGST,
) where
@ -268,8 +268,8 @@ createProposal =
}
-- | This script context should be a valid transaction.
mintGAT :: ScriptContext
mintGAT =
mintGATs :: ScriptContext
mintGATs =
let pst = Value.singleton proposalPolicySymbol "" 1
gst = Value.assetClassValue govAssetClass 1
gat = Value.assetClassValue atAssetClass 1