-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit tests for Router contract
- Loading branch information
1 parent
8103f1e
commit f05b99f
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pragma solidity ^0.8.20; | ||
|
||
import "truffle/Assert.sol"; | ||
import "truffle/DeployedAddresses.sol"; | ||
import "../contracts/Router.sol"; | ||
import "../contracts/lib/MultiSendCallOnly.sol"; | ||
|
||
contract RouterTest { | ||
Router router = Router(DeployedAddresses.Router()); | ||
|
||
function testOwnerCanCall() public { | ||
bool r = router.updatePluginLogic(DeployedAddresses.Router()); | ||
Assert.equal(r, true, "Owner should be able to call"); | ||
} | ||
|
||
function testNonOwnerCannotCall() public { | ||
(bool r, ) = address(router).call(abi.encodePacked(router.updatePluginLogic.selector, DeployedAddresses.Router())); | ||
Assert.equal(r, false, "Non-owner should not be able to call"); | ||
} | ||
|
||
function testMultiSendWithLargeTransactionBundles() public { | ||
bytes memory transactions = new bytes(10000); | ||
bool r = router.multiSend(transactions); | ||
Assert.equal(r, true, "Should be able to handle large transaction bundles"); | ||
} | ||
} | ||
|