miden-vm
miden-vm copied to clipboard
Allow user to define error codes
When testing, it can be useful to inspect the stack state, something like:
proc.assert_stack_is_empty
assertz assertz assertz assertz
assertz assertz assertz assertz
assertz assertz assertz assertz
assertz assertz assertz assertz
end
And the above can be used in tests, something like:
begin
call::account.create_note exec.assert_stack_is_empty
call::account.create_note exec.assert_stack_is_empty
call::account.create_note exec.assert_stack_is_empty
end
The issue if any of the above fails, there is no information regarding which one failed. Having the error code exec.assert_stack_is_empty.err=1
would be helpful to fix that. This code be done with constants https://github.com/0xPolygonMiden/miden-vm/issues/1312