Skip to content

Commit

Permalink
fix(multiplearbitrablepayment): use transactionId instead disputeId
Browse files Browse the repository at this point in the history
  • Loading branch information
n1c01a5 committed Oct 16, 2018
1 parent 4fc2a63 commit 6f92ed7
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions contracts/standard/arbitration/MultipleArbitrableTransaction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ contract MultipleArbitrableTransaction {

emit Ruling(transactionId, Arbitrator(msg.sender), _disputeID, _ruling);

executeRuling(_disputeID, _ruling);
executeRuling(transactionId, _ruling);
}

/** @dev Pay the arbitration fee to raise a dispute. To be called by the seller. UNTRUSTED.
Expand Down Expand Up @@ -192,7 +192,7 @@ contract MultipleArbitrableTransaction {
require(transaction.status == Status.WaitingBuyer, "The transaction is not waiting on the buyer.");
require(now >= transaction.lastInteraction + transaction.timeout, "Timeout time has not passed yet.");

executeRuling(transaction.disputeId, SELLER_WINS);
executeRuling(_transactionId, SELLER_WINS);
}

/** @dev Pay partyB if partyA fails to pay the fee.
Expand All @@ -206,7 +206,7 @@ contract MultipleArbitrableTransaction {
require(transaction.status == Status.WaitingSeller, "The transaction is not waiting on the seller.");
require(now >= transaction.lastInteraction + transaction.timeout, "Timeout time has not passed yet.");

executeRuling(transaction.disputeId, BUYER_WINS);
executeRuling(_transactionId, BUYER_WINS);
}

/** @dev Submit a reference to evidence. EVENT.
Expand Down Expand Up @@ -309,14 +309,11 @@ contract MultipleArbitrableTransaction {

/** @dev Execute a ruling of a dispute. It reimburse the fee to the winning party.
* This need to be extended by contract inheriting from it.
* @param _disputeID ID of the dispute in the Arbitrator contract.
* @param _transactionId The index of the transaction.
* @param _ruling Ruling given by the arbitrator. 1 : Reimburse the partyA. 2 : Pay the partyB.
*/
function executeRuling(uint _disputeID, uint _ruling) internal {
uint transactionId = disputeTxMap[keccak256(msg.sender, _disputeID)];
Transaction storage transaction = transactions[transactionId];

require(_disputeID == transaction.disputeId, "Wrong dispute ID.");
function executeRuling(uint _transactionId, uint _ruling) internal {
Transaction storage transaction = transactions[_transactionId];
require(_ruling <= AMOUNT_OF_CHOICES, "Invalid ruling.");

// Give the arbitration fee back.
Expand Down

0 comments on commit 6f92ed7

Please sign in to comment.