deal with timedOut Assessments & refund
Feature Merge Request
implements the wireframes laid out in #292 (closed)
- when fetching an assessment one checks whether the stage-action can still be executed or whether the time has run out. if so, it's a flag 'violation' is set to a certain code.
- and the progressbar is replaced with a failedBar which has a refund-button.
- refund will send the stage-specific action, which will selfdestruct the assssessment.
in fetchlatestAssessments, one also checks for cancelAssessment-events, which indicate destructed assessments. those are reconstructed from events by an alternative route and do no longer link to the detail-assessmentView. TROUBLE: all can be reconstructed, except the concept the assessment was in. Right now, i think the way to get this information, will be to retrieve it from local storage. This is not yet implemented, but is layed out in #173 (closed), which has partially been worked on in !198 (merged).
Note: once an assessment was destructed, we decided to no longer offer the detailed assessmentView, even if theoretically, we could get it from local storage.
How to test whether this works
for each stage do:
- switch metamask to another network and back (sometimes old assessments stick around)
- restart ganache
- remigrate contracts
node scripts/incompleteASsessment.js -s create/stake/commit-> this will create an assessment and complete the given stage. the subsequent stage will be done by the first assessor, ubut then failed by all others. it will advance the time of the evm a lot too, so that before another run of it one has to restart ganache to sync it with the forntend.
- check the frontend to see whether the assessment is being displayed approptiately for
- account 1 (assessee)
- acccount 2 (assessor who completed the stage)
- account 3 (assessor who failed)
- do a refund
- redo 4
atm this works for incompleteAssessment -s ...
testing the last stage does not work unless one wants to wait for 12 hours to pass. Reconstructing blocktime via web3 didnt' work either.