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

Impl const libfunc for uint64 #9

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ num-traits = "0.2.19"
p256 = "0.13.2"
rand = "0.8.5"
sec1 = { version = "0.7.3", features = ["std"] }
serde = { version = "1.0.209", features = ["derive"] }
serde_json = "1.0.127"
serde = { version = "1.0.208", features = ["derive"] }
serde_json = "1.0.125"
sha2 = { version = "0.10.8", features = ["compress"] }
smallvec = "1.13.2"
starknet-crypto = "0.7.1"
Expand Down
38 changes: 37 additions & 1 deletion src/vm/const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ pub fn eval_as_immediate(
[GenericArg::Value(value)] => Value::U32(value.try_into().unwrap()),
_ => unreachable!(),
},
CoreTypeConcrete::Uint64(_) => match inner_data {
[GenericArg::Value(value)] => Value::U64(value.try_into().unwrap()),
_ => unreachable!(),
},
CoreTypeConcrete::Uint8(_) => match inner_data {
[GenericArg::Value(value)] => Value::U8(value.try_into().unwrap()),
_ => unreachable!(),
Expand Down Expand Up @@ -95,7 +99,39 @@ pub fn eval_as_immediate(

Value::Struct(fields)
}
_ => todo!("{:?}", type_id),
CoreTypeConcrete::Array(_) => todo!(),
CoreTypeConcrete::Coupon(_) => todo!(),
CoreTypeConcrete::Bitwise(_) => todo!(),
CoreTypeConcrete::Box(_) => todo!(),
CoreTypeConcrete::Circuit(_) => todo!(),
CoreTypeConcrete::Const(_) => todo!(),
CoreTypeConcrete::EcOp(_) => todo!(),
CoreTypeConcrete::EcPoint(_) => todo!(),
CoreTypeConcrete::EcState(_) => todo!(),
CoreTypeConcrete::GasBuiltin(_) => todo!(),
CoreTypeConcrete::BuiltinCosts(_) => todo!(),
CoreTypeConcrete::Uint16(_) => todo!(),
CoreTypeConcrete::Uint128MulGuarantee(_) => todo!(),
CoreTypeConcrete::Sint16(_) => todo!(),
CoreTypeConcrete::Sint32(_) => todo!(),
CoreTypeConcrete::Sint64(_) => todo!(),
CoreTypeConcrete::Sint128(_) => todo!(),
CoreTypeConcrete::Nullable(_) => todo!(),
CoreTypeConcrete::RangeCheck(_) => todo!(),
CoreTypeConcrete::RangeCheck96(_) => todo!(),
CoreTypeConcrete::Uninitialized(_) => todo!(),
CoreTypeConcrete::Enum(_) => todo!(),
CoreTypeConcrete::Felt252Dict(_) => todo!(),
CoreTypeConcrete::Felt252DictEntry(_) => todo!(),
CoreTypeConcrete::SquashedFelt252Dict(_) => todo!(),
CoreTypeConcrete::Pedersen(_) => todo!(),
CoreTypeConcrete::Poseidon(_) => todo!(),
CoreTypeConcrete::Span(_) => todo!(),
CoreTypeConcrete::StarkNet(_) => todo!(),
CoreTypeConcrete::SegmentArena(_) => todo!(),
CoreTypeConcrete::Snapshot(_) => todo!(),
CoreTypeConcrete::Bytes31(_) => todo!(),
// _ => todo!("{:?}", type_id),
}
}

Expand Down