Skip to content

Commit

Permalink
test: actually mock the callback to revert
Browse files Browse the repository at this point in the history
  • Loading branch information
xorsal committed Oct 9, 2024
1 parent 900a06c commit bc2db59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions solidity/test/unit/modules/finality/CallbackModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ contract CallbackModule_Unit_FinalizeRequest is BaseTest {
mockRequest.finalityModuleData = abi.encode(ICallbackModule.RequestParameters({target: _target, data: _data}));
mockResponse.requestId = _getId(mockRequest);

// Mock and expect the callback
_mockAndExpect(_target, abi.encodeWithSelector(IProphetCallback.prophetCallback.selector, _data), abi.encode(''));
// Mock revert and expect the callback
vm.mockCallRevert(
_target, abi.encodeWithSelector(IProphetCallback.prophetCallback.selector, _data), abi.encode('err')
);
vm.expectCall(_target, abi.encodeWithSelector(IProphetCallback.prophetCallback.selector, _data));

vm.prank(address(oracle));
callbackModule.finalizeRequest(mockRequest, mockResponse, _proposer);
Expand Down

0 comments on commit bc2db59

Please sign in to comment.