@@ -84,14 +84,14 @@ abstract contract ManagerBase is
84
84
}
85
85
}
86
86
87
- // =============== External Logic == ===========================================================
87
+ // =============== Internal Logic ===========================================================
88
88
89
- /// @inheritdoc IManagerBase
90
- function quoteDeliveryPrice (
89
+ function _quoteDeliveryPrice (
91
90
uint16 recipientChain ,
92
91
TransceiverStructs.TransceiverInstruction[] memory transceiverInstructions ,
93
- address [] memory enabledTransceivers
94
- ) public view returns (uint256 [] memory , uint256 ) {
92
+ address [] memory enabledTransceivers ,
93
+ uint256 managerExecutionCost
94
+ ) internal view returns (uint256 [] memory , uint256 ) {
95
95
uint256 numEnabledTransceivers = enabledTransceivers.length ;
96
96
mapping (address => TransceiverInfo) storage transceiverInfos = _getTransceiverInfosStorage ();
97
97
@@ -101,16 +101,14 @@ abstract contract ManagerBase is
101
101
address transceiverAddr = enabledTransceivers[i];
102
102
uint8 registeredTransceiverIndex = transceiverInfos[transceiverAddr].index;
103
103
uint256 transceiverPriceQuote = ITransceiver (transceiverAddr).quoteDeliveryPrice (
104
- recipientChain, transceiverInstructions[registeredTransceiverIndex]
104
+ recipientChain, transceiverInstructions[registeredTransceiverIndex], managerExecutionCost
105
105
);
106
106
priceQuotes[i] = transceiverPriceQuote;
107
107
totalPriceQuote += transceiverPriceQuote;
108
108
}
109
109
return (priceQuotes, totalPriceQuote);
110
110
}
111
111
112
- // =============== Internal Logic ===========================================================
113
-
114
112
function _recordTransceiverAttestation (
115
113
uint16 sourceChainId ,
116
114
TransceiverStructs.ManagerMessage memory payload
@@ -160,6 +158,7 @@ abstract contract ManagerBase is
160
158
uint16 recipientChain ,
161
159
bytes32 peerAddress ,
162
160
uint256 [] memory priceQuotes ,
161
+ uint256 managerExecutionCost ,
163
162
TransceiverStructs.TransceiverInstruction[] memory transceiverInstructions ,
164
163
address [] memory enabledTransceivers ,
165
164
bytes memory ManagerMessage
@@ -179,14 +178,16 @@ abstract contract ManagerBase is
179
178
recipientChain,
180
179
transceiverInstructions[transceiverInfos[transceiverAddr].index],
181
180
ManagerMessage,
182
- peerAddress
181
+ peerAddress,
182
+ managerExecutionCost
183
183
);
184
184
}
185
185
}
186
186
187
187
function _prepareForTransfer (
188
188
uint16 recipientChain ,
189
- bytes memory transceiverInstructions
189
+ bytes memory transceiverInstructions ,
190
+ uint256 managerExecutionCost
190
191
)
191
192
internal
192
193
returns (
@@ -214,7 +215,7 @@ abstract contract ManagerBase is
214
215
}
215
216
216
217
(uint256 [] memory priceQuotes , uint256 totalPriceQuote ) =
217
- quoteDeliveryPrice (recipientChain, instructions, enabledTransceivers);
218
+ _quoteDeliveryPrice (recipientChain, instructions, enabledTransceivers, managerExecutionCost );
218
219
{
219
220
// check up front that msg.value will cover the delivery price
220
221
if (msg .value < totalPriceQuote) {
0 commit comments