Skip to content

Commit

Permalink
use unreachable in checked bytecode branch
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed May 1, 2024
1 parent 9f3ffbc commit 0a5b560
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/primitives/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ impl Compact for Bytecode {
let variant = buf.read_u8().expect("could not read bytecode variant");
let decoded = match variant {
0 => Bytecode(RevmBytecode::new_raw(bytes)),
1 => {
// let _ = buf.read_u64::<BigEndian>().unwrap();
// Bytecode(RevmBytecode::new_raw(bytes))
unimplemented!("checked bytecode was removed")
}
1 => unreachable!("Junk data in database: checked Bytecode variant was removed"),
2 => Bytecode(unsafe {
RevmBytecode::new_analyzed(
bytes,
Expand All @@ -126,7 +122,7 @@ impl Compact for Bytecode {
}),
// TODO(EOF)
3 => todo!("EOF"),
_ => unreachable!("Junk data in database: unknown BytecodeState variant"),
_ => unreachable!("Junk data in database: unknown Bytecode variant"),
};
(decoded, &[])
}
Expand Down

0 comments on commit 0a5b560

Please sign in to comment.