From 9491aa7b648198251be3faa751d6c108547ee54c Mon Sep 17 00:00:00 2001 From: Leo Lara Date: Tue, 20 Jun 2023 22:30:10 +0800 Subject: [PATCH] Make EMPTY_CODE_HASH private --- bus-mapping/src/state_db.rs | 2 +- zkevm-circuits/src/util/word.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bus-mapping/src/state_db.rs b/bus-mapping/src/state_db.rs index 3ca3f762d0..84bf451109 100644 --- a/bus-mapping/src/state_db.rs +++ b/bus-mapping/src/state_db.rs @@ -9,7 +9,7 @@ use std::collections::{HashMap, HashSet}; lazy_static! { static ref ACCOUNT_ZERO: Account = Account::zero(); /// Hash value for empty code hash. - pub static ref EMPTY_CODE_HASH: Hash = CodeDB::hash(&[]); + static ref EMPTY_CODE_HASH: Hash = CodeDB::hash(&[]); /// bytes of empty code hash, in little endian order. pub static ref EMPTY_CODE_HASH_LE: [u8; 32] = { let mut bytes = EMPTY_CODE_HASH.to_fixed_bytes(); diff --git a/zkevm-circuits/src/util/word.rs b/zkevm-circuits/src/util/word.rs index f97bd5e2a4..6b13f1a5c3 100644 --- a/zkevm-circuits/src/util/word.rs +++ b/zkevm-circuits/src/util/word.rs @@ -3,7 +3,7 @@ // - Limbs: An EVN word is 256 bits. Limbs N means split 256 into N limb. For example, N = 4, each // limb is 256/4 = 64 bits -use bus_mapping::state_db::EMPTY_CODE_HASH; +use bus_mapping::state_db::CodeDB; use eth_types::{Field, ToLittleEndian, H160}; use gadgets::util::{not, or, Expr}; use halo2_proofs::{ @@ -519,7 +519,7 @@ impl From> for Word32Cell { /// Return the hash of the empty code as a Word> pub fn empty_code_hash_word_value() -> Word> { - Word::from(*EMPTY_CODE_HASH).into_value() + Word::from(CodeDB::empty_code_hash()).into_value() } // TODO unittest