Created
May 29, 2023 16:21
-
-
Save ernestognw/17885a614e18447899b66155fcd35c0a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity ^0.8.13; | |
import "forge-std/Test.sol"; | |
contract ErrorTest32 is Test { | |
error Test32(bytes32 foo, bytes32 bar); | |
bytes32 foo32 = bytes32(uint256(10)); | |
bytes32 bar32 = bytes32(uint256(20)); | |
function test_32() public { | |
vm.expectRevert(); | |
revert Test32(foo32, bar32); | |
} | |
} | |
contract ErrorTest8 is Test { | |
error Test8(bytes8 foo, bytes8 bar); | |
bytes8 foo8 = bytes8(uint64(10)); | |
bytes24 gap = bytes24(uint192(0)); | |
bytes8 bar8 = bytes8(uint64(20)); | |
function test_8() public { | |
vm.expectRevert(); | |
revert Test8(foo8, bar8); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment