Skip to content

Commit

Permalink
respond to PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RnkSngh committed Apr 23, 2024
1 parent 89ddc8d commit 486d3e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/core/Dispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ contract Dispatcher is OwnableUpgradeable, UUPSUpgradeable, IDispatcher {
// call
// and x/64 for the remaining execution after the low-level call. If this low-level call runs out of gas, then
// gasLeft will be equal to x/64 at the start of the remaining execution. so we should check gasBefore < 1/64
if (!success && gasleft() < gasBeforeCall / 64) {
if (!success && gasleft() <= gasBeforeCall / 64) {
// Only check for out of gas if the call failed; if it was a successful call then it was gauranteed to not
// run out of gas
revert IBCErrors.notEnoughGas();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Base} from "./Dispatcher.Base.t.sol";
import {Base} from "./Dispatcher.base.t.sol";
import {GasUsingMars} from "./mocks/GasUsingMars.sol";
import {IbcEndpoint, ChannelEnd, IbcUtils, IbcPacket, IBCErrors} from "../contracts/libs/Ibc.sol";
import {TestUtilsTest} from "./TestUtils.t.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/GasUsingMars.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract GasUsingMars is Mars {
return AckPacket(true, abi.encodePacked('{ "account": "account", "reply": "got the message" }'));
}

function _useGas() internal {
function _useGas() internal view {
// This function is used to test the gas usage of the contract
uint256 startingGas = gasleft();
uint256 dummyInt = 0;
Expand Down

0 comments on commit 486d3e7

Please sign in to comment.