From bc2db5996e94747df50a49d160f9ed6fe5d70603 Mon Sep 17 00:00:00 2001 From: zorzal Date: Wed, 9 Oct 2024 10:16:09 -0400 Subject: [PATCH] test: actually mock the callback to revert --- solidity/test/unit/modules/finality/CallbackModule.t.sol | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/solidity/test/unit/modules/finality/CallbackModule.t.sol b/solidity/test/unit/modules/finality/CallbackModule.t.sol index f9aa6cae..d8880334 100644 --- a/solidity/test/unit/modules/finality/CallbackModule.t.sol +++ b/solidity/test/unit/modules/finality/CallbackModule.t.sol @@ -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);