Skip to content

Commit

Permalink
Refactored felt252 dict libfuncs to use the BlockExt trait (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Jun 6, 2024
1 parent e0813b0 commit 62a4b2e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/libfuncs/felt252_dict.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! # `Felt` dictionary libfuncs

use super::LibfuncHelper;
use crate::block_ext::BlockExt;
use crate::{
error::Result,
metadata::{runtime_bindings::RuntimeBindingsMeta, MetadataStorage},
Expand Down Expand Up @@ -86,19 +87,13 @@ pub fn build_squash<'ctx, 'this>(
.dict_gas_refund(context, helper, entry, dict_ptr, location)?
.result(0)?
.into();
let gas_refund = entry
.append_operation(arith::extui(
gas_refund,
IntegerType::new(context, 128).into(),
location,
))
.result(0)?
.into();
let gas_refund = entry.append_op_result(arith::extui(
gas_refund,
IntegerType::new(context, 128).into(),
location,
))?;

let new_gas_builtin = entry
.append_operation(arith::addi(gas_builtin, gas_refund, location))
.result(0)?
.into();
let new_gas_builtin = entry.append_op_result(arith::addi(gas_builtin, gas_refund, location))?;

entry.append_operation(helper.br(
0,
Expand Down

0 comments on commit 62a4b2e

Please sign in to comment.