cairo-vm-go
cairo-vm-go copied to clipboard
Resolve as BigInt3 structure
Currently we use the following logic for resolving BigInt3 structures:
valMemoryValues, err := hinter.GetConsecutiveValues(vm, valAddr, int16(3))
if err != nil {
return err
}
// [d0, d1, d2]
var valValues [3]*fp.Element
for i := 0; i < 3; i++ {
valValue, err := valMemoryValues[i].FieldElement()
if err != nil {
return err
}
valValues[i] = valValue
}
valValues
is the argument that should be passed down to the pack
functionality.
As this logic is repeated in the code several times, it would be beneficial to separate it in its own functionality, something like ResolveAsBigInt3
passing the starting address of the structure in memory