Skip to content

Commit e36e96a

Browse files
chore: align error messages with boundary conditions (#11468)
* chore: align error messages with boundary conditions * nit --------- Co-authored-by: DaniPopes <[email protected]>
1 parent 81b65df commit e36e96a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/cheatcodes/src/evm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ impl Cheatcode for getChainIdCall {
435435
impl Cheatcode for chainIdCall {
436436
fn apply_stateful(&self, ccx: &mut CheatsCtxt) -> Result {
437437
let Self { newChainId } = self;
438-
ensure!(*newChainId <= U256::from(u64::MAX), "chain ID must be less than 2^64 - 1");
438+
ensure!(*newChainId <= U256::from(u64::MAX), "chain ID must be less than 2^64");
439439
ccx.ecx.cfg.chain_id = newChainId.to();
440440
Ok(Default::default())
441441
}
@@ -465,7 +465,7 @@ impl Cheatcode for difficultyCall {
465465
impl Cheatcode for feeCall {
466466
fn apply_stateful(&self, ccx: &mut CheatsCtxt) -> Result {
467467
let Self { newBasefee } = self;
468-
ensure!(*newBasefee <= U256::from(u64::MAX), "base fee must be less than 2^64 - 1");
468+
ensure!(*newBasefee <= U256::from(u64::MAX), "base fee must be less than 2^64");
469469
ccx.ecx.block.basefee = newBasefee.saturating_to();
470470
Ok(Default::default())
471471
}
@@ -542,7 +542,7 @@ impl Cheatcode for getBlockNumberCall {
542542
impl Cheatcode for txGasPriceCall {
543543
fn apply_stateful(&self, ccx: &mut CheatsCtxt) -> Result {
544544
let Self { newGasPrice } = self;
545-
ensure!(*newGasPrice <= U256::from(u64::MAX), "gas price must be less than 2^64 - 1");
545+
ensure!(*newGasPrice <= U256::from(u64::MAX), "gas price must be less than 2^64");
546546
ccx.ecx.tx.gas_price = newGasPrice.saturating_to();
547547
Ok(Default::default())
548548
}
@@ -946,7 +946,7 @@ impl Cheatcode for broadcastRawTransactionCall {
946946
impl Cheatcode for setBlockhashCall {
947947
fn apply_stateful(&self, ccx: &mut CheatsCtxt) -> Result {
948948
let Self { blockNumber, blockHash } = *self;
949-
ensure!(blockNumber <= U256::from(u64::MAX), "blockNumber must be less than 2^64 - 1");
949+
ensure!(blockNumber <= U256::from(u64::MAX), "blockNumber must be less than 2^64");
950950
ensure!(
951951
blockNumber <= U256::from(ccx.ecx.block.number),
952952
"block number must be less than or equal to the current block number"

crates/cheatcodes/src/evm/fork.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl Cheatcode for eth_getLogsCall {
225225
let Self { fromBlock, toBlock, target, topics } = self;
226226
let (Ok(from_block), Ok(to_block)) = (u64::try_from(fromBlock), u64::try_from(toBlock))
227227
else {
228-
bail!("blocks in block range must be less than 2^64 - 1")
228+
bail!("blocks in block range must be less than 2^64")
229229
};
230230

231231
if topics.len() > 4 {

crates/cheatcodes/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Cheatcode for getLabelCall {
4949
impl Cheatcode for computeCreateAddressCall {
5050
fn apply(&self, _state: &mut Cheatcodes) -> Result {
5151
let Self { nonce, deployer } = self;
52-
ensure!(*nonce <= U256::from(u64::MAX), "nonce must be less than 2^64 - 1");
52+
ensure!(*nonce <= U256::from(u64::MAX), "nonce must be less than 2^64");
5353
Ok(deployer.create(nonce.to()).abi_encode())
5454
}
5555
}

0 commit comments

Comments
 (0)