Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Make EMPTY_CODE_HASH private
Browse files Browse the repository at this point in the history
  • Loading branch information
leolara committed Jun 20, 2023
1 parent 75741d2 commit 9491aa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bus-mapping/src/state_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions zkevm-circuits/src/util/word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -519,7 +519,7 @@ impl<F: Field> From<WordLegacy<F>> for Word32Cell<F> {

/// Return the hash of the empty code as a Word<Value<F>>
pub fn empty_code_hash_word_value<F: Field>() -> Word<Value<F>> {
Word::from(*EMPTY_CODE_HASH).into_value()
Word::from(CodeDB::empty_code_hash()).into_value()
}

// TODO unittest

0 comments on commit 9491aa7

Please sign in to comment.