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

Implement ScVal comparison #52

Merged
merged 8 commits into from
Dec 19, 2024
Merged

Conversation

bbyalcinkaya
Copy link
Member

Implemented value comparison (CAP 46-01) and the obj_cmp host function.

@bbyalcinkaya bbyalcinkaya marked this pull request as ready for review December 12, 2024 14:31
@bbyalcinkaya bbyalcinkaya requested a review from gtrepta December 12, 2024 14:32
Comment on lines +435 to +440
| 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
Copy link
Contributor

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?

Copy link
Member Author

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.

@bbyalcinkaya bbyalcinkaya requested a review from gtrepta December 18, 2024 14:37
@automergerpr-permission-manager automergerpr-permission-manager bot merged commit c292d14 into master Dec 19, 2024
3 checks passed
@bbyalcinkaya bbyalcinkaya mentioned this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants