From 30b66a29ffb3a215b92f4769b535fa0516772ec5 Mon Sep 17 00:00:00 2001 From: fanghr Date: Sat, 7 May 2022 18:49:37 +0800 Subject: [PATCH] add a simple test --- agora-test/Spec/Effect/GovernorMutation.hs | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/agora-test/Spec/Effect/GovernorMutation.hs b/agora-test/Spec/Effect/GovernorMutation.hs index 7863cb6..38b9e38 100644 --- a/agora-test/Spec/Effect/GovernorMutation.hs +++ b/agora-test/Spec/Effect/GovernorMutation.hs @@ -1,6 +1,30 @@ module Spec.Effect.GovernorMutation (tests) where -import Test.Tasty (TestTree) +import Agora.Effect.GovernorMutation (MutateGovernorDatum (..), mutateGovernorValidator) +import Agora.Governor (GovernorDatum (..)) +import Agora.Proposal (ProposalId (..)) +import Plutus.V1.Ledger.Api (TxOutRef (..)) +import Spec.Sample.Effect.GovernorMutation +import Spec.Sample.Shared +import Spec.Util (effectSucceedsWith) +import Test.Tasty (TestTree, testGroup) tests :: [TestTree] -tests = [] +tests = + [ testGroup + "validator" + [ effectSucceedsWith + "Simple" + (mutateGovernorValidator governor) + ( MutateGovernorDatum + { governorRef = TxOutRef "614481d2159bfb72350222d61fce17e548e0fc00e5a1f841ff1837c431346ce7" 1 + , newDatum = + GovernorDatum + { nextProposalId = ProposalId 42 + , proposalThresholds = defaultProposalThresholds + } + } + ) + validContext + ] + ]