fast tests

This commit is contained in:
derpy-duck 2023-03-09 23:12:58 +00:00
parent 844a407a3f
commit e56a0521e9
1 changed files with 7 additions and 19 deletions

View File

@ -41,8 +41,7 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
internal
returns (bool forwardIsFunded)
{
DeliveryInstructionsContainer memory container =
decodeDeliveryInstructionsContainer(forwardInstruction.container);
DeliveryInstructionsContainer memory container = decodeDeliveryInstructionsContainer(forwardInstruction.container);
// Add any additional funds which were passed in to the forward as msg.value
transactionFeeRefundAmount = transactionFeeRefundAmount + forwardInstruction.msgValue;
@ -170,28 +169,17 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
status: status
});
payRefunds(
internalInstruction,
relayerRefundAddress,
transactionFeeRefundAmount,
callToTargetContractSucceeded,
forwardingRequest.isValid,
forwardIsFunded
);
payRefunds(internalInstruction, relayerRefundAddress, transactionFeeRefundAmount, callToTargetContractSucceeded, forwardingRequest.isValid, forwardIsFunded);
}
function payRefunds(
DeliveryInstruction memory internalInstruction,
address payable relayerRefundAddress,
uint256 transactionFeeRefundAmount,
bool callToTargetContractSucceeded,
bool forwardingRequestExists,
bool forwardWasFunded
) internal {
function payRefunds(DeliveryInstruction memory internalInstruction, address payable relayerRefundAddress, uint256 transactionFeeRefundAmount, bool callToTargetContractSucceeded, bool forwardingRequestExists, bool forwardWasFunded) internal {
// Amount of receiverValue that is refunded to the user (0 if the call to 'receiveWormholeMessages' did not revert, or the full receiverValue otherwise)
uint256 receiverValueRefundAmount =
(callToTargetContractSucceeded ? 0 : internalInstruction.receiverValueTarget);
// Total refund to the user
uint256 refundToRefundAddress = receiverValueRefundAmount + (forwardWasFunded ? 0 : transactionFeeRefundAmount);