@@ -116,11 +116,10 @@ abstract contract Manager is
116
116
117
117
/// @dev This will either cross-call or internal call, depending on whether the contract is standalone or not.
118
118
/// This method should return an array of delivery prices corresponding to each endpoint.
119
- function quoteDeliveryPrice (uint16 recipientChain )
120
- public
121
- view
122
- virtual
123
- returns (uint256 [] memory );
119
+ function quoteDeliveryPrice (
120
+ uint16 recipientChain ,
121
+ EndpointStructs.EndpointInstruction[] memory endpointInstructions
122
+ ) public view virtual returns (uint256 [] memory );
124
123
125
124
/// @dev This will either cross-call or internal call, depending on whether the contract is standalone or not.
126
125
function _sendMessageToEndpoints (
@@ -384,7 +383,11 @@ abstract contract Manager is
384
383
address sender ,
385
384
bytes memory endpointInstructions
386
385
) internal returns (uint64 msgSequence ) {
387
- uint256 [] memory priceQuotes = quoteDeliveryPrice (recipientChain);
386
+ // parse and reorganize the endpoint instructions based on index
387
+ EndpointStructs.EndpointInstruction[] memory sortedInstructions = EndpointStructs
388
+ .sortEndpointInstructions (EndpointStructs.parseEndpointInstructions (endpointInstructions));
389
+
390
+ uint256 [] memory priceQuotes = quoteDeliveryPrice (recipientChain, sortedInstructions);
388
391
{
389
392
// check up front that msg.value will cover the delivery price
390
393
uint256 totalPriceQuote = arraySum (priceQuotes);
@@ -412,10 +415,6 @@ abstract contract Manager is
412
415
)
413
416
);
414
417
415
- // parse and reorganize the endpoint instructions based on index
416
- EndpointStructs.EndpointInstruction[] memory sortedInstructions = EndpointStructs
417
- .sortEndpointInstructions (EndpointStructs.parseEndpointInstructions (endpointInstructions));
418
-
419
418
// send the message
420
419
_sendMessageToEndpoints (
421
420
recipientChain, priceQuotes, sortedInstructions, encodedManagerPayload
0 commit comments