-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(randomBytes): adding support to generate different bytes via Rng…
…Core (#8996) * feat(randomBytes): adding support to generate different bytes via RngCore Signed-off-by: Abhishekkochar <[email protected]> * Added needed changes to util file Signed-off-by: Abhishekkochar <[email protected]> * Added support to get random 4 and 8 bytes Signed-off-by: Abhishekkochar <[email protected]> * Refractor code to suggested changes Signed-off-by: Abhishekkochar <[email protected]> * Fixed import with B32 Signed-off-by: Abhishekkochar <[email protected]> * updated cheatcodes.json file Signed-off-by: Abhishekkochar <[email protected]> * docs --------- Signed-off-by: Abhishekkochar <[email protected]> Co-authored-by: DaniPopes <[email protected]>
- Loading branch information
1 parent
df2e91b
commit d4649bf
Showing
5 changed files
with
97 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity 0.8.18; | ||
|
||
import "ds-test/test.sol"; | ||
import "cheats/Vm.sol"; | ||
|
||
contract RandomBytes is DSTest { | ||
Vm constant vm = Vm(HEVM_ADDRESS); | ||
|
||
function testRandomBytes4() public { | ||
vm.randomBytes4(); | ||
} | ||
|
||
function testRandomBytes8() public { | ||
vm.randomBytes8(); | ||
} | ||
|
||
function testFillrandomBytes() public view { | ||
uint256 len = 16; | ||
vm.randomBytes(len); | ||
} | ||
} |