add proposal creation test
This commit is contained in:
parent
3e612135df
commit
0baf79924f
2 changed files with 29 additions and 5 deletions
|
|
@ -7,9 +7,33 @@ Tests for Governor policy and validator
|
||||||
-}
|
-}
|
||||||
module Spec.Governor (tests) where
|
module Spec.Governor (tests) where
|
||||||
|
|
||||||
import Test.Tasty (TestTree)
|
import Agora.Governor (GovernorDatum (..), GovernorRedeemer (..))
|
||||||
|
import Agora.Governor.Scripts (governorPolicy, governorValidator)
|
||||||
|
import Agora.Proposal (ProposalId (..))
|
||||||
|
import Spec.Sample.Governor (mintGST, createProposal)
|
||||||
|
import Spec.Sample.Shared qualified as Shared
|
||||||
|
import Spec.Util (policySucceedsWith, validatorSucceedsWith)
|
||||||
|
import Test.Tasty (TestTree, testGroup)
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
tests :: [TestTree]
|
tests :: [TestTree]
|
||||||
tests = []
|
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
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Description: Sample based testing for Governor utxos
|
||||||
This module tests primarily the happy path for Governor interactions
|
This module tests primarily the happy path for Governor interactions
|
||||||
-}
|
-}
|
||||||
module Spec.Sample.Governor (
|
module Spec.Sample.Governor (
|
||||||
proposalCreation,
|
createProposal,
|
||||||
mutateState,
|
mutateState,
|
||||||
mintGAT,
|
mintGAT,
|
||||||
mintGST,
|
mintGST,
|
||||||
|
|
@ -130,8 +130,8 @@ mintGST =
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | This script context should be a valid transaction.
|
-- | This script context should be a valid transaction.
|
||||||
proposalCreation :: ScriptContext
|
createProposal :: ScriptContext
|
||||||
proposalCreation =
|
createProposal =
|
||||||
let pst = Value.singleton proposalPolicySymbol "" 1
|
let pst = Value.singleton proposalPolicySymbol "" 1
|
||||||
gst = Value.assetClassValue govAssetClass 1
|
gst = Value.assetClassValue govAssetClass 1
|
||||||
sst = Value.assetClassValue stakeAssetClass 1
|
sst = Value.assetClassValue stakeAssetClass 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue