-
Notifications
You must be signed in to change notification settings - Fork 107
feat: add the new stack trace to ValidateTransactionError #1712
Conversation
39968fd
to
c0cc493
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @zuphitf)
a discussion (no related file):
Please add a regression test for this
c0cc493
to
905946a
Compare
Previously, dorimedini-starkware wrote…
Done. |
905946a
to
8f66070
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @zuphitf)
crates/blockifier/Cargo.toml
line 57 at r3 (raw file):
pretty_assertions.workspace = true rstest.workspace = true test-case.workspace = true
only used in tests, right?
Suggestion:
phf.workspace = true
rstest = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, features = ["arbitrary_precision"] }
sha3.workspace = true
starknet-crypto.workspace = true
starknet_api = { workspace = true, features = ["testing"] }
strum.workspace = true
strum_macros.workspace = true
thiserror.workspace = true
[dev-dependencies]
assert_matches.workspace = true
pretty_assertions.workspace = true
regex.workspace = true
rstest.workspace = true
test-case.workspace = true
crates/blockifier/src/execution/entry_point_test.rs
line 1072 at r3 (raw file):
" ), };
cleaner, no need for regex, checks basically the same thing; or am I missing something?
Suggestion:
let expected_error_prefix = format!(
"Transaction validation has failed:
0: Error in the called contract (contract address: {contract_address}, class hash: {class_hash}, \
selector: {selector}):"
);
let expected_error_suffix = match cairo_version {
CairoVersion::Cairo0 => "An ASSERT_EQ instruction failed: 1 != 0.",
CairoVersion::Cairo1 => "Execution failed. Failure reason: 0x496e76616c6964207363656e6172696f ('Invalid scenario')."
};
crates/blockifier/src/execution/entry_point_test.rs
line 1081 at r3 (raw file):
let cleaned_actual_error = &re.replace_all(&actual_error_str, "pc=0:*"); // Compare actual trace to the expected trace (sans pc locations). assert_eq!(cleaned_actual_error.to_string(), cleaned_expected_error.to_string());
see above
Suggestion:
let actual_error = account_tx.execute(state, block_context, true, true).unwrap_err();
let actual_error_str = actual_error.to_string();
assert!(actual_error_str.startswith(expected_error_prefix));
assert!(actual_error_str.endswith(expected_error_suffix));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @zuphitf)
crates/blockifier/src/execution/entry_point_test.rs
line 1072 at r3 (raw file):
Previously, dorimedini-starkware wrote…
cleaner, no need for regex, checks basically the same thing; or am I missing something?
ah no nevermind... asserting equality is better, you assert the number of frames as well. retracting
crates/blockifier/src/execution/entry_point_test.rs
line 1081 at r3 (raw file):
Previously, dorimedini-starkware wrote…
see above
ah no nevermind... asserting equality is better, you assert the number of frames as well. retracting
8f66070
to
c5cd9c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)
crates/blockifier/Cargo.toml
line 57 at r3 (raw file):
Previously, dorimedini-starkware wrote…
only used in tests, right?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @zuphitf)
* [sozo][auth]: revoke logic added * test added for auth revoke * fix: remove world reader as argument WorldContractReader can be initialized from the inside of the ops. Hence, we avoid passing it as an argument and it is initialized inside the ops function. tests added for the auth revoke * test added for auth revoke * fix: refacto testing functions * fix: add missing spaces --------- Co-authored-by: glihm <dev@glihm.net>
This change is