Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adapt server for new EVM bytecode hash encoding #3396

Merged
merged 9 commits into from
Dec 19, 2024
Prev Previous commit
Next Next commit
Fix lint issue
  • Loading branch information
0xVolosnikov committed Dec 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1af5063300e7bd783e7ae09e3d2f6e6deef1ca3e
10 changes: 6 additions & 4 deletions core/node/api_server/src/web3/namespaces/eth.rs
Original file line number Diff line number Diff line change
@@ -405,10 +405,12 @@ impl EthNamespace {
let marker = BytecodeMarker::new(contract_code.bytecode_hash);
let prepared_bytecode = if marker == Some(BytecodeMarker::Evm) {
trim_padded_evm_bytecode(
BytecodeHash::try_from(contract_code.bytecode_hash).expect(&format!(
"Invalid bytecode hash at address {address:?}: {:?}",
contract_code.bytecode_hash
)),
BytecodeHash::try_from(contract_code.bytecode_hash).unwrap_or_else(|_| {
panic!(
"Invalid bytecode hash at address {address:?}: {:?}",
contract_code.bytecode_hash
)
}),
&contract_code.bytecode,
)
.with_context(|| {