Skip to content

Commit

Permalink
Merge pull request #518 from fuzzland/fix-onchain-unwrap
Browse files Browse the repository at this point in the history
fix empty onchain
  • Loading branch information
publicqi authored Jun 21, 2024
2 parents 9ab8f5c + bc11fb1 commit 906fcfc
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 906fcfc

Please sign in to comment.