Skip to content

Commit

Permalink
handle optional parameter ext
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Dec 27, 2024
1 parent b9a32e7 commit 5fa3fcb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions crates/taiko/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,18 @@ impl ConfigureEvmEnv for TaikoEvmConfig {
) {
transaction.fill_tx_env(tx_env, sender);

let EnvExt { is_anchor, block_number, extra_data } = ext.unwrap();
// Set taiko specific data
tx_env.taiko.is_anchor = is_anchor;
if let Some(ext) = ext {
let EnvExt { is_anchor, block_number, extra_data } = ext;
// Set taiko specific data
tx_env.taiko.is_anchor = is_anchor;
if self.chain_spec.is_ontake_active_at_block(block_number) {
// set the basefee ratio
tx_env.taiko.basefee_ratio = decode_ontake_extra_data(extra_data);
}
}
// set the treasury address
let treasury = self.chain_spec.treasury();
tx_env.taiko.treasury = treasury;

if self.chain_spec.is_ontake_active_at_block(block_number) {
// set the basefee ratio
tx_env.taiko.basefee_ratio = decode_ontake_extra_data(extra_data);
}
}

fn fill_tx_env_system_contract_call(
Expand Down

0 comments on commit 5fa3fcb

Please sign in to comment.