Skip to content
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
87 changes: 85 additions & 2 deletions src/metadata/trace_dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,84 @@ pub mod trace_dump_runtime {

Value::Bytes31(Felt::from_bytes_le(&data))
}
CoreTypeConcrete::IntRange(_)
| CoreTypeConcrete::Blake(_)
CoreTypeConcrete::IntRange(info) => {
let type_info = registry.get_type(&info.ty).unwrap();

match type_info {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don´t we need in this match to handle the case of a BoundedInt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not the aim of this PR honestly, and it seems not to be necessary for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could at least add a todo for it, so that we remember to implement it later.

CoreTypeConcrete::Sint8(_) => {
let value = value_ptr.cast::<IntRange<i8>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Sint16(_) => {
let value = value_ptr.cast::<IntRange<i16>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Sint32(_) => {
let value = value_ptr.cast::<IntRange<i32>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Sint64(_) => {
let value = value_ptr.cast::<IntRange<i64>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Sint128(_) => {
let value = value_ptr.cast::<IntRange<i128>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Uint8(_) => {
let value = value_ptr.cast::<IntRange<u8>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Uint16(_) => {
let value = value_ptr.cast::<IntRange<u16>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Uint32(_) => {
let value = value_ptr.cast::<IntRange<u32>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Uint64(_) => {
let value = value_ptr.cast::<IntRange<u64>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
CoreTypeConcrete::Uint128(_) => {
let value = value_ptr.cast::<IntRange<u128>>().read();
Value::IntRange {
x: Box::new(value.x.into()),
y: Box::new(value.y.into()),
}
}
_ => unreachable!(),
}
}
CoreTypeConcrete::Blake(_)
| CoreTypeConcrete::GasReserve(_)
| CoreTypeConcrete::QM31(_) => {
todo!()
Expand All @@ -833,6 +909,13 @@ pub mod trace_dump_runtime {
BigUint::from_bytes_le(&output_limbs)
}

#[derive(Debug)]
#[repr(C)]
struct IntRange<T> {
x: T,
y: T,
}

#[derive(Debug)]
struct FeltDictEntry<'a> {
dict: &'a FeltDict,
Expand Down
Loading