From c1c4c919a249c6a7621cfca1bfd4c9b8abe48963 Mon Sep 17 00:00:00 2001 From: fanghr Date: Thu, 5 May 2022 19:39:12 +0800 Subject: [PATCH] add the rest of the tests They won't pass for some reasons, unfortunately. --- agora-test/Spec/Governor.hs | 14 +++++++++++++- agora-test/Spec/Sample/Governor.hs | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/agora-test/Spec/Governor.hs b/agora-test/Spec/Governor.hs index 797041c..10ce7be 100644 --- a/agora-test/Spec/Governor.hs +++ b/agora-test/Spec/Governor.hs @@ -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 ] ] diff --git a/agora-test/Spec/Sample/Governor.hs b/agora-test/Spec/Sample/Governor.hs index 2326444..b169093 100644 --- a/agora-test/Spec/Sample/Governor.hs +++ b/agora-test/Spec/Sample/Governor.hs @@ -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