remove redundant checks from the governor validator

This commit is contained in:
Hongrui Fang 2022-09-27 22:55:59 +08:00
parent b7a7d6c505
commit eed8065b16
No known key found for this signature in database
GPG key ID: F10AB2CCE24113DD

View file

@ -45,7 +45,6 @@ import Agora.Scripts (
stakeSTSymbol,
)
import Agora.Stake (
PProposalLock (..),
PStakeDatum (..),
pnumCreatedProposals,
)
@ -469,31 +468,6 @@ governorValidator as =
#&& proposalOutputDatumF.timingConfig #== governorInputDatumF.proposalTimings
]
-- Check the output stake has been properly updated.
let stakeOutputDatum =
passertPJust # "Output stake should be presented"
#$ pfindJust
# getStakeDatum
# pfromData txInfoF.outputs
stakeOutputLocks =
pfromData $ pfield @"lockedBy" # stakeOutputDatum
-- The stake should be locked by the newly created proposal.
newLock =
mkRecordConstr
PCreated
( #created .= governorInputDatumF.nextProposalId
)
-- Append new locks to existing locks
expectedProposalLocks =
pcons # pdata newLock # stakeInputDatumF.lockedBy
pguardC "Stake output locks correct" $
plistEquals # stakeOutputLocks # expectedProposalLocks
pure $ popaque $ pconstant ()
------------------------------------------------------------------------