Skip to content

Commit

Permalink
feat: add dispute
Browse files Browse the repository at this point in the history
  • Loading branch information
ashitakah committed Oct 2, 2024
1 parent 4d28a0e commit 4647d9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion solidity/contracts/Oracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ contract Oracle is IOracle {
// Notify the dispute module about the escalation
IDisputeModule(_request.disputeModule).onDisputeStatusChange(_disputeId, _request, _response, _dispute);

emit DisputeEscalated(msg.sender, _disputeId);
emit DisputeEscalated(msg.sender, _disputeId, _dispute);

if (address(_request.resolutionModule) != address(0)) {
// Initiate the resolution
Expand Down
3 changes: 2 additions & 1 deletion solidity/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ interface IOracle {
* @notice Emitted when a dispute is escalated
* @param _caller The address of the user who escalated the dispute
* @param _disputeId The id of the dispute being escalated
* @param _dispute The dispute that is being escalated
*/
event DisputeEscalated(address indexed _caller, bytes32 indexed _disputeId);
event DisputeEscalated(address indexed _caller, bytes32 indexed _disputeId, Dispute _dispute);

/**
* @notice Emitted when a dispute's status changes
Expand Down
6 changes: 3 additions & 3 deletions solidity/test/unit/Oracle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ contract BaseTest is Test, Helpers {
event ResponseProposed(bytes32 indexed _requestId, bytes32 indexed _responseId, IOracle.Response _response);
event ResponseDisputed(bytes32 indexed _responseId, bytes32 indexed _disputeId, IOracle.Dispute _dispute);
event OracleRequestFinalized(bytes32 indexed _requestId, bytes32 indexed _responseId, address indexed _caller);
event DisputeEscalated(address indexed _caller, bytes32 indexed _disputeId);
event DisputeEscalated(address indexed _caller, bytes32 indexed _disputeId, IOracle.Dispute _dispute);
event DisputeStatusUpdated(bytes32 indexed _disputeId, IOracle.Dispute _dispute, IOracle.DisputeStatus _status);
event DisputeResolved(bytes32 indexed _disputeId, IOracle.Dispute _dispute, address indexed _caller);

Expand Down Expand Up @@ -1170,7 +1170,7 @@ contract Oracle_Unit_EscalateDispute is BaseTest {

// Expect dispute escalated event
_expectEmit(address(oracle));
emit DisputeEscalated(address(this), _disputeId);
emit DisputeEscalated(address(this), _disputeId, mockDispute);

// Test: escalate the dispute
oracle.escalateDispute(mockRequest, mockResponse, mockDispute);
Expand Down Expand Up @@ -1209,7 +1209,7 @@ contract Oracle_Unit_EscalateDispute is BaseTest {

// Expect dispute escalated event
_expectEmit(address(oracle));
emit DisputeEscalated(address(this), _disputeId);
emit DisputeEscalated(address(this), _disputeId, mockDispute);

// Test: escalate the dispute
oracle.escalateDispute(mockRequest, mockResponse, mockDispute);
Expand Down

0 comments on commit 4647d9b

Please sign in to comment.