Skip to content

Commit

Permalink
fix: removing optimistic mode guard from send (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xng authored Oct 4, 2023
1 parent f9eeab7 commit 10e7591
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ abstract contract SpokeConnector is Connector, ConnectorManager, WatcherClient,
* @param _encodedData Data needed to send crosschain message by associated amb
*/
function send(bytes memory _encodedData) external payable whenNotPaused rateLimited {
if (optimisticMode) revert SpokeConnector_send__OptimisticModeOn();
bytes32 root = MERKLE.root();
require(sentMessageRoots[root] == false, "root already sent");
// mark as sent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,6 @@ contract SpokeConnector_General is Base {
spokeConnector.send(abi.encode(""));
}

function test_SpokeConnector__send_failsIfOptimisticModeOn() public {
MockSpokeConnector(payable(address(spokeConnector))).setOptimisticMode(true);

vm.expectRevert(SpokeConnector.SpokeConnector_send__OptimisticModeOn.selector);
spokeConnector.send(abi.encode(""));
}

function test_SpokeConnector__send_failsIfRootAlreadySent() public {
bytes32 root = bytes32(bytes("test123"));
vm.mockCall(address(_merkle), abi.encodeWithSelector(MerkleTreeManager.root.selector), abi.encode(root));
Expand Down

0 comments on commit 10e7591

Please sign in to comment.