From 5499d76507d65126d6b0a71482be80da741096ab Mon Sep 17 00:00:00 2001 From: Gas One Cent <86567384+gas1cent@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:42:42 +0400 Subject: [PATCH] refactor: delete `disputeEscalated` --- solidity/contracts/Oracle.sol | 5 +++-- solidity/interfaces/IOracle.sol | 2 +- solidity/interfaces/modules/dispute/IDisputeModule.sol | 6 ------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/solidity/contracts/Oracle.sol b/solidity/contracts/Oracle.sol index f2820b1..4793a3f 100644 --- a/solidity/contracts/Oracle.sol +++ b/solidity/contracts/Oracle.sol @@ -192,13 +192,14 @@ contract Oracle is IOracle { } /// @inheritdoc IOracle - function escalateDispute(Request calldata _request, Dispute calldata _dispute) external { + function escalateDispute(Request calldata _request, Response calldata _response, Dispute calldata _dispute) external { bytes32 _requestId = _getId(_request); bytes32 _disputeId = _getId(_dispute); if (_dispute.requestId != _requestId || disputeOf[_dispute.responseId] != _disputeId) { revert Oracle_InvalidDisputeId(_disputeId); } + if (disputeStatus[_disputeId] != DisputeStatus.Active) { revert Oracle_CannotEscalate(_disputeId); } @@ -207,7 +208,7 @@ contract Oracle is IOracle { disputeStatus[_disputeId] = DisputeStatus.Escalated; // Notify the dispute module about the escalation - IDisputeModule(_request.disputeModule).disputeEscalated(_disputeId, _dispute); + IDisputeModule(_request.disputeModule).onDisputeStatusChange(_disputeId, _request, _response, _dispute); emit DisputeEscalated(msg.sender, _disputeId, block.number); diff --git a/solidity/interfaces/IOracle.sol b/solidity/interfaces/IOracle.sol index bba483e..aaf98bb 100644 --- a/solidity/interfaces/IOracle.sol +++ b/solidity/interfaces/IOracle.sol @@ -337,7 +337,7 @@ interface IOracle { /** * @notice Escalates a dispute, sending it to the resolution module */ - function escalateDispute(Request calldata _request, Dispute calldata _dispute) external; + function escalateDispute(Request calldata _request, Response calldata _response, Dispute calldata _dispute) external; /** * @notice Resolves a dispute diff --git a/solidity/interfaces/modules/dispute/IDisputeModule.sol b/solidity/interfaces/modules/dispute/IDisputeModule.sol index 9f65237..2bcd8d7 100644 --- a/solidity/interfaces/modules/dispute/IDisputeModule.sol +++ b/solidity/interfaces/modules/dispute/IDisputeModule.sol @@ -54,10 +54,4 @@ interface IDisputeModule is IModule { IOracle.Response calldata _response, IOracle.Dispute calldata _dispute ) external; - - /** - * @notice Called by the oracle when a dispute has been escalated. - * @param _disputeId The ID of the dispute being escalated - */ - function disputeEscalated(bytes32 _disputeId, IOracle.Dispute calldata _dispute) external; }