better naming

This commit is contained in:
fanghr 2022-05-20 19:10:34 +08:00
parent 1b9aaf111d
commit 65dc55f37f
2 changed files with 12 additions and 12 deletions

View file

@ -1,5 +1,5 @@
module Sample.Effect.GovernorMutation ( module Sample.Effect.GovernorMutation (
mkEffectTransaction, mkEffectTxInfo,
effectValidator, effectValidator,
effectValidatorAddress, effectValidatorAddress,
effectValidatorHash, effectValidatorHash,
@ -86,8 +86,8 @@ mkEffectDatum newGovDatum =
Note that the transaction is valid only if the given new datum is valid. Note that the transaction is valid only if the given new datum is valid.
-} -}
mkEffectTransaction :: GovernorDatum -> TxInfo mkEffectTxInfo :: GovernorDatum -> TxInfo
mkEffectTransaction newGovDatum = mkEffectTxInfo newGovDatum =
let gst = Value.assetClassValue govAssetClass 1 let gst = Value.assetClassValue govAssetClass 1
at = Value.assetClassValue atAssetClass 1 at = Value.assetClassValue atAssetClass 1

View file

@ -10,7 +10,7 @@ import Sample.Effect.GovernorMutation (
govRef, govRef,
invalidNewGovernorDatum, invalidNewGovernorDatum,
mkEffectDatum, mkEffectDatum,
mkEffectTransaction, mkEffectTxInfo,
validNewGovernorDatum, validNewGovernorDatum,
) )
import Sample.Shared qualified as Shared import Sample.Shared qualified as Shared
@ -24,7 +24,7 @@ tests =
[ testGroup [ testGroup
"valid new governor datum" "valid new governor datum"
[ validatorSucceedsWith [ validatorSucceedsWith
"governor" "governor validator should pass"
(governorValidator Shared.governor) (governorValidator Shared.governor)
( GovernorDatum ( GovernorDatum
{ proposalThresholds = Shared.defaultProposalThresholds { proposalThresholds = Shared.defaultProposalThresholds
@ -33,19 +33,19 @@ tests =
) )
MutateGovernor MutateGovernor
( ScriptContext ( ScriptContext
(mkEffectTransaction validNewGovernorDatum) (mkEffectTxInfo validNewGovernorDatum)
(Spending govRef) (Spending govRef)
) )
, effectSucceedsWith , effectSucceedsWith
"effect" "effect validator should pass"
(mutateGovernorValidator Shared.governor) (mutateGovernorValidator Shared.governor)
(mkEffectDatum validNewGovernorDatum) (mkEffectDatum validNewGovernorDatum)
(ScriptContext (mkEffectTransaction validNewGovernorDatum) (Spending effectRef)) (ScriptContext (mkEffectTxInfo validNewGovernorDatum) (Spending effectRef))
] ]
, testGroup , testGroup
"invalid new governor datum" "invalid new governor datum"
[ validatorFailsWith [ validatorFailsWith
"governor" "governor validator should fail"
(governorValidator Shared.governor) (governorValidator Shared.governor)
( GovernorDatum ( GovernorDatum
{ proposalThresholds = Shared.defaultProposalThresholds { proposalThresholds = Shared.defaultProposalThresholds
@ -54,14 +54,14 @@ tests =
) )
MutateGovernor MutateGovernor
( ScriptContext ( ScriptContext
(mkEffectTransaction invalidNewGovernorDatum) (mkEffectTxInfo invalidNewGovernorDatum)
(Spending govRef) (Spending govRef)
) )
, effectFailsWith , effectFailsWith
"effect" "effect validator should fail"
(mutateGovernorValidator Shared.governor) (mutateGovernorValidator Shared.governor)
(mkEffectDatum validNewGovernorDatum) (mkEffectDatum validNewGovernorDatum)
(ScriptContext (mkEffectTransaction invalidNewGovernorDatum) (Spending effectRef)) (ScriptContext (mkEffectTxInfo invalidNewGovernorDatum) (Spending effectRef))
] ]
] ]
] ]