diff --git a/crates/cheatcodes/assets/cheatcodes.json b/crates/cheatcodes/assets/cheatcodes.json index 1d34bf578ebe..39b58ff5e7fe 100644 --- a/crates/cheatcodes/assets/cheatcodes.json +++ b/crates/cheatcodes/assets/cheatcodes.json @@ -2995,7 +2995,7 @@ "func": { "id": "blobhashes", "description": "Sets the blobhashes in the transaction.\nNot available on EVM versions before Cancun.\nIf used on unsupported EVM versions it will revert.", - "declaration": "function blobhashes(bytes32[] calldata blobhashes) external;", + "declaration": "function blobhashes(bytes32[] calldata hashes) external;", "visibility": "external", "mutability": "", "signature": "blobhashes(bytes32[])", @@ -4735,7 +4735,7 @@ "func": { "id": "getBlobhashes", "description": "Gets the blockhashes from the current transaction.\nNot available on EVM versions before Cancun.\nIf used on unsupported EVM versions it will revert.", - "declaration": "function getBlobhashes() external view returns (bytes32[] memory blobhashes);", + "declaration": "function getBlobhashes() external view returns (bytes32[] memory hashes);", "visibility": "external", "mutability": "view", "signature": "getBlobhashes()", diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs index a62a05880f27..4bbf63169020 100644 --- a/crates/cheatcodes/spec/src/vm.rs +++ b/crates/cheatcodes/spec/src/vm.rs @@ -385,13 +385,13 @@ interface Vm { /// Not available on EVM versions before Cancun. /// If used on unsupported EVM versions it will revert. #[cheatcode(group = Evm, safety = Unsafe)] - function blobhashes(bytes32[] calldata blobhashes) external; + function blobhashes(bytes32[] calldata hashes) external; /// Gets the blockhashes from the current transaction. /// Not available on EVM versions before Cancun. /// If used on unsupported EVM versions it will revert. #[cheatcode(group = Evm, safety = Unsafe)] - function getBlobhashes() external view returns (bytes32[] memory blobhashes); + function getBlobhashes() external view returns (bytes32[] memory hashes); /// Sets `block.height`. #[cheatcode(group = Evm, safety = Unsafe)] diff --git a/crates/cheatcodes/src/evm.rs b/crates/cheatcodes/src/evm.rs index c924c243629f..6189980716b5 100644 --- a/crates/cheatcodes/src/evm.rs +++ b/crates/cheatcodes/src/evm.rs @@ -305,13 +305,13 @@ impl Cheatcode for prevrandao_1Call { impl Cheatcode for blobhashesCall { fn apply_full(&self, ccx: &mut CheatsCtxt) -> Result { - let Self { blobhashes } = self; + let Self { hashes } = self; ensure!( ccx.ecx.spec_id() >= SpecId::CANCUN, "`blobhash` is not supported before the Cancun hard fork; \ see EIP-4844: https://eips.ethereum.org/EIPS/eip-4844" ); - ccx.ecx.env.tx.blob_hashes.clone_from(blobhashes); + ccx.ecx.env.tx.blob_hashes.clone_from(hashes); Ok(Default::default()) } } diff --git a/testdata/cheats/Vm.sol b/testdata/cheats/Vm.sol index e70049cbf8f3..db8e45ada043 100644 --- a/testdata/cheats/Vm.sol +++ b/testdata/cheats/Vm.sol @@ -145,7 +145,7 @@ interface Vm { function assertTrue(bool condition, string calldata error) external pure; function assume(bool condition) external pure; function blobBaseFee(uint256 newBlobBaseFee) external; - function blobhashes(bytes32[] calldata blobhashes) external; + function blobhashes(bytes32[] calldata hashes) external; function breakpoint(string calldata char) external; function breakpoint(string calldata char, bool value) external; function broadcast() external; @@ -232,7 +232,7 @@ interface Vm { function ffi(string[] calldata commandInput) external returns (bytes memory result); function fsMetadata(string calldata path) external view returns (FsMetadata memory metadata); function getBlobBaseFee() external view returns (uint256 blobBaseFee); - function getBlobhashes() external view returns (bytes32[] memory blobhashes); + function getBlobhashes() external view returns (bytes32[] memory hashes); function getBlockNumber() external view returns (uint256 height); function getBlockTimestamp() external view returns (uint256 timestamp); function getCode(string calldata artifactPath) external view returns (bytes memory creationBytecode);