Skip to content

Commit

Permalink
fix empty onchain
Browse files Browse the repository at this point in the history
  • Loading branch information
publicqi committed Jun 21, 2024
1 parent 9ab8f5c commit bc11fb1
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/evm/contract_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1246,18 +1246,14 @@ impl ContractLoader {
}
}

evm_executor.host.env.block.number = EVMU256::from(
u64::from_str_radix(
&onchain_middleware
.as_ref()
.unwrap()
.endpoint
.block_number
.trim_start_matches("0x"),
16,
)
.unwrap(),
);
match &onchain_middleware {
Some(onchain) => {
evm_executor.host.env.block.number = EVMU256::from(
u64::from_str_radix(onchain.endpoint.block_number.trim_start_matches("0x"), 16).unwrap(),
);
}
None => {}
}

SetupData {
evmstate: new_vm_state,
Expand Down

0 comments on commit bc11fb1

Please sign in to comment.