use liqwid-nix 2.0
This commit is contained in:
parent
b6ab3762ce
commit
7e628328da
35 changed files with 458 additions and 564 deletions
|
|
@ -101,7 +101,6 @@ import PlutusLedgerApi.V2 (
|
|||
PubKeyHash,
|
||||
ScriptHash,
|
||||
TxOutRef (TxOutRef),
|
||||
ValidatorHash,
|
||||
)
|
||||
import PlutusTx qualified
|
||||
import Sample.Proposal.Shared (
|
||||
|
|
@ -114,15 +113,15 @@ import Sample.Shared (
|
|||
authorityTokenSymbol,
|
||||
governor,
|
||||
governorAssetClass,
|
||||
governorScriptHash,
|
||||
governorValidator,
|
||||
governorValidatorHash,
|
||||
minAda,
|
||||
proposalAssetClass,
|
||||
proposalScriptHash,
|
||||
proposalValidator,
|
||||
proposalValidatorHash,
|
||||
signer,
|
||||
stakeAssetClass,
|
||||
stakeValidatorHash,
|
||||
stakeScriptHash,
|
||||
)
|
||||
import Test.Specification (
|
||||
SpecificationTree,
|
||||
|
|
@ -191,7 +190,7 @@ data AuthorityTokenParameters = forall
|
|||
, PIsData pdatum
|
||||
) =>
|
||||
AuthorityTokenParameters
|
||||
{ mintGATsFor :: ValidatorHash
|
||||
{ mintGATsFor :: ScriptHash
|
||||
-- ^ GATs will be minted and sent to the given group of effects.
|
||||
, carryDatum :: Maybe datum
|
||||
-- ^ The datum that GAT UTxOs will be carrying.
|
||||
|
|
@ -337,14 +336,14 @@ mkProposalBuilder ps =
|
|||
in mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withRef proposalRef
|
||||
, withDatum (mkProposalInputDatum ps)
|
||||
, withValue value
|
||||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withDatum (mkProposalOutputDatum ps)
|
||||
, withValue value
|
||||
]
|
||||
|
|
@ -402,7 +401,7 @@ mkStakeBuilder ps =
|
|||
[ withSig
|
||||
, referenceInput $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withRef (mkStakeRef idx)
|
||||
, withValue perStakeValue
|
||||
, withInlineDatum i
|
||||
|
|
@ -450,7 +449,7 @@ mkGovernorBuilder ps@(GovernorParameters _ redeemer) =
|
|||
in mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script governorValidatorHash
|
||||
[ script governorScriptHash
|
||||
, withValue value
|
||||
, withRef governorRef
|
||||
, withDatum governorInputDatum
|
||||
|
|
@ -458,7 +457,7 @@ mkGovernorBuilder ps@(GovernorParameters _ redeemer) =
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script governorValidatorHash
|
||||
[ script governorScriptHash
|
||||
, withValue value
|
||||
, withRef governorRef
|
||||
, withDatum (mkGovernorOutputDatum ps)
|
||||
|
|
|
|||
|
|
@ -76,11 +76,11 @@ import Sample.Shared (
|
|||
governor,
|
||||
minAda,
|
||||
proposalAssetClass,
|
||||
proposalScriptHash,
|
||||
proposalValidator,
|
||||
proposalValidatorHash,
|
||||
stakeAssetClass,
|
||||
stakeScriptHash,
|
||||
stakeValidator,
|
||||
stakeValidatorHash,
|
||||
)
|
||||
import Test.Specification (
|
||||
SpecificationTree,
|
||||
|
|
@ -248,7 +248,7 @@ cosign ps = builder
|
|||
mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeValue
|
||||
, withInlineDatum stakeInputDatum
|
||||
, withRef stakeRef
|
||||
|
|
@ -256,7 +256,7 @@ cosign ps = builder
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeValue
|
||||
, withInlineDatum stakeOutputDatum
|
||||
]
|
||||
|
|
@ -275,7 +275,7 @@ cosign ps = builder
|
|||
mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withValue proposalValue
|
||||
, withDatum proposalInputDatum
|
||||
, withRef proposalRef
|
||||
|
|
@ -283,7 +283,7 @@ cosign ps = builder
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withValue proposalValue
|
||||
, withDatum proposalOutputDatum
|
||||
]
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ import Plutarch.Context (
|
|||
withValue,
|
||||
)
|
||||
import Plutarch.Extra.AssetClass (assetClassValue)
|
||||
import Plutarch.Extra.ScriptContext (validatorHashToTokenName)
|
||||
import Plutarch.Extra.ScriptContext (scriptHashToTokenName)
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import PlutusLedgerApi.V2 (
|
||||
Credential (PubKeyCredential),
|
||||
|
|
@ -86,20 +86,20 @@ import Sample.Proposal.Shared (stakeTxRef)
|
|||
import Sample.Shared (
|
||||
governor,
|
||||
governorAssetClass,
|
||||
governorScriptHash,
|
||||
governorValidator,
|
||||
governorValidatorHash,
|
||||
minAda,
|
||||
proposalAssetClass,
|
||||
proposalPolicy,
|
||||
proposalPolicySymbol,
|
||||
proposalScriptHash,
|
||||
proposalStartingTimeFromTimeRange,
|
||||
proposalValidatorHash,
|
||||
signer,
|
||||
signer2,
|
||||
stakeAssetClass,
|
||||
stakeScriptHash,
|
||||
stakeSymbol,
|
||||
stakeValidator,
|
||||
stakeValidatorHash,
|
||||
)
|
||||
import Test.Specification (SpecificationTree, group, testPolicy, testValidator)
|
||||
import Test.Util (
|
||||
|
|
@ -319,7 +319,7 @@ createProposal ps = builder
|
|||
, withValue $
|
||||
Value.singleton
|
||||
stakeSymbol
|
||||
(validatorHashToTokenName attacker)
|
||||
(scriptHashToTokenName attacker)
|
||||
1
|
||||
, withDatum $
|
||||
(mkStakeInputDatum ps)
|
||||
|
|
@ -363,7 +363,7 @@ createProposal ps = builder
|
|||
timeRange $ mkTimeRange ps
|
||||
, input $
|
||||
mconcat
|
||||
[ script governorValidatorHash
|
||||
[ script governorScriptHash
|
||||
, withValue governorValue
|
||||
, withDatum governorInputDatum
|
||||
, withRedeemer ps.governorRedeemer
|
||||
|
|
@ -371,7 +371,7 @@ createProposal ps = builder
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script governorValidatorHash
|
||||
[ script governorScriptHash
|
||||
, withValue governorValue
|
||||
, withDatum (mkGovernorOutputDatum ps)
|
||||
]
|
||||
|
|
@ -385,7 +385,7 @@ createProposal ps = builder
|
|||
, withValue $
|
||||
Value.singleton
|
||||
stakeSymbol
|
||||
(validatorHashToTokenName attacker)
|
||||
(scriptHashToTokenName attacker)
|
||||
1
|
||||
, withDatum $
|
||||
(mkStakeInputDatum ps)
|
||||
|
|
@ -397,14 +397,14 @@ createProposal ps = builder
|
|||
mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeValue
|
||||
, withDatum (mkStakeInputDatum ps)
|
||||
, withRef stakeRef
|
||||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeValue
|
||||
, withDatum (mkStakeOutputDatum ps)
|
||||
]
|
||||
|
|
@ -412,7 +412,7 @@ createProposal ps = builder
|
|||
, ---
|
||||
output $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withValue proposalValue
|
||||
, withDatum (mkProposalOutputDatum ps)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@ import Sample.Proposal.Shared (proposalTxRef, stakeTxRef)
|
|||
import Sample.Shared (
|
||||
minAda,
|
||||
proposalAssetClass,
|
||||
proposalScriptHash,
|
||||
proposalValidator,
|
||||
proposalValidatorHash,
|
||||
stakeAssetClass,
|
||||
stakeScriptHash,
|
||||
stakeValidator,
|
||||
stakeValidatorHash,
|
||||
)
|
||||
import Test.Specification (SpecificationTree, group, testValidator)
|
||||
import Test.Util (CombinableBuilder, closedBoundedInterval, mkSpending, pubKeyHashes)
|
||||
|
|
@ -166,7 +166,7 @@ privilegeEscalate op =
|
|||
mconcat @b
|
||||
[ input $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withDatum stakeInput
|
||||
, withValue stakeValue
|
||||
, withRef $ mkStakeRef index
|
||||
|
|
@ -174,7 +174,7 @@ privilegeEscalate op =
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withDatum stakeOutput
|
||||
, withValue stakeValue
|
||||
]
|
||||
|
|
@ -196,7 +196,7 @@ privilegeEscalate op =
|
|||
mconcat @b
|
||||
[ input $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withDatum proposalInput
|
||||
, withRedeemer $ mkProposalRedeemer op
|
||||
, withValue proposalValue
|
||||
|
|
@ -204,7 +204,7 @@ privilegeEscalate op =
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withDatum proposalOutput
|
||||
, withValue proposalValue
|
||||
]
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ import Plutarch.Context (
|
|||
withValue,
|
||||
)
|
||||
import Plutarch.Extra.AssetClass (assetClassValue)
|
||||
import Plutarch.Extra.ScriptContext (validatorHashToTokenName)
|
||||
import Plutarch.Extra.ScriptContext (scriptHashToTokenName)
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import PlutusLedgerApi.V2 (
|
||||
Credential (PubKeyCredential),
|
||||
|
|
@ -85,11 +85,11 @@ import Sample.Shared (
|
|||
governor,
|
||||
minAda,
|
||||
proposalAssetClass,
|
||||
proposalScriptHash,
|
||||
proposalValidator,
|
||||
proposalValidatorHash,
|
||||
stakeScriptHash,
|
||||
stakeSymbol,
|
||||
stakeValidator,
|
||||
stakeValidatorHash,
|
||||
)
|
||||
import Test.Specification (SpecificationTree, group, testValidator)
|
||||
import Test.Util (CombinableBuilder, closedBoundedInterval, mkSpending, pubKeyHashes)
|
||||
|
|
@ -282,7 +282,7 @@ unlock ps = builder
|
|||
mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withValue proposalValue
|
||||
, withDatum proposalInputDatum
|
||||
, withRef proposalRef
|
||||
|
|
@ -290,7 +290,7 @@ unlock ps = builder
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withValue proposalValue
|
||||
, withDatum proposalOutputDatum
|
||||
]
|
||||
|
|
@ -299,7 +299,7 @@ unlock ps = builder
|
|||
---
|
||||
|
||||
sstName = case ps.stakeParameters.sstOwner of
|
||||
StakeValidator -> validatorHashToTokenName stakeValidatorHash
|
||||
StakeValidator -> scriptHashToTokenName stakeScriptHash
|
||||
_ -> ""
|
||||
|
||||
sst = Value.singleton stakeSymbol sstName 1
|
||||
|
|
@ -350,14 +350,14 @@ unlock ps = builder
|
|||
mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeInputValue
|
||||
, withDatum stakeInputDatum
|
||||
, withRef $ mkStakeRef i
|
||||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeOutputValue
|
||||
, withDatum stakeOutputDatum
|
||||
]
|
||||
|
|
|
|||
|
|
@ -76,11 +76,11 @@ import Sample.Shared (
|
|||
governor,
|
||||
minAda,
|
||||
proposalAssetClass,
|
||||
proposalScriptHash,
|
||||
proposalValidator,
|
||||
proposalValidatorHash,
|
||||
stakeAssetClass,
|
||||
stakeScriptHash,
|
||||
stakeValidator,
|
||||
stakeValidatorHash,
|
||||
)
|
||||
import Test.Specification (SpecificationTree, group, testValidator)
|
||||
import Test.Util (
|
||||
|
|
@ -297,7 +297,7 @@ vote params =
|
|||
mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeInputValue
|
||||
, withInlineDatum $ mixOwner i stakeInputDatum
|
||||
, withRedeemer stakeRedeemer
|
||||
|
|
@ -308,7 +308,7 @@ vote params =
|
|||
else
|
||||
output $
|
||||
mconcat
|
||||
[ script stakeValidatorHash
|
||||
[ script stakeScriptHash
|
||||
, withValue stakeOutputValue
|
||||
, withInlineDatum $ mixOwner i stakeOutputDatum
|
||||
]
|
||||
|
|
@ -353,7 +353,7 @@ vote params =
|
|||
mconcat
|
||||
[ input $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withValue proposalValue
|
||||
, withRedeemer proposalRedeemer
|
||||
, withInlineDatum proposalInputDatum
|
||||
|
|
@ -361,7 +361,7 @@ vote params =
|
|||
]
|
||||
, output $
|
||||
mconcat
|
||||
[ script proposalValidatorHash
|
||||
[ script proposalScriptHash
|
||||
, withValue proposalValue
|
||||
, withInlineDatum proposalOutputDatum
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue