Skip to content

Commit f326325

Browse files
committed
feat: added ruling event on the arbitrator side to help with subgraph indexing
1 parent dffe8bf commit f326325

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

contracts/src/arbitration/IArbitrator.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ interface IArbitrator {
2121
*/
2222
event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);
2323

24+
/**
25+
* @dev To be raised when a ruling is given.
26+
* @param _arbitrable The arbitrable receiving the ruling.
27+
* @param _disputeID ID of the dispute in the Arbitrator contract.
28+
* @param _ruling The ruling which was given.
29+
*/
30+
event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);
31+
2432
/**
2533
* @dev Create a dispute. Must be called by the arbitrable contract.
2634
* Must pay at least arbitrationCost(_extraData).

contracts/src/arbitration/KlerosCore.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ contract KlerosCore is IArbitrator {
866866

867867
(uint256 winningChoice, , ) = currentRuling(_disputeID);
868868
dispute.ruled = true;
869+
emit Ruling(dispute.arbitrated, _disputeID, winningChoice);
869870
dispute.arbitrated.rule(_disputeID, winningChoice);
870871
}
871872

0 commit comments

Comments
 (0)