Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Issue #10 - feat:dispute #18

Merged
merged 6 commits into from
Mar 20, 2018
Merged

Issue #10 - feat:dispute #18

merged 6 commits into from
Mar 20, 2018

Conversation

Thoughtscript
Copy link
Contributor

@Thoughtscript Thoughtscript commented Mar 14, 2018

Hides buttons when zero fees - displays "No contractual fees remain".

For issue: #10

@Thoughtscript Thoughtscript changed the title Feat/dispute feat:dispute Mar 14, 2018
@Thoughtscript
Copy link
Contributor Author

example

@Thoughtscript Thoughtscript changed the title feat:dispute Issue #10 - feat:dispute Mar 14, 2018
@n1c01a5
Copy link
Contributor

n1c01a5 commented Mar 15, 2018

@Thoughtscript we can hide the buttons only if the contract is finished:

  • either partyA pays partyB
  • or the dispute is terminated after the appeals

I don't sure if this code follow this workflow
I think we can check if the contract balance is zero or maybe to change the API to have a feedback on the contract status.

@n1c01a5 n1c01a5 self-requested a review March 16, 2018 00:50
@n1c01a5
Copy link
Contributor

n1c01a5 commented Mar 16, 2018

for info the fees are necessary to create a dispute, they are the arbitration fees

@n1c01a5
Copy link
Contributor

n1c01a5 commented Mar 16, 2018

@Thoughtscript in your example I don't understand how a party can create a dispute

@Thoughtscript
Copy link
Contributor Author

@n1c01a5 - Thank you for clarifying the dispute creation flow - I'll modify that and then resubmit!

@Thoughtscript
Copy link
Contributor Author

Thoughtscript commented Mar 17, 2018

@n1c01a5 - reviewed: https://github.com/kleros/kleros-api/blob/develop/src/constants/contract.js - switching check to: contract.data.status === 4 || contract.data.amount.e === 0 - it will display the previously submitted text only if the status of the contract is resolved.

Thoughtscript and others added 3 commits March 16, 2018 21:46
Per: https://github.com/kleros/kleros-api/blob/develop/src/constants/contract.js - I believe the check should block display of dispute button only if the status is `4` or contract `resolved`.
Support for contract amount
@@ -132,9 +138,10 @@ class Contract extends PureComponent {
<div className="description Contract-content-item">{contract.data.description}</div>
{contract.data.status !== 4 && !contract.data.partyAFee && !contract.data.partyBFee ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to create a const DISPUTE_RESOLVED = 4 instead 4

<div style={this.hideEmptyContractEl(contract)} className="Contract-content-actions-button Contract-actions-button-left" onClick={this.createDispute}>Create dispute</div>
{contract.data.partyA === accounts.data[0] && <div style={this.hideEmptyContractEl(contract)} className="Contract-content-actions-button Contract-content-actions-button-right" onClick={this.createPay}>Pay</div>}
{contract.data.partyB === accounts.data[0] && <div style={this.hideEmptyContractEl(contract)} className="Contract-content-actions-button Contract-content-actions-button-right" onClick={this.createReimburse}>Reimburse</div>}
{this.showEmptyContractEl(contract) && <div className="Contract-content-item">No contractual fees remain</div>}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the message is more "The contract has ended".
Ideally it would be good to have the contract status as:

  • Bob pays Alice
  • Bob refunds Alice
  • Bob wins the dispute
  • Bob made a timeout

@n1c01a5 n1c01a5 merged commit 3dcbe46 into kleros:develop Mar 20, 2018
@Thoughtscript Thoughtscript deleted the feat/dispute branch March 26, 2018 08:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants