From a3a76a2461974c61dc8072da3f1065ae0aa224de Mon Sep 17 00:00:00 2001 From: Seungheon Oh Date: Fri, 15 Apr 2022 08:43:47 -0500 Subject: [PATCH] small fixes for Treasury Withdrawal Effect --- agora/Agora/Effect/TreasuryWithdrawal.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/agora/Agora/Effect/TreasuryWithdrawal.hs b/agora/Agora/Effect/TreasuryWithdrawal.hs index 6ba6375..8f475f6 100644 --- a/agora/Agora/Effect/TreasuryWithdrawal.hs +++ b/agora/Agora/Effect/TreasuryWithdrawal.hs @@ -64,6 +64,7 @@ deriving via instance (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 = phoistAcyclic $ plam $ \txInfo spending' -> P.do @@ -95,7 +96,7 @@ treasuryWithdrawalValidator currSymbol = makeEffect currSymbol $ pall # plam id #$ pmap # plam (\out -> pelem # out # outputValues) #$ receivers - outputNumberMatchesRecivers = plength # receivers #== plength # (pfromData txInfo.outputs) + outputNumberMatchesReceivers = plength # receivers #== plength # (pfromData txInfo.outputs) outputIsNotPayingToEffect = P.do input <- pletFields @'["address", "value"] $ findOwnAddress # pfromData txInfo' # txOutRef' let correctMinimum = passetClassValueOf' (AssetClass ("", "")) # input.value #== 2000000 @@ -108,9 +109,8 @@ treasuryWithdrawalValidator currSymbol = makeEffect currSymbol $ # pfromData txInfo.outputs correctMinimum #&& notPayingToEffect - passert "Transaction output does not match receivers" $ - outputContentMatchesRecivers - #&& outputNumberMatchesRecivers - #&& outputIsNotPayingToEffect + passert "Transaction output does not match receivers" outputContentMatchesRecivers + passert "" outputNumberMatchesReceivers + passert "" outputIsNotPayingToEffect popaque $ pconstant ()