diff --git a/contracts/src/arbitration/IArbitrator.sol b/contracts/src/arbitration/IArbitrator.sol index 6d4e3953a..cc8abd1d9 100644 --- a/contracts/src/arbitration/IArbitrator.sol +++ b/contracts/src/arbitration/IArbitrator.sol @@ -21,6 +21,14 @@ interface IArbitrator { */ event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable); + /** + * @dev To be raised when a ruling is given. + * @param _arbitrable The arbitrable receiving the ruling. + * @param _disputeID ID of the dispute in the Arbitrator contract. + * @param _ruling The ruling which was given. + */ + event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); + /** * @dev Create a dispute. Must be called by the arbitrable contract. * Must pay at least arbitrationCost(_extraData). diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 747235db4..e62f7d1c7 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -866,6 +866,7 @@ contract KlerosCore is IArbitrator { (uint256 winningChoice, , ) = currentRuling(_disputeID); dispute.ruled = true; + emit Ruling(dispute.arbitrated, _disputeID, winningChoice); dispute.arbitrated.rule(_disputeID, winningChoice); } diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index a36bf95ee..e609beedf 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -65,7 +65,7 @@ describe("Integration tests", async () => { homeGateway = (await ethers.getContract("HomeGatewayToEthereum")) as HomeGatewayToEthereum; }); - it("Honest Claim - No Challenge - Bridger paid", async () => { + it("Resolves a dispute on the home chain with no appeal", async () => { const arbitrationCost = ONE_TENTH_ETH.mul(3); const [bridger, challenger, relayer] = await ethers.getSigners(); @@ -170,7 +170,8 @@ describe("Integration tests", async () => { const tx4 = await core.executeRuling(0); console.log("Ruling executed on KlerosCore"); - expect(tx4).to.emit(arbitrable, "Ruling").withArgs(foreignGateway.address, 1, 0); + expect(tx4).to.emit(core, "Ruling").withArgs(homeGateway.address, 0, 0); + expect(tx4).to.emit(arbitrable, "Ruling").withArgs(foreignGateway.address, 1, 0); // The ForeignGateway starts counting disputeID from 1. }); async function mineBlocks(n) {