Skip to content

Instantly share code, notes, and snippets.

@ernestognw
Created May 29, 2023 16:21
Show Gist options
  • Save ernestognw/17885a614e18447899b66155fcd35c0a to your computer and use it in GitHub Desktop.
Save ernestognw/17885a614e18447899b66155fcd35c0a to your computer and use it in GitHub Desktop.
// 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