Skip to content

Commit

Permalink
add _buildOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
magj2006 committed Oct 28, 2024
2 parents 8458152 + 5c1bdb2 commit 5d5ca4c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/core/ExocoreGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,21 @@ contract ExocoreGateway is
whenNotPaused
{
bytes memory payload = abi.encodePacked(act, actionArgs);
<<<<<<< HEAD
bytes memory options = _buildOptions(srcChainId, act);
=======
bytes memory options = OptionsBuilder.newOptions();
if (srcChainId == SOLANA_DEVNET_CHAIN_ID || srcChainId == SOLANA_MAINNET_CHAIN_ID) {
if (act == Action.REQUEST_ADD_WHITELIST_TOKEN) {
options = options.addExecutorLzReceiveOption(DESTINATION_GAS_LIMIT, SOLANA_MSG_VALUE);
} else {
options = options.addExecutorLzReceiveOption(DESTINATION_GAS_LIMIT, DESTINATION_MSG_VALUE);
}
} else {
options = options.addExecutorLzReceiveOption(DESTINATION_GAS_LIMIT, DESTINATION_MSG_VALUE)
.addExecutorOrderedExecutionOption();
}
>>>>>>> 5c1bdb2ca0ddf6be46bcb017c516313073d35ae8

MessagingFee memory fee = _quote(srcChainId, payload, options, false);

Expand All @@ -537,8 +551,25 @@ contract ExocoreGateway is

/// @inheritdoc IExocoreGateway
function quote(uint32 srcChainId, bytes calldata _message) public view returns (uint256 nativeFee) {
<<<<<<< HEAD
Action act = Action(uint8(_message[0]));
bytes memory options = _buildOptions(srcChainId, act);
=======
bytes memory options = OptionsBuilder.newOptions();

if (srcChainId == SOLANA_DEVNET_CHAIN_ID || srcChainId == SOLANA_MAINNET_CHAIN_ID) {
Action act = Action(uint8(_message[0]));

if (act == Action.REQUEST_ADD_WHITELIST_TOKEN) {
options = options.addExecutorLzReceiveOption(DESTINATION_GAS_LIMIT, SOLANA_MSG_VALUE);
} else {
options = options.addExecutorLzReceiveOption(DESTINATION_GAS_LIMIT, DESTINATION_MSG_VALUE);
}
} else {
options = options.addExecutorLzReceiveOption(DESTINATION_GAS_LIMIT, DESTINATION_MSG_VALUE)
.addExecutorOrderedExecutionOption();
}
>>>>>>> 5c1bdb2ca0ddf6be46bcb017c516313073d35ae8

MessagingFee memory fee = _quote(srcChainId, _message, options, false);
return fee.nativeFee;
Expand Down

0 comments on commit 5d5ca4c

Please sign in to comment.