fix tests; add negative tests for unlocking in cooldown

This commit is contained in:
Hongrui Fang 2022-11-14 20:42:52 +08:00
parent 07f6f1e04d
commit 688ed1ef02
11 changed files with 124 additions and 50 deletions

View file

@ -20,9 +20,10 @@ import Agora.Proposal.Time (
)
import Agora.SafeMoney (GTTag)
import Agora.Stake (
ProposalLock (
ProposalAction (
Voted
),
ProposalLock (ProposalLock),
StakeDatum (..),
StakeRedeemer (PermitVote, RetractVotes),
)
@ -128,8 +129,19 @@ mkStakeInputOutputDatums op =
allStakes = take 10 $ firstStake : otherStakes
createdAt = (def :: ProposalTimingConfig).votingTime - 1
stakeWithLock =
(\stake -> stake {lockedBy = [Voted defProposalId defResultTag]})
( \stake ->
stake
{ lockedBy =
[ ProposalLock defProposalId $
Voted
defResultTag
createdAt
]
}
)
<$> allStakes
in wrap op (,) allStakes stakeWithLock