Skip to content

Commit

Permalink
fix: feedback from doc
Browse files Browse the repository at this point in the history
  • Loading branch information
0xteddybear committed Aug 29, 2024
1 parent 86d61de commit 71d9c01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ contract MockL2ToL2CrossDomainMessenger {
CrossChainMessage[] private _messageQueue;
bool private _atomic;

function messageQueue(uint256 index) external view returns (CrossChainMessage memory) {
return _messageQueue[index];
function messageQueue(uint256 rawIndex) external view returns (CrossChainMessage memory) {
return _messageQueue[rawIndex % _messageQueue.length];
}

function crossChainMessageReceiver(
Expand Down Expand Up @@ -63,7 +63,8 @@ contract MockL2ToL2CrossDomainMessenger {
_atomic = atomic;
}

function relayMessageFromQueue(uint256 index) public {
function relayMessageFromQueue(uint256 rawIndex) public {
uint256 index = rawIndex % _messageQueue.length;
CrossChainMessage memory message = _messageQueue[index];
_messageQueue[index] = _messageQueue[_messageQueue.length - 1];
_messageQueue.pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ contract ProtocolGuided is ProtocolHandler {
/// @custom:property-id 7
/// @custom:property calls to relayERC20 always succeed as long as the cross-domain caller is valid
function fuzz_RelayERC20(uint256 messageIndex) external {
uint256 queueLength = MESSENGER.messageQueueLength();
messageIndex = bound(messageIndex, 0, queueLength - 1);
MockL2ToL2CrossDomainMessenger.CrossChainMessage memory messageToRelay = MESSENGER.messageQueue(messageIndex);
OptimismSuperchainERC20 destinationToken = OptimismSuperchainERC20(messageToRelay.crossDomainMessageSender);
uint256 destinationSupplyBefore = destinationToken.totalSupply();
Expand Down

0 comments on commit 71d9c01

Please sign in to comment.