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: integer overflow isuue for defaultMaxQueryPayment field #2213

Merged

Conversation

svetoslav-nikol0v
Copy link
Contributor

@svetoslav-nikol0v svetoslav-nikol0v commented Mar 19, 2024

Description:

Handles larger integer numbers when are set to defaultMaxQueryPayment field.

Fixes #2203

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.48%. Comparing base (7682060) to head (d8782b1).

❗ Current head d8782b1 differs from pull request most recent head 2387d4e. Consider uploading reports for the commit 2387d4e to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2213      +/-   ##
===========================================
+ Coverage    78.24%   84.48%   +6.23%     
===========================================
  Files          266      305      +39     
  Lines        66766    76288    +9522     
===========================================
+ Hits         52243    64453   +12210     
+ Misses       14523    11835    -2688     

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


it("should set defaultMaxQueryPayment field", async function () {
this.timeout(120000);
const value = new Hbar(100);
Copy link
Contributor

Choose a reason for hiding this comment

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

for the purpose of the test to demonstrate that can handle really large numbers I would suggest

Suggested change
const value = new Hbar(100);
const value = new Hbar(9223372036854775807);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need pass this number in that way Long.fromString('9223372036854775807') because is bigger than MAX_SAFE_INTEGER number.

Copy link
Contributor

@agadzhalov agadzhalov left a comment

Choose a reason for hiding this comment

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

LGTM

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.

setDefaultMaxQueryPayment integer overflow
3 participants