Remove wormhole message fee from calculateTargetGasDeliveryAmount (#41)

This commit is contained in:
derpy-duck 2023-01-13 15:26:04 -05:00 committed by GitHub
parent 034a7dd831
commit 53d67259f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -600,10 +600,10 @@ contract CoreRelayer is CoreRelayerGovernance {
returns (uint32 gasAmount)
{
IWormhole wormhole = wormhole();
if (computeBudget <= wormhole.messageFee() + provider.quoteDeliveryOverhead(targetChain)) {
if (computeBudget <= provider.quoteDeliveryOverhead(targetChain)) {
return 0;
} else {
uint256 remainder = computeBudget - wormhole.messageFee() - provider.quoteDeliveryOverhead(targetChain);
uint256 remainder = computeBudget - provider.quoteDeliveryOverhead(targetChain);
uint256 gas = remainder / provider.quoteGasPrice(targetChain);
if (gas >= 2 ** 32) return uint32(2 ** 32 - 1);