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

Error code as int #1148

Closed
wants to merge 1 commit into from
Closed
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 miden/tests/integration/operations/sys_ops.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use test_utils::{build_op_test, Felt, TestError};
use test_utils::{build_op_test, TestError};

// SYSTEM OPS ASSERTIONS - MANUAL TESTS
// ================================================================================================
Expand All @@ -19,7 +19,7 @@ fn assert_with_code() {
test.expect_stack(&[]);

// triggered assertion captures both the VM cycle and error code
let expected_err = format!("FailedAssertion(1, BaseElement({}))", Felt::new(123).inner());
let expected_err = format!("FailedAssertion(1, 123)");
let test = build_op_test!(asm_op, &[0]);
test.expect_error(TestError::ExecutionError(&expected_err));
}
Expand Down
2 changes: 1 addition & 1 deletion processor/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub enum ExecutionError {
DivideByZero(u32),
EventError(String),
Ext2InttError(Ext2InttError),
FailedAssertion(u32, Felt),
FailedAssertion(u32, u64),
InvalidFmpValue(Felt, Felt),
InvalidFriDomainSegment(u64),
InvalidFriLayerFolding(QuadFelt, QuadFelt),
Expand Down
2 changes: 1 addition & 1 deletion processor/src/operations/sys_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ where
/// Returns an error if the popped value is not ONE.
pub(super) fn op_assert(&mut self, err_code: Felt) -> Result<(), ExecutionError> {
if self.stack.get(0) != ONE {
return Err(ExecutionError::FailedAssertion(self.system.clk(), err_code));
return Err(ExecutionError::FailedAssertion(self.system.clk(), err_code.as_int()));
}
self.stack.shift_left(1);
Ok(())
Expand Down
Loading