diff --git a/.gitmodules b/.gitmodules index 7c7f536..fe22ebe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,4 +10,5 @@ url = https://github.com/OpenZeppelin/openzeppelin-contracts [submodule "lib/chainlink"] path = lib/chainlink + branch = develop url = https://github.com/smartcontractkit/chainlink diff --git a/lib/chainlink b/lib/chainlink index 6163d14..34dfb21 160000 --- a/lib/chainlink +++ b/lib/chainlink @@ -1 +1 @@ -Subproject commit 6163d1432ad6a6c64db25c82fca941762ad4a29c +Subproject commit 34dfb215f01ec416a50905e8afa7badda5257172 diff --git a/script/DeployDepositAutomation.s.sol b/script/DeployDepositAutomation.s.sol index a883955..cb06b5a 100644 --- a/script/DeployDepositAutomation.s.sol +++ b/script/DeployDepositAutomation.s.sol @@ -21,4 +21,4 @@ contract DeployDepositAutomation is Script, TestData { depositAutomation = new DepositAutomation(dataStore, reader, depositHandler); vm.stopBroadcast(); } -} \ No newline at end of file +} diff --git a/script/DeployMarketAutomation.s.sol b/script/DeployMarketAutomation.s.sol index 6c504bc..aa28cb3 100644 --- a/script/DeployMarketAutomation.s.sol +++ b/script/DeployMarketAutomation.s.sol @@ -21,4 +21,4 @@ contract DeployMarketAutomation is Script, TestData { marketAutomation = new MarketAutomation(dataStore, reader, orderHandler); vm.stopBroadcast(); } -} \ No newline at end of file +} diff --git a/script/DeployWithdrawalAutomation.s.sol b/script/DeployWithdrawalAutomation.s.sol index 93c14cb..f89e3fa 100644 --- a/script/DeployWithdrawalAutomation.s.sol +++ b/script/DeployWithdrawalAutomation.s.sol @@ -21,4 +21,4 @@ contract DeployWithdrawalAutomation is Script, TestData { withdrawalAutomation = new WithdrawalAutomation(dataStore, reader, withdrawalHandler); vm.stopBroadcast(); } -} \ No newline at end of file +} diff --git a/src/DepositAutomation.sol b/src/DepositAutomation.sol index 31af021..41b53cb 100644 --- a/src/DepositAutomation.sol +++ b/src/DepositAutomation.sol @@ -48,7 +48,7 @@ contract DepositAutomation is ILogAutomation, FeedLookupCompatibleInterface, GMX /// @dev Reverts with custom errors if the event name is not equal to the expected event name (DepositCreated). /// @dev In the success case, reverts with FeedLookup error containing relevant information for the feed lookup /// @dev This function is only ever simulated off-chain, so gas is not a concern. - function checkLog(Log calldata log) external returns (bool, bytes memory) { + function checkLog(Log calldata log, bytes memory checkData) external returns (bool, bytes memory) { // Decode Event Log 1 ( , //msgSender, diff --git a/src/MarketAutomation.sol b/src/MarketAutomation.sol index 622e22f..cb8d7a9 100644 --- a/src/MarketAutomation.sol +++ b/src/MarketAutomation.sol @@ -51,7 +51,7 @@ contract MarketAutomation is ILogAutomation, FeedLookupCompatibleInterface, GMXA /// @dev Reverts with custom errors if the event name is not equal to the expected event name (OrderCreated), or if the orderType is not equal to the expected orderType [2,4] /// @dev In the success case, reverts with FeedLookup error containing relevant information for the feed lookup lookup /// @dev This function is only ever simulated off-chain, so gas is not a concern. - function checkLog(Log calldata log) external returns (bool, bytes memory) { + function checkLog(Log calldata log, bytes memory checkData) external returns (bool, bytes memory) { // Decode Event Log 2 ( , //msgSender, diff --git a/src/WithdrawalAutomation.sol b/src/WithdrawalAutomation.sol index 5e9232d..5841fde 100644 --- a/src/WithdrawalAutomation.sol +++ b/src/WithdrawalAutomation.sol @@ -48,7 +48,7 @@ contract WithdrawalAutomation is ILogAutomation, FeedLookupCompatibleInterface, /// @dev Reverts with custom errors if the event name is not equal to the expected event name (WithdrawalCreated). /// @dev In the success case, reverts with FeedLookup error containing relevant information for the feed lookup /// @dev This function is only ever simulated off-chain, so gas is not a concern. - function checkLog(Log calldata log) external returns (bool, bytes memory) { + function checkLog(Log calldata log, bytes memory checkData) external returns (bool, bytes memory) { // Decode Event Log 1 ( , //msgSender, diff --git a/test/DepositAutomation.t.sol b/test/DepositAutomation.t.sol index edc4943..6ea1905 100644 --- a/test/DepositAutomation.t.sol +++ b/test/DepositAutomation.t.sol @@ -79,7 +79,7 @@ contract DepositAutomation_End2End is Test, TestData { abi.encode(KEY, expectedMarketAddresses) ); vm.expectRevert(encodedRevert); - s_depositAutomation.checkLog(s_log); + s_depositAutomation.checkLog(s_log, EMPTY_BYTES); // Off-chain, decode revert and construct callback data bytes[] memory values = new bytes[](2); @@ -167,7 +167,7 @@ contract DepositAutomationTest_checkLog is Test, TestData { abi.encode(KEY, expectedMarketAddresses) ) ); - s_depositAutomation.checkLog(s_log); + s_depositAutomation.checkLog(s_log, EMPTY_BYTES); } function test_checkLog_IncorrectEventName() public { @@ -190,7 +190,7 @@ contract DepositAutomationTest_checkLog is Test, TestData { DepositAutomation.DepositAutomation_IncorrectEventName.selector, incorrectLogName, "DepositCreated" ) ); - s_depositAutomation.checkLog(s_log); + s_depositAutomation.checkLog(s_log, EMPTY_BYTES); } /////////////////////////// @@ -224,7 +224,7 @@ contract DepositAutomationTest_checkLog is Test, TestData { shortTokenSwapPath ); vm.expectRevert(); - s_depositAutomation.checkLog(log); + s_depositAutomation.checkLog(log, EMPTY_BYTES); } } diff --git a/test/MarketAutomation.t.sol b/test/MarketAutomation.t.sol index 9ec6eb5..0f1ab4c 100644 --- a/test/MarketAutomation.t.sol +++ b/test/MarketAutomation.t.sol @@ -79,7 +79,7 @@ contract MarketAutomationTest_End2End is Test, TestData { abi.encode(KEY, expectedMarketAddresses) ); vm.expectRevert(encodedRevert); - s_marketAutomation.checkLog(s_log); + s_marketAutomation.checkLog(s_log, EMPTY_BYTES); // Off-chain, decode revert and construct callback data bytes[] memory values = new bytes[](2); @@ -167,7 +167,7 @@ contract MarketAutomationTest_checkLog is Test, TestData { abi.encode(KEY, expectedMarketAddresses) ) ); - s_marketAutomation.checkLog(s_log); + s_marketAutomation.checkLog(s_log, EMPTY_BYTES); } function test_checkLog_MarketAutomation_IncorrectEventName_reverts() public { @@ -190,7 +190,7 @@ contract MarketAutomationTest_checkLog is Test, TestData { MarketAutomation.MarketAutomation_IncorrectEventName.selector, incorrectLogName, "OrderCreated" ) ); - s_marketAutomation.checkLog(s_log); + s_marketAutomation.checkLog(s_log, EMPTY_BYTES); } function test_checkLog_MarketAutomation_IncorrectOrderType_reverts() public { @@ -208,7 +208,7 @@ contract MarketAutomationTest_checkLog is Test, TestData { swapPath ); vm.expectRevert(abi.encodeWithSelector(MarketAutomation.MarketAutomation_IncorrectOrderType.selector, 5)); - s_marketAutomation.checkLog(s_log); + s_marketAutomation.checkLog(s_log, EMPTY_BYTES); } /////////////////////////// @@ -242,7 +242,7 @@ contract MarketAutomationTest_checkLog is Test, TestData { shortTokenSwapPath ); vm.expectRevert(); - s_marketAutomation.checkLog(log); + s_marketAutomation.checkLog(log, EMPTY_BYTES); } } diff --git a/test/TestData.sol b/test/TestData.sol index 8acb96c..7ebfcb2 100644 --- a/test/TestData.sol +++ b/test/TestData.sol @@ -21,6 +21,8 @@ contract TestData { string internal constant DEPOSIT_HANDLER_LABEL = "DEPOSIT_HANDLER"; string internal constant WITHDRAWAL_HANDLER_LABEL = "WITHDRAWAL_HANDLER"; + bytes internal constant EMPTY_BYTES = ""; + function _generateValidLog( address msgSender, uint256 blockNumber, diff --git a/test/WithdrawalAutomation.t.sol b/test/WithdrawalAutomation.t.sol index 13ec6f4..90e86b6 100644 --- a/test/WithdrawalAutomation.t.sol +++ b/test/WithdrawalAutomation.t.sol @@ -76,7 +76,7 @@ contract WithdrawalAutomation_End2End is Test, TestData { abi.encode(KEY, expectedMarketAddresses) ); vm.expectRevert(encodedRevert); - s_withdrawalAutomation.checkLog(s_log); + s_withdrawalAutomation.checkLog(s_log, EMPTY_BYTES); // Off-chain, decode revert and construct callback data bytes[] memory values = new bytes[](2); @@ -161,7 +161,7 @@ contract WithdrawalAutomationTest_checkLog is Test, TestData { abi.encode(KEY, expectedMarketAddresses) ) ); - s_withdrawalAutomation.checkLog(s_log); + s_withdrawalAutomation.checkLog(s_log, EMPTY_BYTES); } function test_checkLog_IncorrectEventName() public { @@ -186,7 +186,7 @@ contract WithdrawalAutomationTest_checkLog is Test, TestData { "WithdrawalCreated" ) ); - s_withdrawalAutomation.checkLog(s_log); + s_withdrawalAutomation.checkLog(s_log, EMPTY_BYTES); } /////////////////////////// @@ -220,7 +220,7 @@ contract WithdrawalAutomationTest_checkLog is Test, TestData { shortTokenSwapPath ); vm.expectRevert(); - s_withdrawalAutomation.checkLog(log); + s_withdrawalAutomation.checkLog(log, EMPTY_BYTES); } }