kleros / kleros-api-DEPRECATED

A Javascript library that makes it easy to build relayers and other DApps that use the Kleros protocol. DEPRECATED use https://github.com/kleros/archon for interfacing with standard arbitration contracts.
MIT License
21 stars 15 forks source link

Dispute Properties #80

Closed epiqueras closed 6 years ago

epiqueras commented 6 years ago

For sorting (rulings of all appeals + evidence submissions) by date.

I suggest we replace voteCounters and netPNK on disputes with rulings, with shape:

const dispute = {
  // Arbitrable Contract Data
  hash: arbitrableContractAddress, // Not needed
  arbitrableContractAddress,
  arbitrableContractStatus: arbitrableContractData.status,
  arbitratorAddress,
  partyA: arbitrableContractData.partyA,
  partyB: arbitrableContractData.partyB,

  // Dispute Data
  disputeId,
  session: dispute.firstSession + dispute.numberOfAppeals,
  numberOfAppeals: dispute.numberOfAppeals,
  fee: dispute.arbitrationFeePerJuror, // This can be rolled up into an array with `votes` (one item per appeal)
  deadline, // Should show the last date you could vote not the time when the current period ends
  disputeState: dispute.state,
  disputeStatus: dispute.status,
  voteCounters: dispute.voteCounters, // Not needed after `rulings` is implemented

  // Store Data
  description: constractStoreData ? constractStoreData.description : undefined,
  email: constractStoreData ? constractStoreData.email : undefined,
  votes, // This can be rolled up into an array with `fee` (one item per appeal)
  isJuror,
  hasRuled, // Can be replaced with `canVote`
  ruling, // Replaced with `rulings` ({ date, votes }) array (one item per appeal)
  evidence,
  netPNK
}
satello commented 6 years ago

Note: votes and fees per appeal will have to be untrusted. There is no way to retrieve previous votes indices for a juror since the random number (well the rnBlock used to fetch the random number) is not stored for previous sessions. So we can know in a trusted fashion for the current session but all data about past sessions will have to be untrusted and come from the store

epiqueras commented 6 years ago

Closed by #93