fix bindings#81
Conversation
WalkthroughThe changes update the JavaScript API for fixed decimal conversions in the Changes
Sequence Diagram(s)sequenceDiagram
participant JS as JavaScript
participant Float as Float (Rust)
participant EVM as EVM Contract
JS->>Float: from_fixed_decimal_js(value: BigInt, decimals: u8)
Float->>Float: Convert BigInt to string, parse to U256
Float-->>JS: Result<Float, FloatError>
JS->>Float: to_fixed_decimal_js(decimals: u8)
Float->>Float: Convert to string, parse to BigInt
Float-->>JS: Result<BigInt, FloatError>
JS->>Float: lte(b: Float)
Float->>EVM: DecimalFloat::lteCall(self, b)
EVM-->>Float: bool
Float-->>JS: Result<bool, FloatError>
JS->>Float: gte(b: Float)
Float->>EVM: DecimalFloat::gteCall(self, b)
EVM-->>Float: bool
Float-->>JS: Result<bool, FloatError>
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (4)📓 Common learningstest_js/float.test.ts (8)crates/float/src/lib.rs (8)crates/float/src/js_api.rs (5)🧬 Code Graph Analysis (1)crates/float/src/lib.rs (2)
🪛 Biome (1.9.4)test_js/float.test.ts[error] 27-27: Forbidden non-null assertion. (lint/style/noNonNullAssertion) [error] 28-28: Forbidden non-null assertion. (lint/style/noNonNullAssertion) [error] 32-32: Forbidden non-null assertion. (lint/style/noNonNullAssertion) [error] 33-33: Forbidden non-null assertion. (lint/style/noNonNullAssertion) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (7)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Motivation
Solution
Fix the bindings
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
New Features
BigIntinputs and outputs instead of strings.Bug Fixes
Tests
BigIntfor fixed decimal operations in the JavaScript API.