correctly handle proposal time

This commit is contained in:
Hongrui Fang 2022-10-26 21:15:20 +08:00
parent d0f3162fdc
commit db15b4c218
3 changed files with 141 additions and 131 deletions

View file

@ -339,15 +339,19 @@ unlock ps = builder
---
ProposalStartingTime s = defStartingTime
time = case ps.transactionParameters.timeRange of
WhileVoting ->
closedBoundedInterval
((def :: ProposalTimingConfig).draftTime + 1)
((def :: ProposalTimingConfig).votingTime - 1)
let lb = s + (def :: ProposalTimingConfig).draftTime
ub = lb + (def :: ProposalTimingConfig).votingTime
in closedBoundedInterval (lb + 1) (ub - 1)
AfterVoting ->
closedBoundedInterval
((def :: ProposalTimingConfig).votingTime + 1)
((def :: ProposalTimingConfig).lockingTime - 1)
let lb =
s + (def :: ProposalTimingConfig).draftTime
+ (def :: ProposalTimingConfig).votingTime
ub = lb + (def :: ProposalTimingConfig).lockingTime
in closedBoundedInterval (lb + 1) (ub - 1)
sig = case ps.transactionParameters.signedBy of
Unknown -> defUnknown