-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement ScVal comparison #52
Conversation
| compareString(String, String) [function, total, symbol(compareString)] | ||
// --------------------------------------------------------------------------------------------- | ||
rule compareBytes(A, B) => compareString(Bytes2String(A), Bytes2String(B)) | ||
rule compareString(A, B) => Less requires A <String B | ||
rule compareString(A, B) => Equal requires A ==String B | ||
rule compareString(A, B) => Greater requires A >String B |
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.
It looks like the tests you added don't test string/bytes comparisons. Have you also verified that our semantics for String comparisons matches the comparisons for strings/bytes in soroban?
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.
@gtrepta I added a komet test for Bytes comparison after your review. I also implemented a new host function, bytes_copy_to_linear_memory
, to support this test.
Implemented value comparison (CAP 46-01) and the
obj_cmp
host function.