Skip to content

fix: Update float_compare() doc and refactor enum definition - #8217

Open
kuznetsss wants to merge 6 commits into
XRPLF:ripple/smart-escrowfrom
kuznetsss:Update-float-cmp
Open

kuznetsss wants to merge 6 commits into
XRPLF:ripple/smart-escrowfrom
kuznetsss:Update-float-cmp

Conversation

@kuznetsss

@kuznetsss kuznetsss commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Apply the XLS fix: XRPLF/XRPL-Standards#627
The implementation was already correct but the comment was outdated.
Expressed return value of floar_compare() as an enum and refactored the way enums are added in host functions crate to avoid duplication.

Context of Change

The new enum was the third macro defining ALL and code()/from_code() in the same way. Rewrote it to macro annotation to avoid duplication.

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

// shared with the guest: append only, never renumber, never negative — a verdict and a
// `HostFunctionError` share one `i32`, split by sign. The second declaration of
// `xrpl_host_functions::FloatOrdering`, which links into the guest and so cannot use `cxx`.
enum class FloatOrdering : int32_t {

@kuznetsss kuznetsss Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enum duplicates the same one from host functions crate. I'll remove that duplication later by generating a c++ header file in host functions crate.

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.89474% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/xrpl-wasm-vm-ffi/src/lib.rs 80.0% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kuznetsss kuznetsss changed the title fix: Update float_compare() doc fix: Update float_compare() doc and refactor enum definition Sep 11, 2026
@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@github-actions

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant