Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored felt252 dict libfuncs to use the BlockExt trait #656

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading