Skip to content

Commit 9c34a84

Browse files
committed
evm: Readd some public views that might be useful
1 parent c1230f9 commit 9c34a84

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

evm/src/Manager.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,14 @@ contract Manager is
262262
recipientChain,
263263
endpointInstructions[registeredEndpointIndex],
264264
managerMessage,
265-
_getSibling(recipientChain)
265+
getSibling(recipientChain)
266266
);
267267
}
268268
}
269269

270270
function isMessageApproved(bytes32 digest) public view returns (bool) {
271271
uint8 threshold = getThreshold();
272-
return _messageAttestations(digest) >= threshold && threshold > 0;
272+
return messageAttestations(digest) >= threshold && threshold > 0;
273273
}
274274

275275
function _setEndpointAttestedToMessage(bytes32 digest, uint8 index) internal {
@@ -562,7 +562,7 @@ contract Manager is
562562

563563
/// @dev Verify that the sibling address saved for `sourceChainId` matches the `siblingAddress`.
564564
function _verifySibling(uint16 sourceChainId, bytes32 siblingAddress) internal view {
565-
if (_getSibling(sourceChainId) != siblingAddress) {
565+
if (getSibling(sourceChainId) != siblingAddress) {
566566
revert InvalidSibling(sourceChainId, siblingAddress);
567567
}
568568
}
@@ -702,7 +702,7 @@ contract Manager is
702702
return _getMessageAttestationsStorage()[digest].executed;
703703
}
704704

705-
function _getSibling(uint16 chainId_) internal view returns (bytes32) {
705+
function getSibling(uint16 chainId_) public view returns (bytes32) {
706706
return _getSiblingsStorage()[chainId_];
707707
}
708708

@@ -755,7 +755,7 @@ contract Manager is
755755
}
756756

757757
// @dev Count the number of attestations from enabled endpoints for a given message.
758-
function _messageAttestations(bytes32 digest) internal view returns (uint8 count) {
758+
function messageAttestations(bytes32 digest) public view returns (uint8 count) {
759759
return countSetBits(_getMessageAttestations(digest));
760760
}
761761

evm/src/interfaces/IManager.sol

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ interface IManager {
6161
bytes memory encodedInstructions
6262
) external payable returns (uint64 msgId);
6363

64+
function getSibling(uint16 chainId_) external view returns (bytes32);
65+
6466
function setSibling(uint16 siblingChainId, bytes32 siblingContract) external;
6567

6668
/// @notice Check if a message has been approved. The message should have at least

evm/test/mocks/MockManager.sol

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ contract MockManagerContract is Manager {
2424
}
2525
}
2626

27-
function messageAttestations(bytes32 digest) public view returns (uint8 count) {
28-
return _messageAttestations(digest);
29-
}
30-
3127
function getOutboundLimitParams() public pure returns (RateLimitParams memory) {
3228
return _getOutboundLimitParams();
3329
}

0 commit comments

Comments
 (0)