Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/comparison/CompareSimpleAccount.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract CompareSimpleAccountTest is Test {

// helper function to compress 2 gas values into a single bytes32
function _encodeGas(uint256 g1, uint256 g2) internal pure returns (bytes32) {
return bytes32(uint256(g1 << 128 + uint128(g2)));
return bytes32(uint256((g1 << 128) + uint128(g2)));
}

function setUp() public {
Expand Down
20 changes: 16 additions & 4 deletions test/plugin/TokenReceiverPlugin.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,24 @@ contract TokenReceiverPluginTest is OptimizedTest, IERC1155Receiver {
}

function test_failERC1155Transfer() public {
// for 1155, reverts are caught in a try catch and bubbled up with a diff reason
vm.expectRevert("ERC1155: transfer to non-ERC1155Receiver implementer");
// for 1155, reverts are caught in a try catch and bubbled up with the reason from the account
vm.expectRevert(
abi.encodePacked(
UpgradeableModularAccount.UnrecognizedFunction.selector,
IERC1155Receiver.onERC1155Received.selector,
bytes28(0)
)
);
t1.safeTransferFrom(address(this), address(acct), _TOKEN_ID, _TOKEN_AMOUNT, "");

// for 1155, reverts are caught in a try catch and bubbled up with a diff reason
vm.expectRevert("ERC1155: transfer to non-ERC1155Receiver implementer");
// for 1155, reverts are caught in a try catch and bubbled up with the reason from the account
vm.expectRevert(
abi.encodePacked(
UpgradeableModularAccount.UnrecognizedFunction.selector,
IERC1155Receiver.onERC1155BatchReceived.selector,
bytes28(0)
)
);
t1.safeBatchTransferFrom(address(this), address(acct), tokenIds, tokenAmts, "");
}

Expand Down
2 changes: 1 addition & 1 deletion test/utils/AccountTestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ abstract contract AccountTestBase is OptimizedTest {

// helper function to compress 2 gas values into a single bytes32
function _encodeGas(uint256 g1, uint256 g2) internal pure returns (bytes32) {
return bytes32(uint256(g1 << 128 + uint128(g2)));
return bytes32(uint256((g1 << 128) + uint128(g2)));
}
}