ensure votes changed in VotingReady while calling UnlockStakes
This commit is contained in:
parent
431092fb1c
commit
0d0e122bd2
1 changed files with 37 additions and 31 deletions
|
|
@ -549,6 +549,7 @@ proposalValidator =
|
|||
|
||||
PUnlockStake _ -> spendStakes $ \sctxF -> do
|
||||
let expectedVotes =
|
||||
pdata $
|
||||
pfoldl
|
||||
# plam
|
||||
( \votes stake -> unTermCont $ do
|
||||
|
|
@ -611,14 +612,19 @@ proposalValidator =
|
|||
.& #thresholds
|
||||
.= proposalInputDatumF.thresholds
|
||||
.& #votes
|
||||
.= pdata expectedVotes
|
||||
.= expectedVotes
|
||||
.& #timingConfig
|
||||
.= proposalInputDatumF.timingConfig
|
||||
.& #startingTime
|
||||
.= proposalInputDatumF.startingTime
|
||||
)
|
||||
in ptraceIfFalse "Update votes" $
|
||||
in foldl1
|
||||
(#&&)
|
||||
[ ptraceIfFalse "Votes changed" $
|
||||
pnot #$ expectedVotes #== proposalInputDatumF.votes
|
||||
, ptraceIfFalse "Proposal update correct" $
|
||||
expectedProposalOut #== proposalOutputDatum
|
||||
]
|
||||
)
|
||||
-- No change to the proposal is allowed.
|
||||
( ptraceIfFalse "Proposal unchanged" $
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue