Skip to content

Commit

Permalink
Refactor taiko data setup to use if let syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
johntaiko committed Dec 27, 2024
1 parent 4df0e14 commit deb4cbc
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions crates/taiko/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ 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;
// 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);
if let Some(EnvExt { is_anchor, block_number, extra_data }) = ext {
// Set taiko specific data
tx_env.taiko.is_anchor = is_anchor;
// 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);
}
}
}

Expand Down

0 comments on commit deb4cbc

Please sign in to comment.