Skip to content

Commit

Permalink
test: update unit tests removing _blockNumber param
Browse files Browse the repository at this point in the history
  • Loading branch information
xorsal committed Sep 30, 2024
1 parent 5590bd0 commit 4a90d4c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 30 deletions.
11 changes: 3 additions & 8 deletions solidity/test/unit/modules/dispute/BondEscalationModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ contract BaseTest is Test, Helpers {
bytes32 indexed _requestId, bytes32 indexed _disputeId, IBondEscalationModule.BondEscalationStatus _status
);
event ResponseDisputed(
bytes32 indexed _requestId,
bytes32 indexed _responseId,
bytes32 indexed _disputeId,
IOracle.Dispute _dispute,
uint256 _blockNumber
bytes32 indexed _requestId, bytes32 indexed _responseId, bytes32 indexed _disputeId, IOracle.Dispute _dispute
);
event DisputeStatusChanged(bytes32 indexed _disputeId, IOracle.Dispute _dispute, IOracle.DisputeStatus _status);

Expand Down Expand Up @@ -522,8 +518,7 @@ contract BondEscalationModule_Unit_DisputeResponse is BaseTest {
_requestId: _requestId,
_responseId: _responseId,
_disputeId: _disputeId,
_dispute: mockDispute,
_blockNumber: block.number
_dispute: mockDispute
});

// Check: is the event emitted?
Expand Down Expand Up @@ -578,7 +573,7 @@ contract BondEscalationModule_Unit_DisputeResponse is BaseTest {

// Check: is the event emitted?
vm.expectEmit(true, true, true, true, address(bondEscalationModule));
emit ResponseDisputed(_requestId, _responseId, _disputeId, mockDispute, block.number);
emit ResponseDisputed(_requestId, _responseId, _disputeId, mockDispute);

vm.prank(address(oracle));
bondEscalationModule.disputeResponse(mockRequest, mockResponse, mockDispute);
Expand Down
8 changes: 2 additions & 6 deletions solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ contract BaseTest is Test, Helpers {

event DisputeStatusChanged(bytes32 indexed _disputeId, IOracle.Dispute _dispute, IOracle.DisputeStatus _status);
event ResponseDisputed(
bytes32 indexed _requestId,
bytes32 indexed _responseId,
bytes32 indexed _disputeId,
IOracle.Dispute _dispute,
uint256 _blockNumber
bytes32 indexed _requestId, bytes32 indexed _responseId, bytes32 indexed _disputeId, IOracle.Dispute _dispute
);

/**
Expand Down Expand Up @@ -259,7 +255,7 @@ contract BondedDisputeModule_Unit_DisputeResponse is BaseTest {

// Expect the event
vm.expectEmit(true, true, true, true, address(bondedDisputeModule));
emit ResponseDisputed(_requestId, _getId(mockResponse), _getId(mockDispute), mockDispute, block.timestamp);
emit ResponseDisputed(_requestId, _getId(mockResponse), _getId(mockDispute), mockDispute);

// Test: call disputeResponse
vm.prank(address(oracle));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ contract BaseTest is Test, Helpers {
// Events
event DisputeStatusChanged(bytes32 indexed _disputeId, IOracle.Dispute _dispute, IOracle.DisputeStatus _status);
event ResponseDisputed(
bytes32 indexed _requestId,
bytes32 indexed _responseId,
bytes32 indexed _disputeId,
IOracle.Dispute _dispute,
uint256 _blockNumber
bytes32 indexed _requestId, bytes32 indexed _responseId, bytes32 indexed _disputeId, IOracle.Dispute _dispute
);

/**
Expand Down Expand Up @@ -217,8 +213,7 @@ contract CircuitResolverModule_Unit_DisputeResponse is BaseTest {
_requestId: mockResponse.requestId,
_responseId: mockDispute.responseId,
_disputeId: _getId(mockDispute),
_dispute: mockDispute,
_blockNumber: block.number
_dispute: mockDispute
});

vm.prank(address(oracle));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ contract BaseTest is Test, Helpers {

// Events
event ResponseDisputed(
bytes32 indexed _requestId,
bytes32 indexed _responseId,
bytes32 indexed _disputeId,
IOracle.Dispute _dispute,
uint256 _blockNumber
bytes32 indexed _requestId, bytes32 indexed _responseId, bytes32 indexed _disputeId, IOracle.Dispute _dispute
);

/**
Expand Down Expand Up @@ -266,8 +262,7 @@ contract RootVerificationModule_Unit_DisputeResponse is BaseTest {
_requestId: mockDispute.requestId,
_responseId: mockDispute.responseId,
_disputeId: _getId(mockDispute),
_dispute: mockDispute,
_blockNumber: block.number
_dispute: mockDispute
});

vm.prank(address(oracle));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract BaseTest is Test, Helpers {
uint256 internal _baseDisputeWindow = 12 hours;

// Events
event ResponseProposed(bytes32 indexed _requestId, IOracle.Response _response, uint256 indexed _blockNumber);
event ResponseProposed(bytes32 indexed _requestId, IOracle.Response _response);
event UnutilizedResponseReleased(bytes32 indexed _requestId, bytes32 indexed _responseId);

/**
Expand Down Expand Up @@ -170,7 +170,7 @@ contract BondedResponseModule_Unit_Propose is BaseTest {

// Check: is the event emitted?
vm.expectEmit(true, true, true, true, address(bondedResponseModule));
emit ResponseProposed({_requestId: _requestId, _response: mockResponse, _blockNumber: block.number});
emit ResponseProposed({_requestId: _requestId, _response: mockResponse});

vm.prank(address(oracle));
bondedResponseModule.propose(mockRequest, mockResponse, _proposer);
Expand Down

0 comments on commit 4a90d4c

Please sign in to comment.