diff --git a/crates/primitives/src/bytecode.rs b/crates/primitives/src/bytecode.rs index 334c5f1cd7..68d8fd8089 100644 --- a/crates/primitives/src/bytecode.rs +++ b/crates/primitives/src/bytecode.rs @@ -99,6 +99,15 @@ impl Bytecode { &self.bytecode } + pub fn original_bytes(&self) -> Bytes { + match self.state { + BytecodeState::Raw => self.bytecode.clone(), + BytecodeState::Checked { len } | BytecodeState::Analysed { len, .. } => { + self.bytecode.slice(0..len) + } + } + } + pub fn hash(&self) -> B256 { self.hash }