forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
vm.blobhashes
(foundry-rs#7001)
* feat: `vm.blobhashes` * chore: rename * test: add `vm.blobhashes` test * fix: add missing vm fn * fix: `cargo cheat` * fix: specify blobhashes loc * fix: use solidity 0.8.24 for blobhash test * chore: reinsert noop line ¯\_(ツ)_/¯ * refactor: move cancun cheats to sep dir * temp * temp * feat(cheatcodes): getBlobhashes --------- Co-authored-by: Yash Atreya <[email protected]>
- Loading branch information
1 parent
1fc4aa3
commit 19d69f2
Showing
5 changed files
with
99 additions
and
0 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
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,20 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.25; | ||
|
||
import "ds-test/test.sol"; | ||
import "cheats/Vm.sol"; | ||
|
||
contract BlobhashesTest is DSTest { | ||
Vm constant vm = Vm(HEVM_ADDRESS); | ||
|
||
function testSetAndGetBlobhashes() public { | ||
bytes32[] memory blobhashes = new bytes32[](2); | ||
blobhashes[0] = bytes32(0x0000000000000000000000000000000000000000000000000000000000000001); | ||
blobhashes[1] = bytes32(0x0000000000000000000000000000000000000000000000000000000000000002); | ||
vm.blobhashes(blobhashes); | ||
|
||
bytes32[] memory gotBlobhashes = vm.getBlobhashes(); | ||
assertEq(gotBlobhashes[0], blobhashes[0]); | ||
assertEq(gotBlobhashes[1], blobhashes[1]); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.