wharfkit / wharfkit/resources

REXState#value() returns an abnormal value

Open
#13 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
9
Forks
7
PR merge metrics
No merged PRs in 30d

Description

WX20240823-161452@2x

REXState#value():
public get value() { return ( (Number(this.total_lent.units) + Number(this.total_unlent.units)) / Number(this.total_rex.units) ) }

According to the screenshot above, If the value of total_rex is very large, Number(total_rex.units) will cause an exception, resulting in an exception in the REXState#value() method.

responase json:
{
"rows": [
{
"version": 0,
"total_lent": "6925421.9746 EOS",
"total_unlent": "124587204.5398 EOS",
"total_rent": "3698.4341 EOS",
"total_lendable": "131512626.5144 EOS",
"total_rex": "1181188743903.2468 REX",
"namebid_proceeds": "0.0000 EOS",
"loan_num": 504605
}
],
"more": false,
"next_key": ""
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the REXState#value() getter and reproduce the issue with the response shown in this report, especially the very large total_rex value. Done means the getter handles that input without throwing and returns an appropriate value.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.