Remove address check for state thread token output

This commit is contained in:
Daniel Farrelly 2023-04-13 19:17:25 +01:00 committed by Emily Martins
parent e5605514f5
commit 116c9f7ac9
4 changed files with 9 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -27,7 +27,7 @@ import Agora.Governor (
) )
import Agora.Proposal (PProposalId) import Agora.Proposal (PProposalId)
import Agora.SafeMoney (AuthorityTokenTag, GovernorSTTag) import Agora.SafeMoney (AuthorityTokenTag, GovernorSTTag)
import Agora.Utils (pfindInputWithStateThreadToken, pfindOutputWithStateThreadTokenAndAddress) import Agora.Utils (pfindInputWithStateThreadToken, pfindOutputWithStateThreadToken)
import Generics.SOP qualified as SOP import Generics.SOP qualified as SOP
import Plutarch.Api.V1 (PCurrencySymbol) import Plutarch.Api.V1 (PCurrencySymbol)
import Plutarch.Api.V2 ( import Plutarch.Api.V2 (
@ -204,8 +204,6 @@ mutateGovernorValidator =
governorRef = pfield @"outRef" # governorInput governorRef = pfield @"outRef" # governorInput
governorInputAddress = pfield @"address" #$ pfield @"resolved" # governorInput
governorInputDatum = governorInputDatum =
ptrace "Resolve governor input datum" $ ptrace "Resolve governor input datum" $
pfromData $ pfromData $
@ -256,9 +254,8 @@ mutateGovernorValidator =
governorOutput = governorOutput =
passertPJust passertPJust
# "No governor output found" # "No governor output found"
#$ pfindOutputWithStateThreadTokenAndAddress #$ pfindOutputWithStateThreadToken
# pfromData gstSymbol # pfromData gstSymbol
# governorInputAddress
# pfromData txInfoF.outputs # pfromData txInfoF.outputs
governorOutputDatum = governorOutputDatum =

View file

@ -21,7 +21,7 @@ module Agora.Utils (
puncurryTuple, puncurryTuple,
psubtractSortedValue, psubtractSortedValue,
pfindInputWithStateThreadToken, pfindInputWithStateThreadToken,
pfindOutputWithStateThreadTokenAndAddress, pfindOutputWithStateThreadToken,
pisSubValueOf, pisSubValueOf,
) where ) where
@ -31,7 +31,6 @@ import Plutarch.Api.V1.AssocMap qualified as AssocMap
import Plutarch.Api.V1.Scripts (PDatumHash (PDatumHash)) import Plutarch.Api.V1.Scripts (PDatumHash (PDatumHash))
import Plutarch.Api.V2 ( import Plutarch.Api.V2 (
AmountGuarantees (NoGuarantees), AmountGuarantees (NoGuarantees),
PAddress,
PCurrencySymbol, PCurrencySymbol,
PMaybeData (PDNothing), PMaybeData (PDNothing),
PTuple, PTuple,
@ -203,19 +202,17 @@ pfindInputWithStateThreadToken = plam $ \tokenSymbol inputs ->
# inputs # inputs
{- | Find an output containing exactly one token with the given currency symbol, {- | Find an output containing exactly one token with the given currency symbol,
and with a PAddress that matches the given one.
@since 1.0.0 @since 1.0.0
-} -}
pfindOutputWithStateThreadTokenAndAddress :: pfindOutputWithStateThreadToken ::
forall tag. forall tag.
ClosedTerm ClosedTerm
( PTagged tag PCurrencySymbol ( PTagged tag PCurrencySymbol
:--> PAddress
:--> PBuiltinList PTxOut :--> PBuiltinList PTxOut
:--> PMaybe PTxOut :--> PMaybe PTxOut
) )
pfindOutputWithStateThreadTokenAndAddress = plam $ \tokenSymbol address outputs -> pfindOutputWithStateThreadToken = plam $ \tokenSymbol outputs ->
pfind pfind
# ( plam $ \output -> # ( plam $ \output ->
( ptaggedSymbolValueOf ( ptaggedSymbolValueOf
@ -223,7 +220,6 @@ pfindOutputWithStateThreadTokenAndAddress = plam $ \tokenSymbol address outputs
# (pfield @"value" # output) # (pfield @"value" # output)
#== 1 #== 1
) )
#&& (address #== (pfield @"address" # output))
) )
# outputs # outputs