-
Notifications
You must be signed in to change notification settings - Fork 37
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 jellyfish-json path based bignumber remapping #128
Conversation
Deploy preview for jellyfish-defi ready! Built with commit bb91e5e |
size-limit report 📦
|
Codecov Report
@@ Coverage Diff @@
## main #128 +/- ##
==========================================
- Coverage 94.32% 94.21% -0.12%
==========================================
Files 36 36
Lines 793 760 -33
Branches 92 87 -5
==========================================
- Hits 748 716 -32
Misses 42 42
+ Partials 3 2 -1
Continue to review full report at Codecov.
|
const { result, error } = JellyfishJSON.parse(text, { | ||
result: precision | ||
}) |
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.
wow yea this is a great
What kind of PR is this?:
/kind fix
What this PR does / why we need it:
A balancing act between BigNumber parsing and effective usage. I redesigned it to use path based mapping. It will map all within a path to the specific precision. This allow flexibility json parsing and an easy to use interface.
For the bellow setup, only
h
andd.f.f1
will be number, while the request get remapped toBigNumber
.I also changed JSON-RPC 1.0 to handle precision on result only.
Which issue(s) does this PR fixes?:
Fixes #104