Skip to content

Commit

Permalink
remove unneeded utils (#125)
Browse files Browse the repository at this point in the history
Signed-off-by: xermicus <[email protected]>
  • Loading branch information
xermicus authored Nov 29, 2024
1 parent 423a494 commit 7c00bbb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 65 deletions.
1 change: 0 additions & 1 deletion crates/llvm-context/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ pub use self::polkavm::evm::return_data as polkavm_evm_return_data;
pub use self::polkavm::evm::storage as polkavm_evm_storage;
pub use self::polkavm::metadata_hash::MetadataHash as PolkaVMMetadataHash;
pub use self::polkavm::r#const as polkavm_const;
pub use self::polkavm::utils as polkavm_utils;
pub use self::polkavm::Dependency as PolkaVMDependency;
pub use self::polkavm::DummyDependency as PolkaVMDummyDependency;
pub use self::polkavm::DummyLLVMWritable as PolkaVMDummyLLVMWritable;
Expand Down
5 changes: 2 additions & 3 deletions crates/llvm-context/src/polkavm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ pub mod r#const;
pub mod context;
pub mod evm;
pub mod metadata_hash;
pub mod utils;

pub use self::r#const::*;
use self::utils::keccak256;

use crate::debug_config::DebugConfig;
use crate::optimizer::settings::Settings as OptimizerSettings;

use anyhow::Context as AnyhowContext;
use polkavm_common::program::ProgramBlob;
use polkavm_disassembler::{Disassembler, DisassemblyFormat};
use sha3::Digest;

use self::context::build::Build;
use self::context::Context;
Expand Down Expand Up @@ -55,7 +54,7 @@ pub fn build_assembly_text(
assembly_text.to_owned(),
metadata_hash,
bytecode.to_owned(),
keccak256(bytecode),
hex::encode(sha3::Keccak256::digest(bytecode)),
))
}

Expand Down
60 changes: 0 additions & 60 deletions crates/llvm-context/src/polkavm/utils.rs

This file was deleted.

3 changes: 2 additions & 1 deletion crates/solidity/src/evmla/assembly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::collections::HashSet;

use serde::Deserialize;
use serde::Serialize;
use sha3::Digest;

use crate::evmla::ethereal_ir::entry_link::EntryLink;
use crate::evmla::ethereal_ir::EtherealIR;
Expand Down Expand Up @@ -45,7 +46,7 @@ impl Assembly {
/// Gets the contract `keccak256` hash.
pub fn keccak256(&self) -> String {
let json = serde_json::to_vec(self).expect("Always valid");
revive_llvm_context::polkavm_utils::keccak256(json.as_slice())
hex::encode(sha3::Keccak256::digest(json.as_slice()))
}

/// Sets the full contract path.
Expand Down

0 comments on commit 7c00bbb

Please sign in to comment.