Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update balance precheck to better handle large accounts #328

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

Nana-EC
Copy link
Collaborator

@Nana-EC Nana-EC commented Jul 12, 2022

Signed-off-by: Nana-EC nana@swirldslabs.com

Description:
Update balance precheck to better handle large accounts
Involve ethers in calculation

  • Add getAccountBalanceInTinyBar to sdkClient
  • Use ethers to calculate wei, thus avoid to string conversion management causing issue
  • Add integration tests

Related issue(s):

Fixes #327

Notes for reviewer:

Checklist

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

Signed-off-by: Nana-EC <nana@swirldslabs.com>
@Nana-EC Nana-EC self-assigned this Jul 12, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Nana-EC Nana-EC added bug Something isn't working P1 labels Jul 12, 2022
@Nana-EC Nana-EC added this to the 0.4.0 milestone Jul 12, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #328 (1251f11) into main (194e120) will increase coverage by 1.26%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main     #328      +/-   ##
==========================================
+ Coverage   58.29%   59.55%   +1.26%     
==========================================
  Files           9        9              
  Lines         856      858       +2     
  Branches      139      139              
==========================================
+ Hits          499      511      +12     
+ Misses        325      315      -10     
  Partials       32       32              
Impacted Files Coverage Δ
packages/relay/src/lib/clients/sdkClient.ts 6.79% <0.00%> (-0.14%) ⬇️
packages/relay/src/lib/precheck.ts 77.41% <100.00%> (+17.74%) ⬆️
packages/relay/src/lib/clients/mirrorNodeClient.ts 81.61% <0.00%> (+0.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 194e120...1251f11. Read the comment docs.

Copy link
Collaborator

@ar-conmit ar-conmit left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@natanasow natanasow left a comment

Choose a reason for hiding this comment

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

LGTM

@Nana-EC Nana-EC merged commit ffbe9ab into main Jul 12, 2022
@Nana-EC Nana-EC deleted the 327-handle-balance-exponent branch July 12, 2022 13:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working P1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Balance prechecks failing when balance uses exponent
4 participants