small fixes for Treasury Withdrawal Effect
This commit is contained in:
parent
7cae728860
commit
e08efd173b
1 changed files with 5 additions and 5 deletions
|
|
@ -64,6 +64,7 @@ deriving via
|
||||||
instance
|
instance
|
||||||
(PConstant TreasuryWithdrawalDatum)
|
(PConstant TreasuryWithdrawalDatum)
|
||||||
|
|
||||||
|
-- These functions can be replaced with ones on Utils.hs once seungheonoh/util branch get merged.
|
||||||
findOwnInput :: Term s (PTxInfo :--> PTxOutRef :--> PTxInInfo)
|
findOwnInput :: Term s (PTxInfo :--> PTxOutRef :--> PTxInInfo)
|
||||||
findOwnInput = phoistAcyclic $
|
findOwnInput = phoistAcyclic $
|
||||||
plam $ \txInfo spending' -> P.do
|
plam $ \txInfo spending' -> P.do
|
||||||
|
|
@ -95,7 +96,7 @@ treasuryWithdrawalValidator currSymbol = makeEffect currSymbol $
|
||||||
pall # plam id #$ pmap
|
pall # plam id #$ pmap
|
||||||
# plam (\out -> pelem # out # outputValues)
|
# plam (\out -> pelem # out # outputValues)
|
||||||
#$ receivers
|
#$ receivers
|
||||||
outputNumberMatchesRecivers = plength # receivers #== plength # (pfromData txInfo.outputs)
|
outputNumberMatchesReceivers = plength # receivers #== plength # (pfromData txInfo.outputs)
|
||||||
outputIsNotPayingToEffect = P.do
|
outputIsNotPayingToEffect = P.do
|
||||||
input <- pletFields @'["address", "value"] $ findOwnAddress # pfromData txInfo' # txOutRef'
|
input <- pletFields @'["address", "value"] $ findOwnAddress # pfromData txInfo' # txOutRef'
|
||||||
let correctMinimum = passetClassValueOf' (AssetClass ("", "")) # input.value #== 2000000
|
let correctMinimum = passetClassValueOf' (AssetClass ("", "")) # input.value #== 2000000
|
||||||
|
|
@ -108,9 +109,8 @@ treasuryWithdrawalValidator currSymbol = makeEffect currSymbol $
|
||||||
# pfromData txInfo.outputs
|
# pfromData txInfo.outputs
|
||||||
correctMinimum #&& notPayingToEffect
|
correctMinimum #&& notPayingToEffect
|
||||||
|
|
||||||
passert "Transaction output does not match receivers" $
|
passert "Transaction output does not match receivers" outputContentMatchesRecivers
|
||||||
outputContentMatchesRecivers
|
passert "" outputNumberMatchesReceivers
|
||||||
#&& outputNumberMatchesRecivers
|
passert "" outputIsNotPayingToEffect
|
||||||
#&& outputIsNotPayingToEffect
|
|
||||||
|
|
||||||
popaque $ pconstant ()
|
popaque $ pconstant ()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue