Skip to content

deal with timedOut Assessments & refund

dju requested to merge burnburnburn into master

Feature Merge Request

implements the wireframes laid out in #292 (closed)

description

  • 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:

  1. switch metamask to another network and back (sometimes old assessments stick around)
  2. restart ganache
  3. remigrate contracts
  4. run 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.
  5. 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)
  6. do a refund
  7. redo 4

current state

atm this works for incompleteAssessment -s ...

  • create
  • stake
  • commit

testing the last stage does not work unless one wants to wait for 12 hours to pass. Reconstructing blocktime via web3 didnt' work either.

Related Issue

closes #177 (closed) #198 (closed) #293 (closed) #281 (closed)

Description of Feature


Edited by dju

Merge request reports