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

fix electrum floating-point arithmetic issue #61

Closed
wants to merge 1 commit into from

Conversation

zoedberg
Copy link
Contributor

Closes #62

Issue was due to the conversion from float to integer in let value = (vout.value * 100_000_000.0) as u64;

With this PR instead of parsing the TX outputs of the JSON TX returned by electrum we use the TX deserialized from its hex, this way we don't have to deal with floating-point arithmetic issues.

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 0.0%. Comparing base (dbfb8ba) to head (81346f6).
Report is 3 commits behind head on master.

Files Patch % Lines
src/indexers/electrum.rs 0.0% 9 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##           master    #61   +/-   ##
=====================================
  Coverage     0.0%   0.0%           
=====================================
  Files          23     23           
  Lines        2128   2123    -5     
=====================================
+ Misses       2128   2123    -5     
Flag Coverage Δ
rust 0.0% <0.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dr-orlovsky
Copy link
Member

Closing in favor of merged #63

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.

non-mandatory-script-verify-flag error when broadcasting tx with electrum
2 participants