From 4a90d4ce0441cfefcd4b0a5648798c47a626ea61 Mon Sep 17 00:00:00 2001 From: zorzal Date: Mon, 30 Sep 2024 15:03:16 -0400 Subject: [PATCH] test: update unit tests removing _blockNumber param --- .../unit/modules/dispute/BondEscalationModule.t.sol | 11 +++-------- .../unit/modules/dispute/BondedDisputeModule.t.sol | 8 ++------ .../unit/modules/dispute/CircuitResolverModule.t.sol | 9 ++------- .../unit/modules/dispute/RootVerificationModule.t.sol | 9 ++------- .../unit/modules/response/BondedResponseModule.t.sol | 4 ++-- 5 files changed, 11 insertions(+), 30 deletions(-) diff --git a/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol b/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol index 35604a8b..31f18815 100644 --- a/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol +++ b/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol @@ -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); @@ -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? @@ -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); diff --git a/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol b/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol index e74e738f..4066ac4f 100644 --- a/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol +++ b/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol @@ -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 ); /** @@ -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)); diff --git a/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol b/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol index f2ffb6c3..7d071dfd 100644 --- a/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol +++ b/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol @@ -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 ); /** @@ -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)); diff --git a/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol b/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol index f19d0ce1..bf74e3bb 100644 --- a/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol +++ b/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol @@ -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 ); /** @@ -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)); diff --git a/solidity/test/unit/modules/response/BondedResponseModule.t.sol b/solidity/test/unit/modules/response/BondedResponseModule.t.sol index 11b3a355..322e8207 100644 --- a/solidity/test/unit/modules/response/BondedResponseModule.t.sol +++ b/solidity/test/unit/modules/response/BondedResponseModule.t.sol @@ -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); /** @@ -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);