Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename Then to Than #368

Merged
merged 1 commit into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/primitives/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ impl<DB> From<InvalidTransaction> for EVMError<DB> {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum InvalidTransaction {
GasMaxFeeGreaterThanPriorityFee,
GasPriceLessThenBasefee,
CallerGasLimitMoreThenBlock,
CallGasCostMoreThenGasLimit,
GasPriceLessThanBasefee,
CallerGasLimitMoreThanBlock,
CallGasCostMoreThanGasLimit,
/// EIP-3607 Reject transactions from senders with deployed code
RejectCallerWithCode,
/// Transaction account does not have enough amount of ether to cover transferred value and gas_limit*gas_price.
Expand Down
8 changes: 4 additions & 4 deletions crates/revm/src/evm_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'a, GSPEC: Spec, DB: Database, const INSPECT: bool> Transact<DB::Error>
// TODO maybe do this checks when creating evm. We already have all data there
// or should be move effective_gas_price inside transact fn
if effective_gas_price < basefee {
return Err(InvalidTransaction::GasPriceLessThenBasefee.into());
return Err(InvalidTransaction::GasPriceLessThanBasefee.into());
}
// check if priority fee is lower then max fee
}
Expand All @@ -72,9 +72,9 @@ impl<'a, GSPEC: Spec, DB: Database, const INSPECT: bool> Transact<DB::Error>
#[cfg(not(feature = "optional_block_gas_limit"))]
let disable_block_gas_limit = false;

// unusual to be found here, but check if gas_limit is more then block_gas_limit
// unusual to be found here, but check if gas_limit is more than block_gas_limit
if !disable_block_gas_limit && U256::from(gas_limit) > self.data.env.block.gas_limit {
return Err(InvalidTransaction::CallerGasLimitMoreThenBlock.into());
return Err(InvalidTransaction::CallerGasLimitMoreThanBlock.into());
}

// load acc
Expand Down Expand Up @@ -133,7 +133,7 @@ impl<'a, GSPEC: Spec, DB: Database, const INSPECT: bool> Transact<DB::Error>
let mut gas = Gas::new(gas_limit);
// record initial gas cost. if not using gas metering init will return.
if !gas.record_cost(self.initialization::<GSPEC>()?) {
return Err(InvalidTransaction::CallGasCostMoreThenGasLimit.into());
return Err(InvalidTransaction::CallGasCostMoreThanGasLimit.into());
}

// record all as cost. Gas limit here is reduced by init cost of bytes and access lists.
Expand Down