VirtualMachine error when using Felt252Dict<T>
catusax opened this issue · comments
Describe the bug
when using Felt252Dict in cairo1, vm reports an error:
Error: VirtualMachine(DiffAssertValues((RelocatableValue(Relocatable { segment_index: 13, offset: 0 }), RelocatableValue(Relocatable { segment_index: 14, offset: 3 }))))
To Reproduce
Steps to reproduce the behavior:
please go to this repo for a full example: https://github.com/catusax/cairovm-felt252dict-error
when i use this source code, compile to serria, and run with --print_output --proof_mode --layout all_cairo
, the error occurs:
fn main(input:Array<felt252>) -> Array<felt252> {
let elements: Felt252Dict<Nullable<Span<u8>>> = Default::default();
input
}
but if i remove the function params ,it works fine
fn main() -> Array<felt252> {
let elements: Felt252Dict<Nullable<Span<u8>>> = Default::default();
array![1]
}
Expected behavior
this should has same result as the scarb cairo-run
, which works fine
What version/commit are you on?
3f9428e
Additional context
Add any other context about the problem here.
https://github.com/catusax/cairovm-felt252dict-error