Skip to content

Commit

Permalink
test for error 68
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangparikh22 committed Mar 9, 2022
1 parent b31675a commit 92037bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions contracts/mocks/MulticallMock.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >= 0.8.0;
pragma solidity >=0.8.0;

import "../abstract/Multicall.sol";

Expand All @@ -9,6 +9,10 @@ contract MulticallMock is Multicall {
revert(error);
}

function functionThatRevertsWithoutError() external pure {
revert();
}

struct Tuple {
uint256 a;
uint256 b;
Expand All @@ -27,4 +31,4 @@ contract MulticallMock is Multicall {
function returnSender() external view returns (address) {
return msg.sender;
}
}
}
3 changes: 2 additions & 1 deletion test/abstract/Multicall.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe("Multicall", async () => {
});

it("revert when result is less than 68", async () => {
await expect(multicall.multicall(["functionThatRevertsWithoutError"])).to.be.reverted;
await expect(multicall.multicall([multicall.interface.encodeFunctionData("functionThatRevertsWithoutError")])).to.be
.reverted;
});

it("return data is properly encoded", async () => {
Expand Down

0 comments on commit 92037bd

Please sign in to comment.