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
|
PUnlockStake _ -> spendStakes $ \sctxF -> do
|
||||||
let expectedVotes =
|
let expectedVotes =
|
||||||
|
pdata $
|
||||||
pfoldl
|
pfoldl
|
||||||
# plam
|
# plam
|
||||||
( \votes stake -> unTermCont $ do
|
( \votes stake -> unTermCont $ do
|
||||||
|
|
@ -611,14 +612,19 @@ proposalValidator =
|
||||||
.& #thresholds
|
.& #thresholds
|
||||||
.= proposalInputDatumF.thresholds
|
.= proposalInputDatumF.thresholds
|
||||||
.& #votes
|
.& #votes
|
||||||
.= pdata expectedVotes
|
.= expectedVotes
|
||||||
.& #timingConfig
|
.& #timingConfig
|
||||||
.= proposalInputDatumF.timingConfig
|
.= proposalInputDatumF.timingConfig
|
||||||
.& #startingTime
|
.& #startingTime
|
||||||
.= proposalInputDatumF.startingTime
|
.= proposalInputDatumF.startingTime
|
||||||
)
|
)
|
||||||
in ptraceIfFalse "Update votes" $
|
in foldl1
|
||||||
|
(#&&)
|
||||||
|
[ ptraceIfFalse "Votes changed" $
|
||||||
|
pnot #$ expectedVotes #== proposalInputDatumF.votes
|
||||||
|
, ptraceIfFalse "Proposal update correct" $
|
||||||
expectedProposalOut #== proposalOutputDatum
|
expectedProposalOut #== proposalOutputDatum
|
||||||
|
]
|
||||||
)
|
)
|
||||||
-- No change to the proposal is allowed.
|
-- No change to the proposal is allowed.
|
||||||
( ptraceIfFalse "Proposal unchanged" $
|
( ptraceIfFalse "Proposal unchanged" $
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue