fix compilation errors

This commit is contained in:
Hongrui Fang 2022-08-03 20:59:37 +08:00
parent caae87d564
commit 33e4ed037e
36 changed files with 1325 additions and 1271 deletions

View file

@ -114,7 +114,7 @@ govValidatorHash :: ValidatorHash
govValidatorHash = governorValidatorHash governor
govPolicy :: MintingPolicy
govPolicy = mkMintingPolicy (governorPolicy governor)
govPolicy = mkMintingPolicy def (governorPolicy governor)
govSymbol :: CurrencySymbol
govSymbol = mintingPolicySymbol govPolicy
@ -169,12 +169,16 @@ mintGST ps = builder
then
mconcat
[ input $
pubKey witnessPubKey
. withValue witnessValue
. withOutRef witnessRef
mconcat
[ pubKey witnessPubKey
, withValue witnessValue
, withOutRef witnessRef
]
, output $
pubKey witnessPubKey
. withValue witnessValue
mconcat
[ pubKey witnessPubKey
, withValue witnessValue
]
]
else mempty
@ -184,11 +188,13 @@ mintGST ps = builder
let datum =
if ps.withGovernorDatum
then withDatum governorOutputDatum
else id
else mempty
in output $
script govValidatorHash
. withValue governorValue
. datum
mconcat
[ script govValidatorHash
, withValue governorValue
, datum
]
--
builder =
mconcat

View file

@ -49,7 +49,7 @@ import Sample.Shared (
minAda,
)
import Test.Specification (SpecificationTree, testValidator)
import Test.Util (CombinableBuilder, mkSpending, pubKeyHashes, sortValue, validatorHashes, withOptional)
import Test.Util (CombinableBuilder, mkSpending, pubKeyHashes, sortValue, validatorHashes)
--------------------------------------------------------------------------------
@ -142,18 +142,22 @@ mkGovernorBuilder ps =
then pubKey $ head pubKeyHashes
else script govValidatorHash
withGSTDatum =
withOptional withDatum $
maybe mempty withDatum $
mkGovernorOutputDatum ps.governorOutputDatumValidity
in mconcat
[ input $
script govValidatorHash
. withDatum governorInputDatum
. withValue value
. withOutRef governorRef
mconcat
[ script govValidatorHash
, withDatum governorInputDatum
, withValue value
, withOutRef governorRef
]
, output $
gstOutput
. withGSTDatum
. withValue value
mconcat
[ gstOutput
, withGSTDatum
, withValue value
]
]
--------------------------------------------------------------------------------
@ -162,7 +166,7 @@ mockEffectValidator :: ClosedTerm PValidator
mockEffectValidator = noOpValidator authorityTokenSymbol
mockEffectValidatorHash :: ValidatorHash
mockEffectValidatorHash = validatorHash $ mkValidator mockEffectValidator
mockEffectValidatorHash = validatorHash $ mkValidator def mockEffectValidator
mkGATValue :: GATValidity -> Integer -> Value
mkGATValue NoGAT _ = mempty
@ -187,11 +191,15 @@ mkMockEffectBuilder ps =
in mconcat
[ mint burnt
, input $
script mockEffectValidatorHash
. withValue inputValue
mconcat
[ script mockEffectValidatorHash
, withValue inputValue
]
, output $
script mockEffectValidatorHash
. withValue outputValue
mconcat
[ script mockEffectValidatorHash
, withValue outputValue
]
]
--------------------------------------------------------------------------------