Skip to content

Commit

Permalink
feat: add method to update gas limit
Browse files Browse the repository at this point in the history
  • Loading branch information
redlarva committed Oct 30, 2023
1 parent 3dda850 commit a40b45a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contracts/evm/contracts/adapters/wormhole/WormholeAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ contract WormholeAdapter is IAdapter, Initializable, IWormholeReceiver, IConnect
gasLimits[networkId] = gasLimit;

Check warning on line 66 in contracts/evm/contracts/adapters/wormhole/WormholeAdapter.sol

View check run for this annotation

Codecov / codecov/patch

contracts/evm/contracts/adapters/wormhole/WormholeAdapter.sol#L63-L66

Added lines #L63 - L66 were not covered by tests
}

/**
* @notice set or update gas limit for a destination chain.
* @param networkId The network ID of the destination chain.
* @param gasLimit The gas limit for transactions on the destination chain.
*/
function setGasLimit(
string calldata networkId,
uint256 gasLimit
) external override onlyAdmin {
gasLimits[networkId] = gasLimit;

Check warning on line 78 in contracts/evm/contracts/adapters/wormhole/WormholeAdapter.sol

View check run for this annotation

Codecov / codecov/patch

contracts/evm/contracts/adapters/wormhole/WormholeAdapter.sol#L78

Added line #L78 was not covered by tests
}

/**
* @notice Get the gas fee required to send a message to a specified destination network.
* @param _to The network ID of the target chain.
Expand Down
10 changes: 10 additions & 0 deletions contracts/evm/contracts/adapters/wormhole/interfaces/IAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ interface IAdapter {
uint256 gasLimit
) external;

/**
* @notice set or update gas limit for a destination chain.
* @param networkId The network ID of the destination chain.
* @param gasLimit The gas limit for transactions on the destination chain.
*/
function setGasLimit (
string calldata networkId,
uint256 gasLimit
) external;

/**
* @notice Pay and trigger the execution of a stored response to be sent back.
* @param _sn The serial number of the message for which the response is being triggered.
Expand Down

0 comments on commit a40b45a

Please sign in to comment.