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

@ -321,14 +321,18 @@ mkProposalBuilder ps =
value = sortValue $ minAda <> pst
in mconcat
[ input $
script proposalValidatorHash
. withOutRef proposalRef
. withDatum (mkProposalInputDatum ps)
. withValue value
mconcat
[ script proposalValidatorHash
, withOutRef proposalRef
, withDatum (mkProposalInputDatum ps)
, withValue value
]
, output $
script proposalValidatorHash
. withDatum (mkProposalOutputDatum ps)
. withValue value
mconcat
[ script proposalValidatorHash
, withDatum (mkProposalOutputDatum ps)
, withValue value
]
]
{- | The proposal redeemer used to spend the proposal UTXO, which is always
@ -400,14 +404,18 @@ mkStakeBuilder ps =
in mconcat
[ withSig
, input $
script stakeValidatorHash
. withOutRef (mkStakeRef idx)
. withValue perStakeValue
. withDatum i
mconcat
[ script stakeValidatorHash
, withOutRef (mkStakeRef idx)
, withValue perStakeValue
, withDatum i
]
, output $
script stakeValidatorHash
. withValue perStakeValue
. withDatum o
mconcat
[ script stakeValidatorHash
, withValue perStakeValue
, withDatum o
]
]
in mconcat $
zipWith3
@ -457,15 +465,19 @@ mkGovernorBuilder ps =
value = sortValue $ gst <> minAda
in mconcat
[ input $
script govValidatorHash
. withValue value
. withOutRef governorRef
. withDatum governorInputDatum
mconcat
[ script govValidatorHash
, withValue value
, withOutRef governorRef
, withDatum governorInputDatum
]
, output $
script govValidatorHash
. withValue value
. withOutRef governorRef
. withDatum (mkGovernorOutputDatum ps)
mconcat
[ script govValidatorHash
, withValue value
, withOutRef governorRef
, withDatum (mkGovernorOutputDatum ps)
]
]
{- | The proposal redeemer used to spend the governor UTXO, which is always
@ -501,9 +513,11 @@ mkAuthorityTokenBuilder (AuthorityTokenParameters es mdt invalidTokenName) =
in mconcat
[ mint minted
, output $
script vh
. maybe id withDatum mdt
. withValue value
mconcat
[ script vh
, maybe mempty withDatum mdt
, withValue value
]
]
-- | The redeemer used while running the authority token policy.

View file

@ -162,15 +162,19 @@ cosign ps = builder
else stakeDatum
in mconcat
[ input $
script stakeValidatorHash
. withValue stakeValue
. withDatum stakeDatum
. withTxId stakeTxRef
. withOutRef (mkStakeRef refIdx)
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum stakeDatum
, withTxId stakeTxRef
, withOutRef (mkStakeRef refIdx)
]
, output $
script stakeValidatorHash
. withValue stakeValue
. withDatum stakeOutputDatum
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum stakeOutputDatum
]
, signedWith stakeDatum.owner
]
)
@ -189,15 +193,19 @@ cosign ps = builder
proposalBuilder =
mconcat
[ input $
script proposalValidatorHash
. withValue pst
. withDatum proposalInputDatum
. withTxId proposalTxRef
. withOutRef proposalRef
mconcat
[ script proposalValidatorHash
, withValue pst
, withDatum proposalInputDatum
, withTxId proposalTxRef
, withOutRef proposalRef
]
, output $
script proposalValidatorHash
. withValue (sortValue (pst <> minAda))
. withDatum proposalOutputDatum
mconcat
[ script proposalValidatorHash
, withValue (sortValue (pst <> minAda))
, withDatum proposalOutputDatum
]
]
validTimeRange :: POSIXTimeRange

View file

@ -302,29 +302,39 @@ createProposal ps = builder
, ---
timeRange $ mkTimeRange ps
, input $
script govValidatorHash
. withValue governorValue
. withDatum governorInputDatum
. withOutRef governorRef
mconcat
[ script govValidatorHash
, withValue governorValue
, withDatum governorInputDatum
, withOutRef governorRef
]
, output $
script govValidatorHash
. withValue governorValue
. withDatum (mkGovernorOutputDatum ps)
mconcat
[ script govValidatorHash
, withValue governorValue
, withDatum (mkGovernorOutputDatum ps)
]
, ---
input $
script stakeValidatorHash
. withValue stakeValue
. withDatum (mkStakeInputDatum ps)
. withOutRef stakeRef
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum (mkStakeInputDatum ps)
, withOutRef stakeRef
]
, output $
script stakeValidatorHash
. withValue stakeValue
. withDatum (mkStakeOutputDatum ps)
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum (mkStakeOutputDatum ps)
]
, ---
output $
script proposalValidatorHash
. withValue proposalValue
. withDatum (mkProposalOutputDatum ps)
mconcat
[ script proposalValidatorHash
, withValue proposalValue
, withDatum (mkProposalOutputDatum ps)
]
]
--------------------------------------------------------------------------------

View file

@ -257,14 +257,18 @@ unlockStake ps =
( \((i, o), idx) ->
mconcat
[ input $
script proposalValidatorHash
. withValue pst
. withDatum i
. withOutRef (mkProposalRef idx)
mconcat
[ script proposalValidatorHash
, withValue pst
, withDatum i
, withOutRef (mkProposalRef idx)
]
, output $
script proposalValidatorHash
. withValue (sortValue $ pst <> minAda)
. withDatum o
mconcat
[ script proposalValidatorHash
, withValue (sortValue $ pst <> minAda)
, withDatum o
]
]
)
(zip pIODatums [0 ..])
@ -285,14 +289,18 @@ unlockStake ps =
stakes =
mconcat
[ input $
script stakeValidatorHash
. withValue stakeValue
. withDatum sInDatum
. withOutRef stakeRef
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum sInDatum
, withOutRef stakeRef
]
, output $
script stakeValidatorHash
. withValue stakeValue
. withDatum sOutDatum
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum sOutDatum
]
]
builder =

View file

@ -219,23 +219,31 @@ vote params =
, signedWith signer
, timeRange validTimeRange
, input $
script proposalValidatorHash
. withValue pst
. withDatum proposalInputDatum
. withOutRef proposalRef
mconcat
[ script proposalValidatorHash
, withValue pst
, withDatum proposalInputDatum
, withOutRef proposalRef
]
, input $
script stakeValidatorHash
. withValue stakeValue
. withDatum stakeInputDatum
. withOutRef stakeRef
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum stakeInputDatum
, withOutRef stakeRef
]
, output $
script proposalValidatorHash
. withValue pst
. withDatum proposalOutputDatum
mconcat
[ script proposalValidatorHash
, withValue pst
, withDatum proposalOutputDatum
]
, output $
script stakeValidatorHash
. withValue stakeValue
. withDatum stakeOutputDatum
mconcat
[ script stakeValidatorHash
, withValue stakeValue
, withDatum stakeOutputDatum
]
]
in builder