Skip to content

Commit

Permalink
Default commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatMe1on committed Dec 10, 2024
1 parent a65ab82 commit fbcc38f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/RaffleTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,15 @@ contract ToolTest is Test {
bytes.concat(bytes("1"), bytes("0"), bytes("0"), bytes("0"))
);
}


//3way to get a function's selector (case1's 'this' can be replace to a instance of a contract);
function testEncoderWithSelector() public pure {
bytes4 output1 = this.testCastMultiFlag.selector;
bytes4 output2 = bytes4(keccak256("testCastMultiFlag()"));
bytes4 output3 = bytes4(abi.encodeWithSignature("testCastMultiFlag()"));

assertEq(output1, output2);
assertEq(output3, output2);
}
}

0 comments on commit fbcc38f

Please sign in to comment.