Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Change additional as to try_from and try_to
Browse files Browse the repository at this point in the history
  • Loading branch information
OriStarkware committed Jan 16, 2024
1 parent c7ba38a commit 1a5c859
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions crates/blockifier/src/execution/entry_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@ impl EntryPointExecutionContext {
// transactions derive this value from the `max_fee`.
let tx_gas_upper_bound = match account_tx_context {
AccountTransactionContext::Deprecated(context) => {
(context.max_fee.0
let max_cairo_steps = context.max_fee.0
/ block_context
.gas_prices
.get_gas_price_by_fee_type(&account_tx_context.fee_type()))
as usize
.get_gas_price_by_fee_type(&account_tx_context.fee_type());
// TODO(Ori, 1/2/2024): Write an indicative expect message explaining why the
// conversion works.
usize::try_from(max_cairo_steps).expect("Failed to convert u128 to usize")
}
AccountTransactionContext::Current(context) => {
context.l1_resource_bounds()?.max_amount as usize
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/syscalls/hint_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ fn get_ptr_from_res_operand_unchecked(vm: &mut VirtualMachine, res: &ResOperand)
Register::AP => vm.get_ap(),
Register::FP => vm.get_fp(),
};
let cell_reloc = (base + (cell.offset as i32)).unwrap();
let cell_reloc = (base + (i32::from(cell.offset))).unwrap();
(vm.get_relocatable(cell_reloc).unwrap() + &base_offset).unwrap()
}

Expand Down

0 comments on commit 1a5c859

Please sign in to comment.