Skip to content

Commit

Permalink
Check for evm simulator to avoid failing for transactions with null c…
Browse files Browse the repository at this point in the history
…ontract address
  • Loading branch information
IAvecilla committed Sep 19, 2024
1 parent 2388ae8 commit 00f0324
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/lib/types/src/transaction_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use rlp::{DecoderError, Rlp, RlpStream};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use zksync_basic_types::H256;
use zksync_config::configs::use_evm_simulator;
use zksync_env_config::FromEnv;
use zksync_system_constants::{DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE, MAX_ENCODED_TX_SIZE};
use zksync_utils::{
bytecode::{hash_bytecode, validate_bytecode, InvalidBytecodeError},
Expand Down Expand Up @@ -817,8 +819,11 @@ impl L2Tx {
let meta = value.eip712_meta.take().unwrap_or_default();
validate_factory_deps(&meta.factory_deps)?;

let use_evm_simulator = use_evm_simulator::UseEvmSimulator::from_env()
.unwrap()
.use_evm_simulator;
// TODO: Remove this check when evm equivalence gets enabled
if value.to.is_none() {
if value.to.is_none() && !use_evm_simulator {
return Err(SerializationTransactionError::ToAddressIsNull);
}

Expand Down

0 comments on commit 00f0324

Please sign in to comment.