add new tests for creating proposals
This commit is contained in:
parent
0495d27f86
commit
f0d0188812
11 changed files with 593 additions and 173 deletions
|
|
@ -42,6 +42,8 @@ module Test.Specification (
|
|||
validatorFailsWith,
|
||||
effectSucceedsWith,
|
||||
effectFailsWith,
|
||||
testValidator,
|
||||
testPolicy,
|
||||
|
||||
-- * Converters
|
||||
toTestTree,
|
||||
|
|
@ -253,3 +255,37 @@ effectFailsWith ::
|
|||
ScriptContext ->
|
||||
SpecificationTree
|
||||
effectFailsWith tag eff datum = validatorFailsWith tag eff datum ()
|
||||
|
||||
testValidator ::
|
||||
( PLift datum
|
||||
, PlutusTx.ToData (PLifted datum)
|
||||
, PLift redeemer
|
||||
, PlutusTx.ToData (PLifted redeemer)
|
||||
) =>
|
||||
-- | Should the validator pass?
|
||||
Bool ->
|
||||
String ->
|
||||
ClosedTerm PValidator ->
|
||||
PLifted datum ->
|
||||
PLifted redeemer ->
|
||||
ScriptContext ->
|
||||
SpecificationTree
|
||||
testValidator isValid =
|
||||
if isValid
|
||||
then validatorSucceedsWith
|
||||
else validatorFailsWith
|
||||
|
||||
testPolicy ::
|
||||
( PLift redeemer
|
||||
, PlutusTx.ToData (PLifted redeemer)
|
||||
) =>
|
||||
Bool ->
|
||||
String ->
|
||||
ClosedTerm PMintingPolicy ->
|
||||
PLifted redeemer ->
|
||||
ScriptContext ->
|
||||
SpecificationTree
|
||||
testPolicy isValid =
|
||||
if isValid
|
||||
then policySucceedsWith
|
||||
else policyFailsWith
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue