-
Notifications
You must be signed in to change notification settings - Fork 65
test(starknet_os): deprecated syscall hint consistency test #6988
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
test(starknet_os): deprecated syscall hint consistency test #6988
Conversation
amosStarkware
left a comment
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 r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware)
crates/starknet_os/src/hints/enum_definition_test.rs line 140 at r1 (raw file):
!matches!( selector, // As the new and deprecated syscall selector enums are the same enum,
whyyy
Code quote:
// As the new and deprecated syscall selector enums are the same enum,crates/starknet_os/src/hints/enum_definition_test.rs line 181 at r1 (raw file):
syscall hints. Converted selectors: {converted_selectors:#?}, hints: \ {deprecated_syscall_hints:#?}" );
you're verifying that every deprecated sycall has exactly one hint - I was thinking of verifying that DeprecatedSyscallHint contains exactly the syscall hints used by the OS.
If we know every syscall will have exactly one hint, and the hint string will not change, I guess that's ok. is this the case?
if yes - consider explaining this in a comment
Code quote:
assert_eq!(
deprecated_syscall_selectors.len(),
deprecated_syscall_hints.len(),
"The number of deprecated syscall selectors does not match the number of deprecated \
syscall hints. Selectors: {deprecated_syscall_selectors:#?}, hints: \
{deprecated_syscall_hints:#?}",
);
let converted_selectors: HashSet<DeprecatedSyscallHint> = deprecated_syscall_selectors
.iter()
.map(|selector| DeprecatedSyscallHint::try_from(*selector).unwrap())
.collect();
assert_eq!(
converted_selectors,
deprecated_syscall_hints.iter().cloned().collect(),
"The deprecated syscall selectors, converted to hints, do not match the deprecated \
syscall hints. Converted selectors: {converted_selectors:#?}, hints: \
{deprecated_syscall_hints:#?}"
);
amosStarkware
left a comment
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)
dorimedini-starkware
left a comment
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 @amosStarkware)
crates/starknet_os/src/hints/enum_definition_test.rs line 140 at r1 (raw file):
Previously, amosStarkware wrote…
whyyy
lol yes... bummer
crates/starknet_os/src/hints/enum_definition_test.rs line 181 at r1 (raw file):
Previously, amosStarkware wrote…
you're verifying that every deprecated sycall has exactly one hint - I was thinking of verifying that
DeprecatedSyscallHintcontains exactly the syscall hints used by the OS.
If we know every syscall will have exactly one hint, and the hint string will not change, I guess that's ok. is this the case?
if yes - consider explaining this in a comment
hint strings are tested in the next PR, is that what you meant?
amosStarkware
left a comment
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/starknet_os/src/hints/enum_definition_test.rs line 181 at r1 (raw file):
Previously, dorimedini-starkware wrote…
hint strings are tested in the next PR, is that what you meant?
yes
63043ed to
4cd582d
Compare
fc9c69e to
a9db393
Compare
4cd582d to
b5cbf8d
Compare
a9db393 to
4ed5535
Compare
b5cbf8d to
ef0e32d
Compare
4ed5535 to
eddb322
Compare
ef0e32d to
168e351
Compare
eddb322 to
e534e35
Compare
e534e35 to
015c853
Compare
Merge activity
|

No description provided.